N_NIMCALL(NimStringDesc*, getsystemconfigpath_186592)(NimStringDesc* filename) { NimStringDesc* result; NimStringDesc* p; TY176063 LOC1; result = 0; p = getprefixdir_154371(); memset((void*)LOC1, 0, sizeof(LOC1)); LOC1[0] = copyString(p); LOC1[1] = copyString(((NimStringDesc*) &TMP1892)); LOC1[2] = copyString(filename); result = nosjoinPathOpenArray(LOC1, 3); { NIM_BOOL LOC4; TY176063 LOC7; LOC4 = 0; LOC4 = nosexistsFile(result); if (!!(LOC4)) goto LA5; memset((void*)LOC7, 0, sizeof(LOC7)); LOC7[0] = copyString(p); LOC7[1] = copyString(((NimStringDesc*) &TMP1893)); LOC7[2] = copyString(filename); result = nosjoinPathOpenArray(LOC7, 3); } LA5: ; { NIM_BOOL LOC10; NimStringDesc* LOC13; LOC10 = 0; LOC10 = nosexistsFile(result); if (!!(LOC10)) goto LA11; LOC13 = 0; LOC13 = rawNewString(filename->Sup.len + 5); appendString(LOC13, ((NimStringDesc*) &TMP1894)); appendString(LOC13, filename); result = LOC13; } LA11: ; return result; }
N_NIMCALL(NimStringDesc*, getsystemconfigpath_291433_930198375)(NimStringDesc* filename0) { NimStringDesc* result0; NimStringDesc* p0; TY194140 LOC1; result0 = (NimStringDesc*)0; p0 = getprefixdir_170305_2607990831(); memset((void*)LOC1, 0, sizeof(LOC1)); LOC1[0] = copyString(p0); LOC1[1] = copyString(((NimStringDesc*) &T930198375_18)); LOC1[2] = copyString(filename0); result0 = nosjoinPathOpenArray(LOC1, 3); { NIM_BOOL LOC4; TY194140 LOC7; LOC4 = (NIM_BOOL)0; LOC4 = nosexistsFile(result0); if (!!(LOC4)) goto LA5; memset((void*)LOC7, 0, sizeof(LOC7)); LOC7[0] = copyString(p0); LOC7[1] = copyString(((NimStringDesc*) &T930198375_19)); LOC7[2] = copyString(filename0); result0 = nosjoinPathOpenArray(LOC7, 3); } LA5: ; { NIM_BOOL LOC10; NimStringDesc* LOC13; LOC10 = (NIM_BOOL)0; LOC10 = nosexistsFile(result0); if (!!(LOC10)) goto LA11; LOC13 = (NimStringDesc*)0; LOC13 = rawNewString(filename0->Sup.len + 5); appendString(LOC13, ((NimStringDesc*) &T930198375_20)); appendString(LOC13, filename0); result0 = LOC13; } LA11: ; return result0; }
N_NIMCALL(NimStringDesc*, rawfindfile_137266)(NimStringDesc* f) { NimStringDesc* result; NimStringDesc* it_137270; tstrentry117019* it_137274; nimfr("rawFindFile", "options.nim") result = 0; it_137270 = 0; nimln(305, "options.nim"); if (searchpaths_136115.Head) chckObj((*searchpaths_136115.Head).Sup.m_type, (&NTI117019)); it_137274 = ((tstrentry117019*) (searchpaths_136115.Head)); nimln(306, "options.nim"); while (1) { nimln(306, "options.nim"); nimln(306, "options.nim"); if (!!((it_137274 == NIM_NIL))) goto LA1; nimln(307, "options.nim"); it_137270 = (*it_137274).Data; nimln(312, "options.nim"); result = nosjoinPath(it_137270, f); nimln(313, "options.nim"); { NIM_BOOL LOC4; nimln(313, "options.nim"); LOC4 = 0; LOC4 = nosexistsFile(result); if (!LOC4) goto LA5; nimln(314, "options.nim"); nimln(314, "options.nim"); result = canonicalizepath_136335(result); goto BeforeRet; } LA5: ; nimln(308, "options.nim"); if ((*it_137274).Sup.Next) chckObj((*(*it_137274).Sup.Next).Sup.m_type, (&NTI117019)); it_137274 = ((tstrentry117019*) ((*it_137274).Sup.Next)); } LA1: ; nimln(315, "options.nim"); result = copyString(((NimStringDesc*) &TMP404)); BeforeRet: ; popFrame(); return result; }
N_NIMCALL(NimStringDesc*, findmodule_154351)(NimStringDesc* modulename, NimStringDesc* currentmodule) { NimStringDesc* result; NimStringDesc* m; NimStringDesc* currentpath; TY118589 LOC1; result = 0; m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP1485)); memset((void*)(&LOC1), 0, sizeof(LOC1)); nossplitFile(currentmodule, (&LOC1)); currentpath = LOC1.Field0; result = HEX2F_118292(currentpath, m); { NIM_BOOL LOC4; LOC4 = 0; LOC4 = nosexistsFile(result); if (!!(LOC4)) goto LA5; result = findfile_154341(m); } LA5: ; return result; }
N_NIMCALL(NimStringDesc*, rawfindfile2_137278)(NimStringDesc* f) { NimStringDesc* result; tstrentry117019* it; nimfr("rawFindFile2", "options.nim") result = 0; nimln(318, "options.nim"); if (lazypaths_136116.Head) chckObj((*lazypaths_136116.Head).Sup.m_type, (&NTI117019)); it = ((tstrentry117019*) (lazypaths_136116.Head)); nimln(319, "options.nim"); while (1) { nimln(319, "options.nim"); nimln(319, "options.nim"); if (!!((it == NIM_NIL))) goto LA1; nimln(320, "options.nim"); result = nosjoinPath((*it).Data, f); nimln(321, "options.nim"); { NIM_BOOL LOC4; nimln(321, "options.nim"); LOC4 = 0; LOC4 = nosexistsFile(result); if (!LOC4) goto LA5; nimln(322, "options.nim"); bringtofront_117758(&lazypaths_136116, &it->Sup); nimln(323, "options.nim"); nimln(323, "options.nim"); result = canonicalizepath_136335(result); goto BeforeRet; } LA5: ; nimln(324, "options.nim"); if ((*it).Sup.Next) chckObj((*(*it).Sup.Next).Sup.m_type, (&NTI117019)); it = ((tstrentry117019*) ((*it).Sup.Next)); } LA1: ; nimln(325, "options.nim"); result = copyString(((NimStringDesc*) &TMP404)); BeforeRet: ; popFrame(); return result; }
N_NIMCALL(NimStringDesc*, rawfindfile_114550)(NimStringDesc* f) { NimStringDesc* result; NimStringDesc* it_114554; tstrentry109016* it_114558; nimfr("rawFindFile", "options.nim") result = 0; it_114554 = 0; nimln(259, "options.nim"); if (searchpaths_114113.Head) chckObj((*searchpaths_114113.Head).Sup.m_type, (&NTI109016)); it_114558 = ((tstrentry109016*) (searchpaths_114113.Head)); nimln(260, "options.nim"); while (1) { nimln(698, "system.nim"); nimln(698, "system.nim"); if (!!((it_114558 == NIM_NIL))) goto LA1; nimln(261, "options.nim"); it_114554 = (*it_114558).Data; nimln(266, "options.nim"); result = nosJoinPath(it_114554, f); nimln(267, "options.nim"); { NIM_BOOL LOC4; nimln(267, "options.nim"); LOC4 = 0; LOC4 = nosexistsFile(result); if (!LOC4) goto LA5; nimln(268, "options.nim"); nimln(268, "options.nim"); result = canonicalizepath_114316(result); goto BeforeRet; } LA5: ; nimln(262, "options.nim"); if ((*it_114558).Sup.Next) chckObj((*(*it_114558).Sup.Next).Sup.m_type, (&NTI109016)); it_114558 = ((tstrentry109016*) ((*it_114558).Sup.Next)); } LA1: ; nimln(269, "options.nim"); result = copyString(((NimStringDesc*) &TMP313)); BeforeRet: ; popFrame(); return result; }
N_NIMCALL(NimStringDesc*, rawfindfile2_114562)(NimStringDesc* f) { NimStringDesc* result; tstrentry109016* it; nimfr("rawFindFile2", "options.nim") result = 0; nimln(272, "options.nim"); if (lazypaths_114114.Head) chckObj((*lazypaths_114114.Head).Sup.m_type, (&NTI109016)); it = ((tstrentry109016*) (lazypaths_114114.Head)); nimln(273, "options.nim"); while (1) { nimln(698, "system.nim"); nimln(698, "system.nim"); if (!!((it == NIM_NIL))) goto LA1; nimln(274, "options.nim"); result = nosJoinPath((*it).Data, f); nimln(275, "options.nim"); { NIM_BOOL LOC4; nimln(275, "options.nim"); LOC4 = 0; LOC4 = nosexistsFile(result); if (!LOC4) goto LA5; nimln(276, "options.nim"); bringtofront_109699(&lazypaths_114114, &it->Sup); nimln(277, "options.nim"); nimln(277, "options.nim"); result = canonicalizepath_114316(result); goto BeforeRet; } LA5: ; nimln(278, "options.nim"); if ((*it).Sup.Next) chckObj((*(*it).Sup.Next).Sup.m_type, (&NTI109016)); it = ((tstrentry109016*) ((*it).Sup.Next)); } LA1: ; nimln(279, "options.nim"); result = copyString(((NimStringDesc*) &TMP313)); BeforeRet: ; popFrame(); return result; }
static N_INLINE(NIM_BOOL, fileexists_117010)(NimStringDesc* filename) { NIM_BOOL result; result = 0; result = nosexistsFile(filename); return result; }
N_NIMCALL(NimStringDesc*, getapplheuristic_125404)(void) { NimStringDesc* result; { result = 0; result = paramstr_124809(((NI) 0)); { NIM_BOOL LOC3; LOC3 = 0; LOC3 = (((NI) 0) < (result ? result->Sup.len : 0)); if (!(LOC3)) goto LA4; LOC3 = !(((NU8)(result->data[((NI) 0)]) == (NU8)(47))); LA4: ; if (!LOC3) goto LA5; { NimStringDesc* p_125602; NimStringDesc* HEX3Atmp_125609; NI last_125614; p_125602 = 0; HEX3Atmp_125609 = 0; HEX3Atmp_125609 = getenv_121644(((NimStringDesc*) &TMP1147)); last_125614 = ((NI) 0); { while (1) { NI first_125616; if (!(last_125614 < (HEX3Atmp_125609 ? HEX3Atmp_125609->Sup.len : 0))) goto LA9; { while (1) { if (!(((NU8)(HEX3Atmp_125609->data[last_125614])) == ((NU8)(58)))) goto LA11; last_125614 += ((NI) 1); } LA11: ; } first_125616 = last_125614; { while (1) { NIM_BOOL LOC14; LOC14 = 0; LOC14 = (last_125614 < (HEX3Atmp_125609 ? HEX3Atmp_125609->Sup.len : 0)); if (!(LOC14)) goto LA15; LOC14 = !((((NU8)(HEX3Atmp_125609->data[last_125614])) == ((NU8)(58)))); LA15: ; if (!LOC14) goto LA13; last_125614 += ((NI) 1); } LA13: ; } { NimStringDesc* x; if (!(first_125616 <= (NI)(last_125614 - ((NI) 1)))) goto LA18; p_125602 = copyStrLast(HEX3Atmp_125609, first_125616, (NI)(last_125614 - ((NI) 1))); x = nosjoinPath(p_125602, result); { NIM_BOOL LOC22; LOC22 = 0; LOC22 = nosexistsFile(x); if (!LOC22) goto LA23; result = copyString(x); goto BeforeRet; } LA23: ; } LA18: ; } LA9: ; } } } LA5: ; }BeforeRet: ; return result; }
N_NIMCALL(NimStringDesc*, findexe_126616)(NimStringDesc* exe) { NimStringDesc* result; NimStringDesc* path; { result = 0; result = nosaddFileExt(exe, ((NimStringDesc*) &TMP136)); { NIM_BOOL LOC3; LOC3 = 0; LOC3 = nosexistsFile(result); if (!LOC3) goto LA4; goto BeforeRet; } LA4: ; path = getenv_121644(((NimStringDesc*) &TMP1147)); { NimStringDesc* candidate_126621; NI last_126807; candidate_126621 = 0; last_126807 = ((NI) 0); { if (!(((NI) 0) < (path ? path->Sup.len : 0))) goto LA9; { while (1) { NI first_126809; NimStringDesc* x; NimStringDesc* LOC17; if (!(last_126807 <= (path ? path->Sup.len : 0))) goto LA12; first_126809 = last_126807; { while (1) { NIM_BOOL LOC15; LOC15 = 0; LOC15 = (last_126807 < (path ? path->Sup.len : 0)); if (!(LOC15)) goto LA16; LOC15 = !(((NU8)(path->data[last_126807]) == (NU8)(58))); LA16: ; if (!LOC15) goto LA14; last_126807 += ((NI) 1); } LA14: ; } candidate_126621 = copyStrLast(path, first_126809, (NI)(last_126807 - ((NI) 1))); LOC17 = 0; LOC17 = expandtilde_126610(candidate_126621); x = HEX2F_118292(LOC17, result); { NIM_BOOL LOC20; LOC20 = 0; LOC20 = nosexistsFile(x); if (!LOC20) goto LA21; result = copyString(x); goto BeforeRet; } LA21: ; last_126807 += ((NI) 1); } LA12: ; } } LA9: ; } result = copyString(((NimStringDesc*) &TMP136)); }BeforeRet: ; return result; }
static N_INLINE(NIM_BOOL, fileexists_131604_2125978480)(NimStringDesc* filename0) { NIM_BOOL result0; result0 = (NIM_BOOL)0; result0 = nosexistsFile(filename0); return result0; }