1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
|
/* Generated by Nim Compiler v2.2.0 */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <stdlib.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
typedef struct tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w;
typedef struct tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ;
typedef struct tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg;
typedef struct tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw;
typedef struct tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ tySequence__S89cE01OvNjsN9c71FKsSrqQ;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content;
typedef struct tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA;
typedef struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
NimStringV2 Field0;
NimStringV2 Field1;
NimStringV2 Field2;
};
struct tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w {
NI bytes;
NI16* data;
};
typedef N_STDCALL_PTR(NI32, tyProc__G0MNqLrkAnRVz4cDlgVcRg) (NI handle_p0, NI16* buf_p1, NI32 size_p2);
typedef NI16 tyUncheckedArray__Tyd4y3haUOOHTj71TPIRag[1];
typedef N_STDCALL_PTR(NI32, tyProc__Rzv0SS9bu3vYSxhvPQEKMBQ) (NI16* lpFileName_p0, NI32 nBufferLength_p1, NI16* lpBuffer_p2, NI16** lpFilePart_p3);
struct tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg {
NI32 dwLowDateTime;
NI32 dwHighDateTime;
};
typedef NI16 tyArray__EKfNt9b8uxndgFbu2Ky3XAQ[260];
typedef NI16 tyArray__Get9cpRTS5VjGKP6CDsI9bYA[14];
struct tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ {
NI32 dwFileAttributes;
tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg ftCreationTime;
tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg ftLastAccessTime;
tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg ftLastWriteTime;
NI32 nFileSizeHigh;
NI32 nFileSizeLow;
NI32 dwReserved0;
NI32 dwReserved1;
tyArray__EKfNt9b8uxndgFbu2Ky3XAQ cFileName;
tyArray__Get9cpRTS5VjGKP6CDsI9bYA cAlternateFileName;
};
typedef N_STDCALL_PTR(NI32, tyProc__jG85NyrZ9ayUwtzbNvd5JMQ) (NI hFindFile_p0, tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ* lpFindFileData_p1);
typedef N_STDCALL_PTR(NI32, tyProc__9bXer9a4ps9aSGctILcxWReVw) (void);
typedef N_STDCALL_PTR(void, tyProc__ofoySXaAAlxxs9bQS9a1etlg) (NI hFindFile_p0);
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
void* vTable[SEQ_DECL_SIZE];
};
struct RootObj {
TNimTypeV2* m_type;
};
struct tySequence__S89cE01OvNjsN9c71FKsSrqQ {
NI len; tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content* p;
};
struct Exception {
RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__S89cE01OvNjsN9c71FKsSrqQ trace;
Exception* up;
};
struct tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg {
Exception Sup;
};
struct tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw {
tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg Sup;
NI32 errorCode;
};
typedef NimStringV2 tyArray__24KAM9afIUgUaqBaEBB6r9bg[3];
struct tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA {
NI64 seconds;
NI nanosecond;
};
struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content { NI cap; tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShellWindows)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrutils_u1833)(NimStringV2 s_p0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars_p1);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1713)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2597)(NimStringV2 dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShell)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2600)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetHomeDir)(void);
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u90)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosjoinPath)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8447)(NimStringV2 s_p0, NI first_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(void, nossplitFile)(NimStringV2 path_p0, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppFilename)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w, newWideCString__stdZwidestrs_u278)(NI size_p0);
static N_INLINE(NI16*, toWideCString__stdZwidestrs_u49)(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w x_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2606)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZwidestrs_u35)(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w* a_p0, tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w b_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZwidestrs_u7)(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w a_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___stdZwidestrs_u388)(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w s_p0, NI estimate_p1, NI replacement_p2);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZosdirs_u87)(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w, newWideCString__stdZwidestrs_u316)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_u123)(NI32 errorCode_p0, NimStringV2 additionalInfo_p1);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_u126)(void);
N_LIB_PRIVATE N_NIMCALL(NI, findFirstFile__stdZprivateZoscommon_u25)(NimStringV2 a_p0, tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ* b_p1);
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__stdZprivateZospaths2_u287)(NimStringV2 path_p0);
static N_INLINE(NIM_BOOL, skipFindData__stdZprivateZoscommon_u34)(tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ* f_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___stdZwidestrs_u385)(NI16* s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2603)(NimStringV2 src_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosextractFilename)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2594)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringV2 filename_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosdirExists)(NimStringV2 dir_p0);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e_p0, NCSTRING ename_p1, NCSTRING procname_p2, NCSTRING filename_p3, NI line_p4);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosaddFileExt)(NimStringV2 filename_p0, NimStringV2 ext_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getEnv__stdZenvvars_u35)(NimStringV2 key_p0, NimStringV2 default_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8435)(NimStringV2 s_p0, NI first_p1, NI last_p2);
static N_INLINE(NIM_CHAR, X5BX5D___system_u7877)(NimStringV2 s_p0, NI i_p1);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u157)(int status_p0);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, fromWinTime__pureZtimes_u1244)(NI64 win_p0);
N_LIB_PRIVATE N_NIMCALL(NI64, rdFileTime__windowsZwinlean_u284)(tyObject_FILETIME__Meeq39cIrx4bjJVTNbXXQxg f_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, ntLtTime)(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA a_p0, tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA b_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, nosgetLastModificationTime)(NimStringV2 file_p0);
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__yu6cxgKBBXbNsTkT9cyMd4g_2 = {
0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_3 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_4 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_5 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const struct {
NI cap; NIM_CHAR data[1+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_6 = { 1 | NIM_STRLIT_FLAG, "\"" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_7 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_6};
static const struct {
NI cap; NIM_CHAR data[2+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_8 = { 2 | NIM_STRLIT_FLAG, "\\\"" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_9 = {2, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_8};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_10 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_6};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_11 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const struct {
NI cap; NIM_CHAR data[1+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_12 = { 1 | NIM_STRLIT_FLAG, " " };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_13 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_12};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_14 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_15 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
extern TNimTypeV2 NTIv2__SuJIQW5BO0Kx9aOoF3Fjwkw_;
static const struct {
NI cap; NIM_CHAR data[6+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_16 = { 6 | NIM_STRLIT_FLAG, "file \'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_17 = {6, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_16};
static const struct {
NI cap; NIM_CHAR data[16+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_18 = { 16 | NIM_STRLIT_FLAG, "\' does not exist" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_19 = {16, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_18};
static const struct {
NI cap; NIM_CHAR data[4+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_20 = { 4 | NIM_STRLIT_FLAG, "PATH" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_21 = {4, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_20};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_22 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_23 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_3};
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_24 = { 3 | NIM_STRLIT_FLAG, "exe" };
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_25 = { 3 | NIM_STRLIT_FLAG, "cmd" };
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_26 = { 3 | NIM_STRLIT_FLAG, "bat" };
N_LIB_PRIVATE NIM_CONST tyArray__24KAM9afIUgUaqBaEBB6r9bg ExeExts__pureZos_u70 = {{3, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_24},
{3, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_25},
{3, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_26}}
;
extern NIM_BOOL nimInErrorMode__system_u4274;
extern tyProc__G0MNqLrkAnRVz4cDlgVcRg Dl_1426063557_;
extern tyProc__Rzv0SS9bu3vYSxhvPQEKMBQ Dl_1426063619_;
extern tyProc__jG85NyrZ9ayUwtzbNvd5JMQ Dl_1426063614_;
extern tyProc__9bXer9a4ps9aSGctILcxWReVw Dl_1426063531_;
extern tyProc__ofoySXaAAlxxs9bQS9a1etlg Dl_1426063617_;
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, copyMem__system_u1713)(void* dest_p0, void* source_p1, NI size_p2) {
nimCopyMem(dest_p0, source_p1, size_p2);
}
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {
{
if (!(((NI)0) < src_p1.len)) goto LA3_;
copyMem__system_u1713(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI)(src_p1.len + ((NI)1))));
(*dest_p0).len += src_p1.len;
}
LA3_: ;
}
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1) {
prepareAdd(s_p0, ((NI)1));
(*(*s_p0).p).data[(*s_p0).len] = c_p1;
(*s_p0).len += ((NI)1);
(*(*s_p0).p).data[(*s_p0).len] = 0;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4274);
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShellWindows)(NimStringV2 s_p0) {
NimStringV2 result;
NimStringV2 backslashBuff;
NIM_BOOL needQuote;
NIM_BOOL T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
backslashBuff.len = 0; backslashBuff.p = NIM_NIL;
T1_ = (NIM_BOOL)0;
T1_ = contains__pureZstrutils_u1833(s_p0, TM__yu6cxgKBBXbNsTkT9cyMd4g_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (T1_) goto LA2_;
T1_ = (s_p0.len == ((NI)0));
LA2_: ;
needQuote = T1_;
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_4;
backslashBuff = TM__yu6cxgKBBXbNsTkT9cyMd4g_5;
{
if (!needQuote) goto LA5_;
prepareAdd((&result), 1);
appendString((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_7);
}
LA5_: ;
{
NIM_CHAR c;
NI i;
NI L;
c = (NIM_CHAR)0;
i = ((NI)0);
L = s_p0.len;
{
while (1) {
if (!(i < L)) goto LA9;
c = s_p0.p->data[i];
{
if (!((NU8)(c) == (NU8)(92))) goto LA12_;
nimAddCharV1((&backslashBuff), c);
}
goto LA10_;
LA12_: ;
{
if (!((NU8)(c) == (NU8)(34))) goto LA15_;
{
NI i_2;
NI colontmp_;
NI i_3;
i_2 = (NI)0;
colontmp_ = (NI)0;
colontmp_ = (NI)(backslashBuff.len * ((NI)2));
i_3 = ((NI)0);
{
while (1) {
if (!(i_3 < colontmp_)) goto LA19;
i_2 = i_3;
nimAddCharV1((&result), 92);
i_3 += ((NI)1);
} LA19: ;
}
}
setLengthStrV2((&backslashBuff), ((NI)0));
prepareAdd((&result), 2);
appendString((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_9);
}
goto LA10_;
LA15_: ;
{
{
if (!!((backslashBuff.len == ((NI)0)))) goto LA23_;
prepareAdd((&result), backslashBuff.len + 0);
appendString((&result), backslashBuff);
setLengthStrV2((&backslashBuff), ((NI)0));
}
LA23_: ;
nimAddCharV1((&result), c);
}
LA10_: ;
i += ((NI)1);
} LA9: ;
}
}
{
if (!(((NI)0) < backslashBuff.len)) goto LA27_;
prepareAdd((&result), backslashBuff.len + 0);
appendString((&result), backslashBuff);
}
LA27_: ;
{
if (!needQuote) goto LA31_;
prepareAdd((&result), backslashBuff.len + 0);
appendString((&result), backslashBuff);
prepareAdd((&result), 1);
appendString((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_10);
}
LA31_: ;
eqdestroy___system_u2597(backslashBuff);
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShell)(NimStringV2 s_p0) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
result = nospquoteShellWindows(s_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, quoteShellCommand__pureZos_u57)(NimStringV2* args_p0, NI args_p0Len_0) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_11;
{
NI i;
NI colontmp_;
NI i_2;
i = (NI)0;
colontmp_ = (NI)0;
colontmp_ = args_p0Len_0;
i_2 = ((NI)0);
{
while (1) {
NimStringV2 colontmpD_;
if (!(i_2 < colontmp_)) goto LA3;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
i = i_2;
{
if (!(((NI)0) < i)) goto LA6_;
prepareAdd((&result), 1);
appendString((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_13);
}
LA6_: ;
colontmpD_ = nospquoteShell(args_p0[i]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
prepareAdd((&result), colontmpD_.len + 0);
appendString((&result), colontmpD_);
i_2 += ((NI)1);
eqdestroy___system_u2597(colontmpD_);
} LA3: ;
}
}
}BeforeRet_: ;
return result;
}
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u90)(NimStringV2 head_p0, NimStringV2 tail_p1) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
result = nosjoinPath(head_p0, tail_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, expandTilde__pureZos_u32)(NimStringV2 path_p0) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = (path_p0.len == ((NI)0));
if (T3_) goto LA4_;
T3_ = !(((NU8)(path_p0.p->data[((NI)0)]) == (NU8)(126)));
LA4_: ;
if (!T3_) goto LA5_;
eqcopy___system_u2600((&result), path_p0);
}
goto LA1_;
LA5_: ;
{
if (!(path_p0.len == ((NI)1))) goto LA8_;
result = nosgetHomeDir();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
goto LA1_;
LA8_: ;
{
NimStringV2 colontmpD_;
NimStringV2 colontmpD__2;
if (!(((NU8)(path_p0.p->data[((NI)1)])) == ((NU8)(92)) || ((NU8)(path_p0.p->data[((NI)1)])) == ((NU8)(47)))) goto LA11_;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
colontmpD_ = nosgetHomeDir();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
colontmpD__2 = substr__system_u8447(path_p0, ((NI)2));
result = slash___stdZprivateZospaths2_u90(colontmpD_, colontmpD__2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
eqdestroy___system_u2597(colontmpD__2);
eqdestroy___system_u2597(colontmpD_);
}
goto LA1_;
LA11_: ;
{
eqcopy___system_u2600((&result), path_p0);
}
LA1_: ;
}BeforeRet_: ;
return result;
}
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(NI16*, toWideCString__stdZwidestrs_u49)(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w x_p0) {
NI16* result;
result = x_p0.data;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppFilename)(void) {
NimStringV2 result;
tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w buf;
NI32 bufsize;
NIM_BOOL oldNimErrFin1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
nimZeroMem((void*)(&buf), sizeof(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w));
bufsize = ((NI32)260);
buf = newWideCString__stdZwidestrs_u278(((NI) (bufsize)));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
{
while (1) {
NI32 L;
NI16* T4_;
T4_ = (NI16*)0;
T4_ = toWideCString__stdZwidestrs_u49(buf);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
L = Dl_1426063557_(((NI)0), T4_, bufsize);
{
if (!(L == ((NI32)0))) goto LA7_;
eqsink___system_u2606((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_14);
goto LA2;
}
goto LA5_;
LA7_: ;
{
tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w T12_;
if (!(bufsize < L)) goto LA10_;
T12_ = newWideCString__stdZwidestrs_u278(((NI) (L)));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___stdZwidestrs_u7(T12_); goto LA1_;}
eqsink___stdZwidestrs_u35((&buf), T12_);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
bufsize = L;
}
goto LA5_;
LA10_: ;
{
NimStringV2 T14_;
T14_.len = 0; T14_.p = NIM_NIL;
T14_ = dollar___stdZwidestrs_u388(buf, ((NI) (L)), ((NI)65533));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T14_); goto LA1_;}
eqsink___system_u2606((&result), T14_);
goto LA2;
}
LA5_: ;
}
} LA2: ;
{
LA1_:;
}
{
oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
eqdestroy___stdZwidestrs_u7(buf);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
*nimErr_ = oldNimErrFin1_;
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppDir)(void) {
NimStringV2 result;
tyTuple__7q7q3E6Oj24ZNVJb9aonhAg colontmpD_;
NimStringV2 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
nimZeroMem((void*)(&colontmpD_), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
T1_.len = 0; T1_.p = NIM_NIL;
T1_ = nosgetAppFilename();
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T1_); goto BeforeRet_;}
nossplitFile(T1_, (&colontmpD_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
eqcopy___system_u2600((&result), colontmpD_.Field0);
eqdestroy___stdZprivateZosdirs_u87((&colontmpD_));
}BeforeRet_: ;
return result;
}
static N_INLINE(NIM_BOOL, skipFindData__stdZprivateZoscommon_u34)(tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ* f_p0) {
NIM_BOOL result;
NIM_BOOL T1_;
NIM_BOOL T3_;
NIM_BOOL T5_;
T1_ = (NIM_BOOL)0;
T1_ = (((NI) ((*f_p0).cFileName[(((NI)0))- 0])) == ((NI)46));
if (!(T1_)) goto LA2_;
T3_ = (NIM_BOOL)0;
T3_ = (((NI) ((*f_p0).cFileName[(((NI)1))- 0])) == ((NI)0));
if (T3_) goto LA4_;
T5_ = (NIM_BOOL)0;
T5_ = (((NI) ((*f_p0).cFileName[(((NI)1))- 0])) == ((NI)46));
if (!(T5_)) goto LA6_;
T5_ = (((NI) ((*f_p0).cFileName[(((NI)2))- 0])) == ((NI)0));
LA6_: ;
T3_ = T5_;
LA4_: ;
T1_ = T3_;
LA2_: ;
result = T1_;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosexpandFilename)(NimStringV2 filename_p0) {
NimStringV2 result;
tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w res;
NI32 bufsize;
NI16* unused;
NIM_BOOL oldNimErrFin4_;
NIM_BOOL oldNimErrFin1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
nimZeroMem((void*)(&res), sizeof(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w));
bufsize = ((NI32)260);
unused = ((NI16*) NIM_NIL);
res = newWideCString__stdZwidestrs_u278(((NI) (bufsize)));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
{
while (1) {
tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w colontmpD_;
NI32 L;
NI16* T5_;
NI16* T6_;
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w));
colontmpD_ = newWideCString__stdZwidestrs_u316(filename_p0);
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
T5_ = (NI16*)0;
T5_ = toWideCString__stdZwidestrs_u49(colontmpD_);
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
T6_ = (NI16*)0;
T6_ = toWideCString__stdZwidestrs_u49(res);
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
L = Dl_1426063619_(T5_, bufsize, T6_, &unused);
{
NI32 T11_;
if (!(L == ((NI32)0))) goto LA9_;
T11_ = (NI32)0;
T11_ = osLastError__stdZoserrors_u126();
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
raiseOSError__stdZoserrors_u123(T11_, filename_p0);
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
}
goto LA7_;
LA9_: ;
{
tyObject_WideCStringObj__S69bIyvbp2ySa2Didg6Np7w T15_;
if (!(bufsize < L)) goto LA13_;
T15_ = newWideCString__stdZwidestrs_u278(((NI) (L)));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___stdZwidestrs_u7(T15_); goto LA4_;}
eqsink___stdZwidestrs_u35((&res), T15_);
if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
bufsize = L;
}
goto LA7_;
LA13_: ;
{
NimStringV2 T17_;
T17_.len = 0; T17_.p = NIM_NIL;
T17_ = dollar___stdZwidestrs_u388(res, ((NI) (L)), ((NI)65533));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T17_); goto LA4_;}
eqsink___system_u2606((&result), T17_);
eqdestroy___stdZwidestrs_u7(colontmpD_);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
goto LA2;
}
LA7_: ;
{
LA4_:;
}
{
oldNimErrFin4_ = *nimErr_; *nimErr_ = NIM_FALSE;
eqdestroy___stdZwidestrs_u7(colontmpD_);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
*nimErr_ = oldNimErrFin4_;
}
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
} LA2: ;
{
NimStringV2 x;
tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ fX60gensym10_;
NI resX60gensym10_;
x.len = 0; x.p = NIM_NIL;
nimZeroMem((void*)(&fX60gensym10_), sizeof(tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ));
resX60gensym10_ = (NI)0;
resX60gensym10_ = findFirstFile__stdZprivateZoscommon_u25(result, (&fX60gensym10_));
if (NIM_UNLIKELY(*nimErr_)) goto LA21_;
{
NI dotPosX60gensym10_;
if (!!((resX60gensym10_ == ((NI)-1)))) goto LA24_;
dotPosX60gensym10_ = searchExtPos__stdZprivateZospaths2_u287(result);
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
{
while (1) {
{
NIM_BOOL T31_;
NIM_BOOL T32_;
NimStringV2 ffX60gensym10_;
NI idxX60gensym10_;
T31_ = (NIM_BOOL)0;
T32_ = (NIM_BOOL)0;
T32_ = skipFindData__stdZprivateZoscommon_u34((&fX60gensym10_));
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
T31_ = !(T32_);
if (!(T31_)) goto LA33_;
T31_ = !(!(((NI32)(fX60gensym10_.dwFileAttributes & ((NI32)16)) == ((NI32)0))));
LA33_: ;
if (!T31_) goto LA34_;
ffX60gensym10_.len = 0; ffX60gensym10_.p = NIM_NIL;
ffX60gensym10_ = dollar___stdZwidestrs_u385(((NI16*) ((&fX60gensym10_.cFileName[(((NI)0))- 0]))));
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
idxX60gensym10_ = (NI)((NI)(ffX60gensym10_.len - result.len) + dotPosX60gensym10_);
{
NIM_BOOL T38_;
NIM_BOOL T39_;
NIM_BOOL T40_;
NIM_BOOL T43_;
NIM_BOOL T46_;
NIM_BOOL T47_;
NimStringV2 colontmpD__2;
tyTuple__7q7q3E6Oj24ZNVJb9aonhAg colontmpD__3;
NimStringV2 colontmpD__4;
NimStringV2 T52_;
T38_ = (NIM_BOOL)0;
T39_ = (NIM_BOOL)0;
T40_ = (NIM_BOOL)0;
T40_ = (dotPosX60gensym10_ < ((NI)0));
if (T40_) goto LA41_;
T40_ = (ffX60gensym10_.len <= idxX60gensym10_);
LA41_: ;
T39_ = T40_;
if (T39_) goto LA42_;
T43_ = (NIM_BOOL)0;
T43_ = (((NI)0) <= idxX60gensym10_);
if (!(T43_)) goto LA44_;
T43_ = ((NU8)(ffX60gensym10_.p->data[idxX60gensym10_]) == (NU8)(46));
LA44_: ;
T39_ = T43_;
LA42_: ;
T38_ = T39_;
if (T38_) goto LA45_;
T46_ = (NIM_BOOL)0;
T47_ = (NIM_BOOL)0;
T47_ = (((NI)0) <= dotPosX60gensym10_);
if (!(T47_)) goto LA48_;
T47_ = ((NI)(dotPosX60gensym10_ + ((NI)1)) < result.len);
LA48_: ;
T46_ = T47_;
if (!(T46_)) goto LA49_;
T46_ = ((NU8)(result.p->data[(NI)(dotPosX60gensym10_ + ((NI)1))]) == (NU8)(42));
LA49_: ;
T38_ = T46_;
LA45_: ;
if (!T38_) goto LA50_;
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
nimZeroMem((void*)(&colontmpD__3), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL;
colontmpD__2 = eqdup___system_u2603(result);
nossplitFile(colontmpD__2, (&colontmpD__3));
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
colontmpD__4 = nosextractFilename(ffX60gensym10_);
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
T52_.len = 0; T52_.p = NIM_NIL;
T52_ = slash___stdZprivateZospaths2_u90(colontmpD__3.Field0, colontmpD__4);
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T52_); goto LA26_;}
eqsink___system_u2606((&x), T52_);
eqsink___system_u2606((&result), x);
eqwasMoved___system_u2594((&x));
eqdestroy___system_u2597(colontmpD__4);
eqdestroy___stdZprivateZosdirs_u87((&colontmpD__3));
}
LA50_: ;
eqdestroy___system_u2597(ffX60gensym10_);
}
LA34_: ;
{
NI32 T55_;
NI32 errCodeX60gensym10_;
T55_ = (NI32)0;
T55_ = Dl_1426063614_(resX60gensym10_, (&fX60gensym10_));
if (!(T55_ == ((NI32)0))) goto LA56_;
errCodeX60gensym10_ = Dl_1426063531_();
{
if (!(errCodeX60gensym10_ == ((NI32)18))) goto LA60_;
goto LA27;
}
goto LA58_;
LA60_: ;
{
raiseOSError__stdZoserrors_u123(errCodeX60gensym10_, TM__yu6cxgKBBXbNsTkT9cyMd4g_15);
if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
}
LA58_: ;
}
LA56_: ;
}
} LA27: ;
{
LA26_:;
}
{
Dl_1426063617_(resX60gensym10_);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA21_;
}
LA24_: ;
{
LA21_:;
}
{
eqdestroy___system_u2597(x);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
{
NIM_BOOL T69_;
NIM_BOOL T70_;
NIM_BOOL T72_;
tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw* T75_;
NimStringV2 T76_;
T69_ = (NIM_BOOL)0;
T70_ = (NIM_BOOL)0;
T70_ = nosfileExists(result);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T69_ = !(T70_);
if (!(T69_)) goto LA71_;
T72_ = (NIM_BOOL)0;
T72_ = nosdirExists(result);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T69_ = !(T72_);
LA71_: ;
if (!T69_) goto LA73_;
T75_ = NIM_NIL;
T75_ = (tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw*) nimNewObj(sizeof(tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw), NIM_ALIGNOF(tyObject_OSError__SuJIQW5BO0Kx9aOoF3Fjwkw));
(*T75_).Sup.Sup.Sup.m_type = (&NTIv2__SuJIQW5BO0Kx9aOoF3Fjwkw_);
(*T75_).Sup.Sup.name = "OSError";
T76_.len = 0; T76_.p = NIM_NIL;
T76_ = rawNewString(result.len + 22);
appendString((&T76_), TM__yu6cxgKBBXbNsTkT9cyMd4g_17);
appendString((&T76_), result);
appendString((&T76_), TM__yu6cxgKBBXbNsTkT9cyMd4g_19);
(*T75_).Sup.Sup.message = T76_;
(*T75_).Sup.Sup.parent = ((Exception*) NIM_NIL);
raiseExceptionEx((Exception*)T75_, "OSError", "expandFilename", "os.nim", 444);
goto LA1_;
}
LA73_: ;
{
LA1_:;
}
{
oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
eqdestroy___stdZwidestrs_u7(res);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
*nimErr_ = oldNimErrFin1_;
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
static N_INLINE(NIM_CHAR, X5BX5D___system_u7877)(NimStringV2 s_p0, NI i_p1) {
NIM_CHAR result;
result = s_p0.p->data[(NI)(s_p0.len - i_p1)];
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, findExe__pureZos_u71)(NimStringV2 exe_p0, NIM_BOOL followSymlinks_p1, NimStringV2* extensions_p2, NI extensions_p2Len_0) {
NimStringV2 result;
NimStringV2 path;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
path.len = 0; path.p = NIM_NIL;
{
if (!(exe_p0.len == ((NI)0))) goto LA4_;
eqdestroy___system_u2597(path);
goto BeforeRet_;
}
LA4_: ;
{
NimStringV2* extX60gensym8_;
NI i;
extX60gensym8_ = (NimStringV2*)0;
i = ((NI)0);
{
while (1) {
NimStringV2 T9_;
if (!(i < extensions_p2Len_0)) goto LA8;
extX60gensym8_ = (&extensions_p2[i]);
T9_.len = 0; T9_.p = NIM_NIL;
T9_ = nosaddFileExt(exe_p0, (*extX60gensym8_));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T9_); goto LA1_;}
eqsink___system_u2606((&result), T9_);
{
NIM_BOOL T12_;
T12_ = (NIM_BOOL)0;
T12_ = nosfileExists(result);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
if (!T12_) goto LA13_;
eqdestroy___system_u2597(path);
goto BeforeRet_;
}
LA13_: ;
i += ((NI)1);
} LA8: ;
}
}
path = getEnv__stdZenvvars_u35(TM__yu6cxgKBBXbNsTkT9cyMd4g_21, TM__yu6cxgKBBXbNsTkT9cyMd4g_22);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
{
NimStringV2 candidate;
NI lastX60gensym34_;
NI splitsX60gensym34_;
candidate.len = 0; candidate.p = NIM_NIL;
lastX60gensym34_ = ((NI)0);
splitsX60gensym34_ = ((NI)-1);
{
while (1) {
NI firstX60gensym34_;
NimStringV2 T27_;
if (!(lastX60gensym34_ <= path.len)) goto LA18;
firstX60gensym34_ = lastX60gensym34_;
{
while (1) {
NIM_BOOL T21_;
T21_ = (NIM_BOOL)0;
T21_ = (lastX60gensym34_ < path.len);
if (!(T21_)) goto LA22_;
T21_ = !(((NU8)(path.p->data[lastX60gensym34_]) == (NU8)(59)));
LA22_: ;
if (!T21_) goto LA20;
lastX60gensym34_ += ((NI)1);
} LA20: ;
}
{
if (!(splitsX60gensym34_ == ((NI)0))) goto LA25_;
lastX60gensym34_ = path.len;
}
LA25_: ;
T27_.len = 0; T27_.p = NIM_NIL;
T27_ = substr__system_u8435(path, firstX60gensym34_, (NI)(lastX60gensym34_ - ((NI)1)));
eqsink___system_u2606((&candidate), T27_);
{
NimStringV2 x;
NimStringV2 colontmpD_;
NimStringV2 colontmpD__2;
NimStringV2 T34_;
x.len = 0; x.p = NIM_NIL;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
{
if (!(candidate.len == ((NI)0))) goto LA32_;
eqdestroy___system_u2597(colontmpD__2);
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
goto LA28;
}
LA32_: ;
T34_.len = 0; T34_.p = NIM_NIL;
{
NIM_BOOL T37_;
NIM_CHAR T39_;
T37_ = (NIM_BOOL)0;
T37_ = ((NU8)(candidate.p->data[((NI)0)]) == (NU8)(34));
if (!(T37_)) goto LA38_;
T39_ = (NIM_CHAR)0;
T39_ = X5BX5D___system_u7877(candidate, ((NI)1));
if (NIM_UNLIKELY(*nimErr_)) goto LA29_;
T37_ = ((NU8)(T39_) == (NU8)(34));
LA38_: ;
if (!T37_) goto LA40_;
colontmpD_ = substr__system_u8435(candidate, ((NI)1), (NI)(candidate.len - ((NI)2)));
T34_ = colontmpD_;
}
goto LA35_;
LA40_: ;
{
colontmpD__2 = candidate;
eqwasMoved___system_u2594((&candidate));
T34_ = colontmpD__2;
}
LA35_: ;
x = slash___stdZprivateZospaths2_u90(T34_, exe_p0);
if (NIM_UNLIKELY(*nimErr_)) goto LA29_;
{
NimStringV2* ext;
NI i_2;
ext = (NimStringV2*)0;
i_2 = ((NI)0);
{
while (1) {
NimStringV2 x_2;
if (!(i_2 < extensions_p2Len_0)) goto LA45;
x_2.len = 0; x_2.p = NIM_NIL;
ext = (&extensions_p2[i_2]);
x_2 = nosaddFileExt(x, (*ext));
if (NIM_UNLIKELY(*nimErr_)) goto LA46_;
{
NIM_BOOL T49_;
T49_ = (NIM_BOOL)0;
T49_ = nosfileExists(x_2);
if (NIM_UNLIKELY(*nimErr_)) goto LA46_;
if (!T49_) goto LA50_;
result = x_2;
eqwasMoved___system_u2594((&x_2));
eqdestroy___system_u2597(x_2);
eqdestroy___system_u2597(colontmpD__2);
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
eqdestroy___system_u2597(candidate);
eqdestroy___system_u2597(path);
goto BeforeRet_;
}
LA50_: ;
i_2 += ((NI)1);
{
LA46_:;
}
{
eqdestroy___system_u2597(x_2);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA29_;
} LA45: ;
}
}
{
LA29_:;
}
{
eqdestroy___system_u2597(colontmpD__2);
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
} LA28: ;
{
if (!(splitsX60gensym34_ == ((NI)0))) goto LA58_;
goto LA17;
}
LA58_: ;
splitsX60gensym34_ -= ((NI)1);
lastX60gensym34_ += ((NI)1);
} LA18: ;
} LA17: ;
{
LA16_:;
}
{
eqdestroy___system_u2597(candidate);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_23;
{
LA1_:;
}
{
eqdestroy___system_u2597(path);
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u157)(int status_p0) {
int result;
result = status_p0;
return result;
}
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0) {
NCSTRING result;
{
if (!(s_p0.len == ((NI)0))) goto LA3_;
result = "";
}
goto LA1_;
LA3_: ;
{
result = ((NCSTRING) ((*s_p0.p).data));
}
LA1_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nosexecShellCmd)(NimStringV2 command_p0) {
NI result;
int T1_;
int T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI)0;
T1_ = (int)0;
T1_ = system(nimToCStringConv(command_p0));
T2_ = (int)0;
T2_ = exitStatusLikeShell__pureZos_u157(T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI) (T2_));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, nosgetLastModificationTime)(NimStringV2 file_p0) {
tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA result;
tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ f;
NI h;
NI64 T6_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA));
nimZeroMem((void*)(&f), sizeof(tyObject_WIN32_FIND_DATA__5ZnB2Z0FCjJIB0LNM9aQVwQ));
h = findFirstFile__stdZprivateZoscommon_u25(file_p0, (&f));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NI32 T5_;
if (!(h == ((NI)-1))) goto LA3_;
T5_ = (NI32)0;
T5_ = osLastError__stdZoserrors_u126();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
raiseOSError__stdZoserrors_u123(T5_, file_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
T6_ = (NI64)0;
T6_ = rdFileTime__windowsZwinlean_u284(f.ftLastWriteTime);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = fromWinTime__pureZtimes_u1244(T6_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
Dl_1426063617_(h);
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileNewer)(NimStringV2 a_p0, NimStringV2 b_p1) {
NIM_BOOL result;
tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA T1_;
tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = nosgetLastModificationTime(b_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = nosgetLastModificationTime(a_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ntLtTime(T1_, T2_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
|