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
|
/* Generated by Nim Compiler v2.2.0 */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.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 TNimTypeV2 TNimTypeV2;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
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;
};
typedef int tyArray__N9auXnwcX0YaPCc9cZcwg3KA[4];
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;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
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, nospquoteShellPosix)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, allCharsInSet__pureZstrutils_u1502)(NimStringV2 s_p0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw theSet_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2600)(NimStringV2* dest_p0, NimStringV2 src_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(NimStringV2, nsuReplaceStr)(NimStringV2 s_p0, NimStringV2 sub_p1, NimStringV2 by_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2597)(NimStringV2 dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShell)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetHomeDir)(void);
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u91)(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_u8372)(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(NimStringV2, getApplFreebsd__pureZos_u165)(void);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
static N_INLINE(NI, nimCStrLen)(NCSTRING a_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2606)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getApplHeuristic__pureZos_u194)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, paramStr__stdZcmdline_u56)(NI i_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getEnv__stdZenvvars_u15)(NimStringV2 key_p0, NimStringV2 default_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8360)(NimStringV2 s_p0, NI first_p1, NI last_p2);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringV2 filename_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2594)(NimStringV2* dest_p0);
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2);
static N_INLINE(Exception*, nimBorrowCurrentException)(void);
static N_INLINE(void, popCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___stdZassertions_u22)(Exception** dest_p0, Exception* src_p1, NIM_BOOL cyclic_p2);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZos_u205)(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* dest_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_u119)(NI32 errorCode_p0, NimStringV2 additionalInfo_p1);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_u122)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, cstrToNimstr)(NCSTRING str_p0);
static N_INLINE(NIM_BOOL, contains__stdZprivateZospaths2_u383)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1);
static N_INLINE(NI, find__stdZprivateZospaths2_u388)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosaddFileExt)(NimStringV2 filename_p0, NimStringV2 ext_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, expandTilde__pureZos_u35)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nossymlinkExists)(NimStringV2 link_p0);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosparentDir)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u120)(int status_p0);
static N_INLINE(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, toTime__pureZos_u27)(struct timespec ts_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, initTime__pureZtimes_u1181)(NI64 unix_p0, NI nanosecond_p1);
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 const struct {
NI cap; NIM_CHAR data[2+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_2 = { 2 | NIM_STRLIT_FLAG, "\'\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_3 = {2, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_2};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__yu6cxgKBBXbNsTkT9cyMd4g_4 = {
0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0xff, 0x27,
0xff, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static const struct {
NI cap; NIM_CHAR data[1+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_5 = { 1 | NIM_STRLIT_FLAG, "\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_6 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_7 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const struct {
NI cap; NIM_CHAR data[5+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_8 = { 5 | NIM_STRLIT_FLAG, "\'\"\'\"\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_9 = {5, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_8};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_10 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_11 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_12 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const struct {
NI cap; NIM_CHAR data[1+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_13 = { 1 | NIM_STRLIT_FLAG, " " };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_14 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_13};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_16 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_17 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const struct {
NI cap; NIM_CHAR data[4+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_18 = { 4 | NIM_STRLIT_FLAG, "PATH" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_19 = {4, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_18};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_20 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_21 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_22 = {4, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_18};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_23 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_24 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static NIM_CONST tyArray__N9auXnwcX0YaPCc9cZcwg3KA TM__yu6cxgKBBXbNsTkT9cyMd4g_15 = {((int)1),
((int)14),
((int)12),
((int)-1)}
;
N_LIB_PRIVATE NIM_CONST tyArray__nHXaesL0DJZHyVS07ARPRA ExeExts__pureZos_u75 = {{0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11}}
;
extern NIM_BOOL nimInErrorMode__system_u4276;
extern Exception* currException__system_u3980;
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(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4276);
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShellPosix)(NimStringV2 s_p0) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
{
if (!(s_p0.len == ((NI)0))) goto LA3_;
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_3;
}
goto LA1_;
LA3_: ;
{
NIM_BOOL T6_;
T6_ = (NIM_BOOL)0;
T6_ = allCharsInSet__pureZstrutils_u1502(s_p0, TM__yu6cxgKBBXbNsTkT9cyMd4g_4);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T6_) goto LA7_;
eqcopy___system_u2600((&result), s_p0);
}
goto LA1_;
LA7_: ;
{
NimStringV2 colontmpD_;
NimStringV2 T10_;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
T10_.len = 0; T10_.p = NIM_NIL;
colontmpD_ = nsuReplaceStr(s_p0, TM__yu6cxgKBBXbNsTkT9cyMd4g_7, TM__yu6cxgKBBXbNsTkT9cyMd4g_9);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T10_ = rawNewString(colontmpD_.len + 2);
appendString((&T10_), TM__yu6cxgKBBXbNsTkT9cyMd4g_6);
appendString((&T10_), colontmpD_);
appendString((&T10_), TM__yu6cxgKBBXbNsTkT9cyMd4g_10);
result = T10_;
eqdestroy___system_u2597(colontmpD_);
}
LA1_: ;
}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 = nospquoteShellPosix(s_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, quoteShellCommand__pureZos_u60)(NimStringV2* args_p0, NI args_p0Len_0) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_12;
{
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_14);
}
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_u91)(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_u35)(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)(47)) || ((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_u8372(path_p0, ((NI)2));
result = slash___stdZprivateZospaths2_u91(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(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;
}
static N_INLINE(NI, nimCStrLen)(NCSTRING a_p0) {
NI result;
size_t T5_;
{ result = (NI)0;
{
if (!(a_p0 == 0)) goto LA3_;
result = ((NI)0);
goto BeforeRet_;
}
LA3_: ;
T5_ = (size_t)0;
T5_ = strlen(a_p0);
result = ((NI) (T5_));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getApplFreebsd__pureZos_u165)(void) {
NimStringV2 result;
size_t pathLength;
tyArray__N9auXnwcX0YaPCc9cZcwg3KA req;
int res;
NI realLen;
{ result.len = 0; result.p = NIM_NIL;
pathLength = ((size_t)0);
nimZeroMem((void*)req, sizeof(tyArray__N9auXnwcX0YaPCc9cZcwg3KA));
nimCopyMem((void*)req, (NIM_CONST void*)TM__yu6cxgKBBXbNsTkT9cyMd4g_15, sizeof(tyArray__N9auXnwcX0YaPCc9cZcwg3KA));
res = sysctl((&req[(((NI)0))- 0]), ((unsigned int)4), NIM_NIL, (&pathLength), NIM_NIL, ((size_t)0));
{
if (!(res < ((NI32)0))) goto LA3_;
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_16;
goto BeforeRet_;
}
LA3_: ;
setLengthStrV2((&result), ((NI) (pathLength)));
res = sysctl((&req[(((NI)0))- 0]), ((unsigned int)4), ((void*) ((&result.p->data[((NI)0)]))), (&pathLength), NIM_NIL, ((size_t)0));
{
if (!(res < ((NI32)0))) goto LA7_;
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_17;
goto BeforeRet_;
}
LA7_: ;
realLen = nimCStrLen(nimToCStringConv(result));
setLengthStrV2((&result), (realLen));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getApplHeuristic__pureZos_u194)(void) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
result = paramStr__stdZcmdline_u56(((NI)0));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = (((NI)0) < result.len);
if (!(T3_)) goto LA4_;
T3_ = !(((NU8)(result.p->data[((NI)0)]) == (NU8)(47)));
LA4_: ;
if (!T3_) goto LA5_;
{
NimStringV2 p;
NimStringV2 colontmp_;
NI lastX60gensym37_;
NI splitsX60gensym37_;
p.len = 0; p.p = NIM_NIL;
colontmp_.len = 0; colontmp_.p = NIM_NIL;
colontmp_ = getEnv__stdZenvvars_u15(TM__yu6cxgKBBXbNsTkT9cyMd4g_19, TM__yu6cxgKBBXbNsTkT9cyMd4g_20);
if (NIM_UNLIKELY(*nimErr_)) goto LA8_;
lastX60gensym37_ = ((NI)0);
splitsX60gensym37_ = ((NI)-1);
{
while (1) {
NimStringV2 x;
NI firstX60gensym37_;
NimStringV2 T20_;
if (!(lastX60gensym37_ <= colontmp_.len)) goto LA10;
x.len = 0; x.p = NIM_NIL;
firstX60gensym37_ = lastX60gensym37_;
{
while (1) {
NIM_BOOL T14_;
T14_ = (NIM_BOOL)0;
T14_ = (lastX60gensym37_ < colontmp_.len);
if (!(T14_)) goto LA15_;
T14_ = !((((NU8)(colontmp_.p->data[lastX60gensym37_])) == ((NU8)(58))));
LA15_: ;
if (!T14_) goto LA13;
lastX60gensym37_ += ((NI)1);
} LA13: ;
}
{
if (!(splitsX60gensym37_ == ((NI)0))) goto LA18_;
lastX60gensym37_ = colontmp_.len;
}
LA18_: ;
T20_.len = 0; T20_.p = NIM_NIL;
T20_ = substr__system_u8360(colontmp_, firstX60gensym37_, (NI)(lastX60gensym37_ - ((NI)1)));
eqsink___system_u2606((&p), T20_);
x = nosjoinPath(p, result);
if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
{
NIM_BOOL T23_;
T23_ = (NIM_BOOL)0;
T23_ = nosfileExists(x);
if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
if (!T23_) goto LA24_;
result = x;
eqwasMoved___system_u2594((&x));
eqdestroy___system_u2597(x);
eqdestroy___system_u2597(colontmp_);
eqdestroy___system_u2597(p);
goto BeforeRet_;
}
LA24_: ;
{
if (!(splitsX60gensym37_ == ((NI)0))) goto LA28_;
eqdestroy___system_u2597(x);
goto LA9;
}
LA28_: ;
splitsX60gensym37_ -= ((NI)1);
lastX60gensym37_ += ((NI)1);
{
LA11_:;
}
{
eqdestroy___system_u2597(x);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA8_;
} LA10: ;
} LA9: ;
{
LA8_:;
}
{
eqdestroy___system_u2597(colontmp_);
eqdestroy___system_u2597(p);
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
}
LA5_: ;
}BeforeRet_: ;
return result;
}
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2) {
NIM_BOOL result;
NIM_BOOL T1_;
T1_ = (NIM_BOOL)0;
T1_ = (targetDepth_p1 <= (*source_p0).depth);
if (!(T1_)) goto LA2_;
T1_ = ((*source_p0).display[targetDepth_p1] == token_p2);
LA2_: ;
result = T1_;
return result;
}
static N_INLINE(Exception*, nimBorrowCurrentException)(void) {
Exception* result;
result = currException__system_u3980;
return result;
}
static N_INLINE(void, popCurrentException)(void) {
eqcopy___stdZassertions_u22(&currException__system_u3980, (*currException__system_u3980).up, NIM_FALSE);
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppFilename)(void) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
result = getApplFreebsd__pureZos_u165();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NimStringV2 T6_;
NimStringV2 T7_;
if (!(result.len == ((NI)0))) goto LA3_;
T6_.len = 0; T6_.p = NIM_NIL;
T7_.len = 0; T7_.p = NIM_NIL;
T7_ = getApplHeuristic__pureZos_u194();
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T7_); goto LA5_;}
eqsink___system_u2606((&result), T7_);
if (NIM_UNLIKELY(*nimErr_)) {
LA5_:;
if (isObjDisplayCheck(nimBorrowCurrentException()->Sup.m_type, 3, 3796386048)) {
*nimErr_ = NIM_FALSE;
eqsink___system_u2606((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_21);
popCurrentException();
LA9_:;
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppDir)(void) {
NimStringV2 result;
NimStringV2 colontmpD_;
tyTuple__7q7q3E6Oj24ZNVJb9aonhAg colontmpD__2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
nimZeroMem((void*)(&colontmpD__2), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
colontmpD_ = nosgetAppFilename();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
nossplitFile(colontmpD_, (&colontmpD__2));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
eqcopy___system_u2600((&result), colontmpD__2.Field0);
eqdestroy___pureZos_u205((&colontmpD__2));
eqdestroy___system_u2597(colontmpD_);
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosexpandFilename)(NimStringV2 filename_p0) {
NimStringV2 result;
NCSTRING r;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
r = realpath(nimToCStringConv(filename_p0), ((NCSTRING) NIM_NIL));
{
NI32 T5_;
if (!(r == 0)) goto LA3_;
T5_ = (NI32)0;
T5_ = osLastError__stdZoserrors_u122();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
raiseOSError__stdZoserrors_u119(T5_, filename_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
goto LA1_;
LA3_: ;
{
result = cstrToNimstr(r);
free(((void*) (r)));
}
LA1_: ;
}BeforeRet_: ;
return result;
}
static N_INLINE(NI, find__stdZprivateZospaths2_u388)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1) {
NI result;
{ result = ((NI)0);
{
NIM_CHAR i;
NI i_2;
i = (NIM_CHAR)0;
i_2 = ((NI)0);
{
while (1) {
if (!(i_2 < a_p0Len_0)) goto LA3;
i = a_p0[i_2];
{
if (!((NU8)(i) == (NU8)(item_p1))) goto LA6_;
goto BeforeRet_;
}
LA6_: ;
result += ((NI)1);
i_2 += ((NI)1);
} LA3: ;
}
}
result = ((NI)-1);
}BeforeRet_: ;
return result;
}
static N_INLINE(NIM_BOOL, contains__stdZprivateZospaths2_u383)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1) {
NIM_BOOL result;
NI T1_;
{ T1_ = (NI)0;
T1_ = find__stdZprivateZospaths2_u388(a_p0, a_p0Len_0, item_p1);
result = (((NI)0) <= T1_);
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, findExe__pureZos_u76)(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_: ;
{
NIM_BOOL T8_;
T8_ = (NIM_BOOL)0;
T8_ = contains__stdZprivateZospaths2_u383(((exe_p0).p) ? (exe_p0.p->data) : NIM_NIL, exe_p0.len, 47);
if (!T8_) goto LA9_;
{
NimStringV2* extX60gensym9_;
NI i;
extX60gensym9_ = (NimStringV2*)0;
i = ((NI)0);
{
while (1) {
NimStringV2 T14_;
if (!(i < extensions_p2Len_0)) goto LA13;
extX60gensym9_ = (&extensions_p2[i]);
T14_.len = 0; T14_.p = NIM_NIL;
T14_ = nosaddFileExt(exe_p0, (*extX60gensym9_));
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T14_); goto LA1_;}
eqsink___system_u2606((&result), T14_);
{
NIM_BOOL T17_;
T17_ = (NIM_BOOL)0;
T17_ = nosfileExists(result);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
if (!T17_) goto LA18_;
eqdestroy___system_u2597(path);
goto BeforeRet_;
}
LA18_: ;
i += ((NI)1);
} LA13: ;
}
}
}
LA9_: ;
path = getEnv__stdZenvvars_u15(TM__yu6cxgKBBXbNsTkT9cyMd4g_22, TM__yu6cxgKBBXbNsTkT9cyMd4g_23);
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 T32_;
if (!(lastX60gensym34_ <= path.len)) goto LA23;
firstX60gensym34_ = lastX60gensym34_;
{
while (1) {
NIM_BOOL T26_;
T26_ = (NIM_BOOL)0;
T26_ = (lastX60gensym34_ < path.len);
if (!(T26_)) goto LA27_;
T26_ = !(((NU8)(path.p->data[lastX60gensym34_]) == (NU8)(58)));
LA27_: ;
if (!T26_) goto LA25;
lastX60gensym34_ += ((NI)1);
} LA25: ;
}
{
if (!(splitsX60gensym34_ == ((NI)0))) goto LA30_;
lastX60gensym34_ = path.len;
}
LA30_: ;
T32_.len = 0; T32_.p = NIM_NIL;
T32_ = substr__system_u8360(path, firstX60gensym34_, (NI)(lastX60gensym34_ - ((NI)1)));
eqsink___system_u2606((&candidate), T32_);
{
NimStringV2 x;
NimStringV2 colontmpD_;
x.len = 0; x.p = NIM_NIL;
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
{
if (!(candidate.len == ((NI)0))) goto LA37_;
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
goto LA33;
}
LA37_: ;
colontmpD_ = expandTilde__pureZos_u35(candidate);
if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
x = slash___stdZprivateZospaths2_u91(colontmpD_, exe_p0);
if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
{
NimStringV2* ext;
NI i_2;
ext = (NimStringV2*)0;
i_2 = ((NI)0);
{
while (1) {
NimStringV2 x_2;
if (!(i_2 < extensions_p2Len_0)) goto LA41;
x_2.len = 0; x_2.p = NIM_NIL;
ext = (&extensions_p2[i_2]);
x_2 = nosaddFileExt(x, (*ext));
if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
{
NIM_BOOL T45_;
T45_ = (NIM_BOOL)0;
T45_ = nosfileExists(x_2);
if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
if (!T45_) goto LA46_;
{
while (1) {
if (!followSymlinks_p1) goto LA49;
{
NIM_BOOL T52_;
NimStringV2 r;
NI len;
T52_ = (NIM_BOOL)0;
T52_ = nossymlinkExists(x_2);
if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
if (!T52_) goto LA53_;
r.len = 0; r.p = NIM_NIL;
r = mnewString(((NI)1024));
len = readlink(nimToCStringConv(x_2), nimToCStringConv(r), ((NI)1024));
{
NI32 T60_;
if (!(len < ((NI)0))) goto LA58_;
T60_ = (NI32)0;
T60_ = osLastError__stdZoserrors_u122();
if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
raiseOSError__stdZoserrors_u119(T60_, exe_p0);
if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
}
LA58_: ;
{
NimStringV2 T65_;
if (!(((NI)1024) < len)) goto LA63_;
T65_.len = 0; T65_.p = NIM_NIL;
T65_ = mnewString(((NI)(len + ((NI)1))));
eqsink___system_u2606((&r), T65_);
len = readlink(nimToCStringConv(x_2), nimToCStringConv(r), len);
}
LA63_: ;
setLengthStrV2((&r), (len));
{
NIM_BOOL T68_;
T68_ = (NIM_BOOL)0;
T68_ = nosisAbsolute(r);
if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
if (!T68_) goto LA69_;
eqsink___system_u2606((&x_2), r);
eqwasMoved___system_u2594((&r));
}
goto LA66_;
LA69_: ;
{
NimStringV2 colontmpD__2;
NimStringV2 T72_;
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
colontmpD__2 = nosparentDir(x_2);
if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
T72_.len = 0; T72_.p = NIM_NIL;
T72_ = slash___stdZprivateZospaths2_u91(colontmpD__2, r);
if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2597(T72_); goto LA55_;}
eqsink___system_u2606((&x_2), T72_);
eqdestroy___system_u2597(colontmpD__2);
}
LA66_: ;
{
LA55_:;
}
{
eqdestroy___system_u2597(r);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
}
goto LA50_;
LA53_: ;
{
goto LA48;
}
LA50_: ;
} LA49: ;
} LA48: ;
result = x_2;
eqwasMoved___system_u2594((&x_2));
eqdestroy___system_u2597(x_2);
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
eqdestroy___system_u2597(candidate);
eqdestroy___system_u2597(path);
goto BeforeRet_;
}
LA46_: ;
i_2 += ((NI)1);
{
LA42_:;
}
{
eqdestroy___system_u2597(x_2);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
} LA41: ;
}
}
{
LA34_:;
}
{
eqdestroy___system_u2597(colontmpD_);
eqdestroy___system_u2597(x);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA21_;
} LA33: ;
{
if (!(splitsX60gensym34_ == ((NI)0))) goto LA82_;
goto LA22;
}
LA82_: ;
splitsX60gensym34_ -= ((NI)1);
lastX60gensym34_ += ((NI)1);
} LA23: ;
} LA22: ;
{
LA21_:;
}
{
eqdestroy___system_u2597(candidate);
}
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
result = TM__yu6cxgKBBXbNsTkT9cyMd4g_24;
{
LA1_:;
}
{
eqdestroy___system_u2597(path);
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u120)(int status_p0) {
int result;
NI32 colontmpD_;
int colontmpD__2;
colontmpD_ = (NI32)0;
colontmpD__2 = (int)0;
{
NIM_BOOL T3_;
int T6_;
T3_ = (NIM_BOOL)0;
T3_ = WIFSIGNALED(status_p0);
if (!T3_) goto LA4_;
T6_ = (int)0;
T6_ = WTERMSIG(status_p0);
colontmpD_ = (NI32)(((NI32)128) + T6_);
result = colontmpD_;
}
goto LA1_;
LA4_: ;
{
colontmpD__2 = WEXITSTATUS(status_p0);
result = colontmpD__2;
}
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_u120(T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI) (T2_));
}BeforeRet_: ;
return result;
}
static N_INLINE(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, toTime__pureZos_u27)(struct timespec ts_p0) {
tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA));
result = initTime__pureZtimes_u1181(((NI64) (ts_p0.tv_sec)), (ts_p0.tv_nsec));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, nosgetLastModificationTime)(NimStringV2 file_p0) {
tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA result;
struct stat res;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA));
nimZeroMem((void*)(&res), sizeof(struct stat));
{
int T3_;
NI32 T6_;
T3_ = (int)0;
T3_ = stat(nimToCStringConv(file_p0), (&res));
if (!(T3_ < ((NI32)0))) goto LA4_;
T6_ = (NI32)0;
T6_ = osLastError__stdZoserrors_u122();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
raiseOSError__stdZoserrors_u119(T6_, file_p0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA4_: ;
result = toTime__pureZos_u27(res.st_mtim);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}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;
}
|