N_NIMCALL(TY68202*, nospstartProcess)(NimStringDesc* Command_68238, NimStringDesc* Workingdir_68239, NimStringDesc** Args_68244, NI Args_68244Len0, TY66408* Env_68245, NU8 Options_68248) { TY68202* Result_69330; TY69331 Pstdin_69333; TY69331 Pstdout_69334; TY69331 Pstderr_69335; NIM_BOOL LOC2; int LOC3; int LOC5; NI Pid_69355; int LOC14; int LOC16; int LOC19; int LOC21; int LOC28; int LOC32; int LOC35; int LOC37; NCSTRING* A_69412; TY47805 LOC46; int LOC50; NCSTRING* LOC51; int LOC52; NimStringDesc* X_69424; NCSTRING* A_69433; TY47805 LOC53; int LOC57; NCSTRING* LOC58; int LOC59; NimStringDesc* LOC60; NCSTRING LOC61; NimStringDesc* LOC62; NimStringDesc* LOC66; NimStringDesc* LOC67; int LOC71; int LOC72; int LOC73; Result_69330 = 0; memset((void*)&Pstdin_69333, 0, sizeof(Pstdin_69333)); memset((void*)&Pstdout_69334, 0, sizeof(Pstdout_69334)); memset((void*)&Pstderr_69335, 0, sizeof(Pstderr_69335)); Result_69330 = (TY68202*) newObj(NTI68204, sizeof(TY68202)); (*Result_69330).Sup.m_type = NTI68202; (*Result_69330).Exitcode = ((NI32) 3); LOC3 = pipe(Pstdin_69333); LOC2 = !((LOC3 == ((NI32) 0))); if (LOC2) goto LA4; LOC5 = pipe(Pstdout_69334); LOC2 = !((LOC5 == ((NI32) 0))); LA4: ; if (!LOC2) goto LA6; nosOSError(((NimStringDesc*) &TMP196863)); LA6: ; Pid_69355 = 0; Pid_69355 = fork(); if (!(Pid_69355 < 0)) goto LA9; nosOSError(((NimStringDesc*) &TMP196864)); LA9: ; if (!(Pid_69355 == 0)) goto LA12; LOC14 = close(Pstdin_69333[(1)-0]); LOC16 = dup2(Pstdin_69333[(0)-0], ((NI32) 0)); if (!(((NI) (LOC16)) < 0)) goto LA17; nosOSError(((NimStringDesc*) &TMP196865)); LA17: ; LOC19 = close(Pstdout_69334[(0)-0]); LOC21 = dup2(Pstdout_69334[(1)-0], ((NI32) 1)); if (!(((NI) (LOC21)) < 0)) goto LA22; nosOSError(((NimStringDesc*) &TMP196865)); LA22: ; if (!((Options_68248 &(1<<((((NU8) 2))&7)))!=0)) goto LA25; LOC28 = dup2(Pstdout_69334[(1)-0], ((NI32) 2)); if (!(((NI) (LOC28)) < 0)) goto LA29; nosOSError(((NimStringDesc*) &TMP196865)); LA29: ; goto LA24; LA25: ; LOC32 = pipe(Pstderr_69335); if (!!((LOC32 == ((NI32) 0)))) goto LA33; nosOSError(((NimStringDesc*) &TMP196863)); LA33: ; LOC35 = close(Pstderr_69335[(0)-0]); LOC37 = dup2(Pstderr_69335[(1)-0], ((NI32) 2)); if (!(((NI) (LOC37)) < 0)) goto LA38; nosOSError(((NimStringDesc*) &TMP196865)); LA38: ; LA24: ; if (!(0 < Workingdir_68239->Sup.len)) goto LA41; Setcurrentdir_38201(Workingdir_68239); LA41: ; if (!!(((Options_68248 &(1<<((((NU8) 1))&7)))!=0))) goto LA44; A_69412 = 0; memset((void*)&LOC46, 0, sizeof(LOC46)); LOC46[0] = nosextractFilename(Command_68238); A_69412 = Tocstringarray_69218(LOC46, 1, Args_68244, Args_68244Len0); if (!(Env_68245 == NIM_NIL)) goto LA48; LOC50 = execv(Command_68238->data, A_69412); goto LA47; LA48: ; LOC51 = Tocstringarray_69290(Env_68245); LOC52 = execve(Command_68238->data, A_69412, LOC51); LA47: ; goto LA43; LA44: ; X_69424 = 0; X_69424 = Addcmdargs_69203(Command_68238, Args_68244, Args_68244Len0); A_69433 = 0; memset((void*)&LOC53, 0, sizeof(LOC53)); LOC53[0] = copyString(X_69424); A_69433 = Tocstringarray_69218(TMP196868, 2, LOC53, 1); if (!(Env_68245 == NIM_NIL)) goto LA55; LOC57 = execv("/bin/sh", A_69433); goto LA54; LA55: ; LOC58 = Tocstringarray_69290(Env_68245); LOC59 = execve("/bin/sh", A_69433, LOC58); LA54: ; LA43: ; LOC60 = 0; LOC61 = strerror(errno); LOC62 = 0; LOC62 = cstrToNimstr(LOC61); LOC60 = rawNewString(LOC62->Sup.len + 20); appendString(LOC60, ((NimStringDesc*) &TMP196871)); appendString(LOC60, LOC62); Quit_21140(LOC60); LA12: ; if (!((Options_68248 &(1<<((((NU8) 0))&7)))!=0)) goto LA64; LOC66 = 0; LOC67 = 0; LOC67 = nsuJoinSep(Args_68244, Args_68244Len0, ((NimStringDesc*) &TMP196867)); LOC66 = rawNewString(Command_68238->Sup.len + LOC67->Sup.len + 1); appendString(LOC66, Command_68238); appendString(LOC66, ((NimStringDesc*) &TMP196867)); appendString(LOC66, LOC67); rawEcho(LOC66); rawEchoNL(); LA64: ; (*Result_69330).Id = ((int) (Pid_69355)); (*Result_69330).Inputhandle = Pstdin_69333[(1)-0]; (*Result_69330).Outputhandle = Pstdout_69334[(0)-0]; if (!((Options_68248 &(1<<((((NU8) 2))&7)))!=0)) goto LA69; (*Result_69330).Errorhandle = (*Result_69330).Outputhandle; goto LA68; LA69: ; (*Result_69330).Errorhandle = Pstderr_69335[(0)-0]; LOC71 = close(Pstderr_69335[(1)-0]); LA68: ; LOC72 = close(Pstdin_69333[(0)-0]); LOC73 = close(Pstdout_69334[(1)-0]); return Result_69330; }
N_NIMCALL(void, npcnext)(tcfgparser156014* c, tcfgevent156008* Result) { switch ((*c).Tok.Kind) { case ((NU8) 1): { (*Result).Kind = ((NU8) 0); } break; case ((NU8) 7): { rawgettok_156048(c, &(*c).Tok); chckNil((void*)Result); genericReset((void*)Result, (&NTI156008)); (*Result).Sup.m_type = (&NTI156008); getkeyvalpair_156899(c, ((NU8) 3), Result); } break; case ((NU8) 2): { chckNil((void*)Result); genericReset((void*)Result, (&NTI156008)); (*Result).Sup.m_type = (&NTI156008); getkeyvalpair_156899(c, ((NU8) 2), Result); } break; case ((NU8) 5): { rawgettok_156048(c, &(*c).Tok); { if (!((*c).Tok.Kind == ((NU8) 2))) goto LA7; (*Result).Kind = ((NU8) 1); unsureAsgnRef((void**) &(*Result).kindU.S2.Section, copyString((*c).Tok.Literal)); } goto LA5; LA7: ; { NimStringDesc* LOC10; (*Result).Kind = ((NU8) 4); LOC10 = 0; LOC10 = rawNewString((*c).Tok.Literal->Sup.len + 28); appendString(LOC10, ((NimStringDesc*) &TMP138)); appendString(LOC10, (*c).Tok.Literal); unsureAsgnRef((void**) &(*Result).kindU.S4.Msg, npcerrorStr(&(*c), LOC10)); } LA5: ; rawgettok_156048(c, &(*c).Tok); { if (!((*c).Tok.Kind == ((NU8) 6))) goto LA13; rawgettok_156048(c, &(*c).Tok); } goto LA11; LA13: ; { NimStringDesc* LOC16; genericReset((void*)Result, (&NTI156008)); (*Result).Kind = ((NU8) 4); LOC16 = 0; LOC16 = rawNewString((*c).Tok.Literal->Sup.len + 25); appendString(LOC16, ((NimStringDesc*) &TMP140)); appendString(LOC16, (*c).Tok.Literal); unsureAsgnRef((void**) &(*Result).kindU.S4.Msg, npcerrorStr(&(*c), LOC16)); } LA11: ; } break; case ((NU8) 0): case ((NU8) 3): case ((NU8) 4): case ((NU8) 6): { NimStringDesc* LOC18; (*Result).Kind = ((NU8) 4); LOC18 = 0; LOC18 = rawNewString((*c).Tok.Literal->Sup.len + 15); appendString(LOC18, ((NimStringDesc*) &TMP141)); appendString(LOC18, (*c).Tok.Literal); unsureAsgnRef((void**) &(*Result).kindU.S4.Msg, npcerrorStr(&(*c), LOC18)); rawgettok_156048(c, &(*c).Tok); } break; } }
N_NIMCALL(void, parseuri_203007)(NimStringDesc* uri, Uri201012* result) { NI i; NIM_BOOL doubleslash; NIM_BOOL LOC1; NI LOC11; { reseturi_201196(result); i = ((NI) 0); LOC1 = 0; LOC1 = (((NI) 1) < (uri ? uri->Sup.len : 0)); if (!(LOC1)) goto LA2; LOC1 = ((NU8)(uri->data[((NI) 1)]) == (NU8)(47)); LA2: ; doubleslash = LOC1; { if (!((NU8)(uri->data[i]) == (NU8)(47))) goto LA5; { if (!!(doubleslash)) goto LA9; parsepath_201121(uri, (&i), result); goto BeforeRet; } LA9: ; } LA5: ; LOC11 = 0; LOC11 = parsewhile_97054(uri, (&(*result).scheme), TMP1168, i); i += LOC11; { NIM_BOOL LOC14; LOC14 = 0; LOC14 = !(((NU8)(uri->data[i]) == (NU8)(58))); if (!(LOC14)) goto LA15; LOC14 = !(doubleslash); LA15: ; if (!LOC14) goto LA16; i = ((NI) 0); (*result).scheme = setLengthStr((*result).scheme, ((NI) 0)); parsepath_201121(uri, (&i), result); goto BeforeRet; } LA16: ; { if (!!(doubleslash)) goto LA20; i += ((NI) 1); } LA20: ; { NIM_BOOL LOC24; NimStringDesc* authority; NI LOC28; LOC24 = 0; LOC24 = ((NU8)(uri->data[i]) == (NU8)(47)); if (!(LOC24)) goto LA25; LOC24 = ((NU8)(uri->data[(NI)(i + ((NI) 1))]) == (NU8)(47)); LA25: ; if (!LOC24) goto LA26; i += ((NI) 2); authority = copyString(((NimStringDesc*) &TMP1133)); LOC28 = 0; LOC28 = parseuntil_96981(uri, (&authority), TMP1169, i); i += LOC28; { Valueerror3849* e_203083; NimStringDesc* LOC33; if (!((authority) && (authority)->Sup.len == 0)) goto LA31; e_203083 = 0; e_203083 = (Valueerror3849*) newObj((&NTI24828), sizeof(Valueerror3849)); (*e_203083).Sup.Sup.m_type = (&NTI3849); LOC33 = 0; LOC33 = (*e_203083).Sup.message; (*e_203083).Sup.message = copyStringRC1(((NimStringDesc*) &TMP1170)); if (LOC33) nimGCunrefNoCycle(LOC33); raiseException((Exception*)e_203083, "ValueError"); } LA31: ; parseauthority_201072(authority, result); } goto LA22; LA26: ; { (*result).opaque = NIM_TRUE; } LA22: ; parsepath_201121(uri, (&i), result); }BeforeRet: ; }
N_NIMCALL(void, parseassignment_185441)(Tlexer180185* L, Ttoken180181* tok) { Tlineinfo162338 info; NimStringDesc* s; NimStringDesc* val; NIM_BOOL percent; Tident166021* LOC22; { NIM_BOOL LOC3; Tident166021* LOC4; Tident166021* LOC6; LOC3 = 0; LOC4 = 0; LOC4 = getident_166463(((NimStringDesc*) &TMP1886)); LOC3 = ((*(*tok).ident).Sup.id == (*LOC4).Sup.id); if (LOC3) goto LA5; LOC6 = 0; LOC6 = getident_166463(((NimStringDesc*) &TMP1887)); LOC3 = ((*(*tok).ident).Sup.id == (*LOC6).Sup.id); LA5: ; if (!LOC3) goto LA7; conftok_185379(L, tok); } LA7: ; info = getlineinfo_180218((&(*L)), (&(*tok))); checksymbol_185410((&(*L)), (&(*tok))); s = toktostr_180323((&(*tok))); conftok_185379(L, tok); val = copyString(((NimStringDesc*) &TMP1888)); { while (1) { NimStringDesc* LOC11; if (!((*tok).toktype == ((NU8) 110))) goto LA10; s = addChar(s, 46); conftok_185379(L, tok); checksymbol_185410((&(*L)), (&(*tok))); LOC11 = 0; LOC11 = toktostr_180323((&(*tok))); s = resizeString(s, LOC11->Sup.len + 0); appendString(s, LOC11); conftok_185379(L, tok); } LA10: ; } { NimStringDesc* LOC16; if (!((*tok).toktype == ((NU8) 95))) goto LA14; conftok_185379(L, tok); checksymbol_185410((&(*L)), (&(*tok))); LOC16 = 0; LOC16 = toktostr_180323((&(*tok))); val = resizeString(val, LOC16->Sup.len + 0); appendString(val, LOC16); conftok_185379(L, tok); { if (!((*tok).toktype == ((NU8) 96))) goto LA19; conftok_185379(L, tok); } goto LA17; LA19: ; { lexmessage_180483((&(*L)), ((NU16) 23), ((NimStringDesc*) &TMP1889)); } LA17: ; val = addChar(val, 93); } LA14: ; LOC22 = 0; LOC22 = getident_166463(((NimStringDesc*) &TMP1890)); percent = ((*(*tok).ident).Sup.id == (*LOC22).Sup.id); { NIM_BOOL LOC25; NimStringDesc* LOC33; LOC25 = 0; LOC25 = ((*tok).toktype == ((NU8) 107) || (*tok).toktype == ((NU8) 109)); if (LOC25) goto LA26; LOC25 = percent; LA26: ; if (!LOC25) goto LA27; { if (!(((NI) 0) < (val ? val->Sup.len : 0))) goto LA31; val = addChar(val, 58); } LA31: ; conftok_185379(L, tok); checksymbol_185410((&(*L)), (&(*tok))); LOC33 = 0; LOC33 = toktostr_180323((&(*tok))); val = resizeString(val, LOC33->Sup.len + 0); appendString(val, LOC33); conftok_185379(L, tok); { while (1) { NIM_BOOL LOC36; Tident166021* LOC38; NimStringDesc* LOC39; LOC36 = 0; LOC36 = !(((*tok).ident == NIM_NIL)); if (!(LOC36)) goto LA37; LOC38 = 0; LOC38 = getident_166463(((NimStringDesc*) &TMP1891)); LOC36 = ((*(*tok).ident).Sup.id == (*LOC38).Sup.id); LA37: ; if (!LOC36) goto LA35; conftok_185379(L, tok); checksymbol_185410((&(*L)), (&(*tok))); LOC39 = 0; LOC39 = toktostr_180323((&(*tok))); val = resizeString(val, LOC39->Sup.len + 0); appendString(val, LOC39); conftok_185379(L, tok); } LA35: ; } } LA27: ; { NimStringDesc* LOC44; if (!percent) goto LA42; LOC44 = 0; LOC44 = nstFormat(val, gconfigvars_153231, 3); processswitch_175040(s, LOC44, ((NU8) 2), info); } goto LA40; LA42: ; { processswitch_175040(s, val, ((NU8) 2), info); } LA40: ; }
N_NIMCALL(void, serve_521254)(TY521256 action) { TY521426* HEX3Aenv_521447; NimStringDesc* typ; nimfr("serve", "service.nim") HEX3Aenv_521447 = 0; nimln(180, "system.nim"); HEX3Aenv_521447 = (TY521426*) newObj((&NTI521448), sizeof(TY521426)); nimln(55, "service.nim"); typ = getconfigvar_153334(((NimStringDesc*) &TMP10641)); nimln(56, "service.nim"); if (eqStrings(typ, ((NimStringDesc*) &TMP10642))) goto LA1; if (eqStrings(typ, ((NimStringDesc*) &TMP10643))) goto LA2; if (eqStrings(typ, ((NimStringDesc*) &TMP10628))) goto LA2; goto LA3; LA1: ; { { nimln(58, "service.nim"); while (1) { NimStringDesc* line; NimStringDesc* LOC12; nimln(59, "service.nim"); line = readline_13478(stdin); nimln(60, "service.nim"); { if (!eqStrings(line, ((NimStringDesc*) &TMP10644))) goto LA10; exit(((NI) 0)); } LA10: ; nimln(50, "service.nim"); LOC12 = 0; LOC12 = curcaascmd_521204; curcaascmd_521204 = copyStringRC1(line); if (LOC12) nimGCunrefNoCycle(LOC12); nimln(51, "service.nim"); processcmdline_521209(((NU8) 1), line); nimln(52, "service.nim"); action(); nimln(53, "service.nim"); gerrorcounter_163012 = ((NI) 0); nimln(62, "service.nim"); printf("%s\012", ((NimStringDesc*) &TMP10628)? (((NimStringDesc*) &TMP10628))->data:"nil"); nimln(63, "service.nim"); fflush(stdout); } } } goto LA4; LA2: ; { Socketimpl513407* server; NimStringDesc* p; NU16 port; NimStringDesc* LOC20; NimStringDesc* inp; TY163054 LOC21; nimln(67, "service.nim"); server = newsocket_513830(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE); nimln(68, "service.nim"); p = getconfigvar_153334(((NimStringDesc*) &TMP10647)); nimln(69, "service.nim"); { NI LOC18; if (!(((NI) 0) < (p ? p->Sup.len : 0))) goto LA16; LOC18 = 0; LOC18 = nsuParseInt(p); port = ((NU16) (LOC18)); } goto LA14; LA16: ; { port = ((NU16) 6000); } LA14: ; nimln(70, "service.nim"); LOC20 = 0; LOC20 = getconfigvar_153334(((NimStringDesc*) &TMP10648)); bindaddr_514620(server, port, LOC20); nimln(71, "service.nim"); inp = copyString(((NimStringDesc*) &TMP10628)); nimln(72, "service.nim"); listen_514610(server, SOMAXCONN); nimln(73, "service.nim"); asgnRefNoCycle((void**) (&(*HEX3Aenv_521447).stdoutsocket521408), newsocket_513830(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE)); nimln(74, "service.nim"); memset((void*)(&LOC21), 0, sizeof(LOC21)); LOC21.ClPrc = HEX3Aanonymous_521409; LOC21.ClEnv = HEX3Aenv_521447; asgnRef((void**) (&writelnhook_163057.ClEnv), LOC21.ClEnv); writelnhook_163057.ClPrc = LOC21.ClPrc; { nimln(77, "service.nim"); while (1) { NimStringDesc* LOC24; nimln(78, "service.nim"); accept_515401(server, &(*HEX3Aenv_521447).stdoutsocket521408, 2); nimln(79, "service.nim"); readline_517608((*HEX3Aenv_521447).stdoutsocket521408, (&inp), ((NI) -1), 2); nimln(50, "service.nim"); LOC24 = 0; LOC24 = curcaascmd_521204; curcaascmd_521204 = copyStringRC1(inp); if (LOC24) nimGCunrefNoCycle(LOC24); nimln(51, "service.nim"); processcmdline_521209(((NU8) 1), inp); nimln(52, "service.nim"); action(); nimln(53, "service.nim"); gerrorcounter_163012 = ((NI) 0); nimln(81, "service.nim"); send_518208((*HEX3Aenv_521447).stdoutsocket521408, ((NimStringDesc*) &TMP10651), 2); nimln(82, "service.nim"); close_515417((*HEX3Aenv_521447).stdoutsocket521408); } } } goto LA4; LA3: ; { nimln(86, "service.nim"); printf("%s%s\012", ((NimStringDesc*) &TMP10674)? (((NimStringDesc*) &TMP10674))->data:"nil", typ? (typ)->data:"nil"); nimln(87, "service.nim"); msgquit_163104(((NI8) 1)); } LA4: ; popFrame(); }
N_NIMCALL(void, Nimnexttoken_153511)(TY153007* G_153514) { NI Pos_153521; NimStringDesc* Id_153709; NIM_BOOL LOC19; NIM_BOOL LOC25; NIM_BOOL LOC26; NIM_BOOL LOC33; NIM_BOOL LOC45; NIM_BOOL LOC51; NIM_BOOL LOC52; NIM_BOOL LOC63; NimStringDesc* LOC67; NimStringDesc* LOC68; Pos_153521 = 0; Pos_153521 = (*G_153514).Pos; (*G_153514).Start = (*G_153514).Pos; if (!((*G_153514).State == ((NU8) 10))) goto LA2; (*G_153514).Kind = ((NU8) 10); while (1) { switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 92: (*G_153514).Kind = ((NU8) 13); Pos_153521 += 1; switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 120: case 88: Pos_153521 += 1; if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(57)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(65)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(70)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(97)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(102)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)))) goto LA6; Pos_153521 += 1; LA6: ; if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(57)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(65)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(70)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(97)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(102)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)))) goto LA9; Pos_153521 += 1; LA9: ; break; case 48 ... 57: while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(57)))) goto LA11; Pos_153521 += 1; } LA11: ; break; case 0: (*G_153514).State = ((NU8) 1); break; default: Pos_153521 += 1; break; } goto LA4; break; case 0: case 13: case 10: (*G_153514).State = ((NU8) 1); goto LA4; break; case 34: Pos_153521 += 1; (*G_153514).State = ((NU8) 1); goto LA4; break; default: Pos_153521 += 1; break; } } LA4: ; goto LA1; LA2: ; switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 32: case 9 ... 13: (*G_153514).Kind = ((NU8) 2); while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(32)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(9)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(13)))) goto LA12; Pos_153521 += 1; } LA12: ; break; case 35: (*G_153514).Kind = ((NU8) 16); while (1) { if (!!((((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(0)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(10)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(13))))) goto LA13; Pos_153521 += 1; } LA13: ; break; case 97 ... 122: case 65 ... 90: case 95: case 128 ... 255: Id_153709 = 0; Id_153709 = copyString(((NimStringDesc*) &TMP197260)); while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(57)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(65)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(90)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(97)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(122)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(128)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(248)))) goto LA14; Id_153709 = addChar(Id_153709, (*G_153514).Buf[Pos_153521]); Pos_153521 += 1; } LA14: ; if (!((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34))) goto LA16; LOC19 = ((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 1)]) == (NU8)(34)); if (!(LOC19)) goto LA20; LOC19 = ((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 2)]) == (NU8)(34)); LA20: ; if (!LOC19) goto LA21; Pos_153521 += 3; (*G_153514).Kind = ((NU8) 11); while (1) { switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 0: goto LA23; break; case 34: Pos_153521 += 1; LOC26 = ((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34)); if (!(LOC26)) goto LA27; LOC26 = ((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 1)]) == (NU8)(34)); LA27: ; LOC25 = LOC26; if (!(LOC25)) goto LA28; LOC25 = !(((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 2)]) == (NU8)(34))); LA28: ; if (!LOC25) goto LA29; Pos_153521 += 2; goto LA23; LA29: ; break; default: Pos_153521 += 1; break; } } LA23: ; goto LA18; LA21: ; (*G_153514).Kind = ((NU8) 23); Pos_153521 += 1; while (1) { if (!!((((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(0)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(10)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(13))))) goto LA31; LOC33 = ((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34)); if (!(LOC33)) goto LA34; LOC33 = !(((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 1)]) == (NU8)(34))); LA34: ; if (!LOC33) goto LA35; goto LA31; LA35: ; Pos_153521 += 1; } LA31: ; if (!((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34))) goto LA38; Pos_153521 += 1; LA38: ; LA18: ; goto LA15; LA16: ; (*G_153514).Kind = Nimgetkeyword_153201(Id_153709); LA15: ; break; case 48: Pos_153521 += 1; switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 98: case 66: Pos_153521 += 1; while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(49)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)))) goto LA40; Pos_153521 += 1; } LA40: ; Pos_153521 = Nimnumberpostfix_153230(G_153514, Pos_153521); break; case 120: case 88: Pos_153521 += 1; while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(57)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(65)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(70)) || ((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(97)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(102)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)))) goto LA41; Pos_153521 += 1; } LA41: ; Pos_153521 = Nimnumberpostfix_153230(G_153514, Pos_153521); break; case 111: case 79: Pos_153521 += 1; while (1) { if (!(((NU8)((*G_153514).Buf[Pos_153521])) >= ((NU8)(48)) && ((NU8)((*G_153514).Buf[Pos_153521])) <= ((NU8)(55)) || ((NU8)((*G_153514).Buf[Pos_153521])) == ((NU8)(95)))) goto LA42; Pos_153521 += 1; } LA42: ; Pos_153521 = Nimnumberpostfix_153230(G_153514, Pos_153521); break; default: Pos_153521 = Nimnumber_153371(G_153514, Pos_153521); break; } break; case 49 ... 57: Pos_153521 = Nimnumber_153371(G_153514, Pos_153521); break; case 39: Pos_153521 += 1; (*G_153514).Kind = ((NU8) 12); while (1) { switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 0: case 13: case 10: goto LA43; break; case 39: Pos_153521 += 1; goto LA43; break; case 92: Pos_153521 += 2; break; default: Pos_153521 += 1; break; } } LA43: ; break; case 34: Pos_153521 += 1; LOC45 = ((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34)); if (!(LOC45)) goto LA46; LOC45 = ((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 1)]) == (NU8)(34)); LA46: ; if (!LOC45) goto LA47; Pos_153521 += 2; (*G_153514).Kind = ((NU8) 11); while (1) { switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 0: goto LA49; break; case 34: Pos_153521 += 1; LOC52 = ((NU8)((*G_153514).Buf[Pos_153521]) == (NU8)(34)); if (!(LOC52)) goto LA53; LOC52 = ((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 1)]) == (NU8)(34)); LA53: ; LOC51 = LOC52; if (!(LOC51)) goto LA54; LOC51 = !(((NU8)((*G_153514).Buf[(NI64)(Pos_153521 + 2)]) == (NU8)(34))); LA54: ; if (!LOC51) goto LA55; Pos_153521 += 2; goto LA49; LA55: ; break; default: Pos_153521 += 1; break; } } LA49: ; goto LA44; LA47: ; (*G_153514).Kind = ((NU8) 10); while (1) { switch (((NU8)((*G_153514).Buf[Pos_153521]))) { case 0: case 13: case 10: goto LA57; break; case 34: Pos_153521 += 1; goto LA57; break; case 92: (*G_153514).State = (*G_153514).Kind; goto LA57; break; default: Pos_153521 += 1; break; } } LA57: ; LA44: ; break; case 40: case 41: case 91: case 93: case 123: case 125: case 96: case 58: case 44: case 59: Pos_153521 += 1; (*G_153514).Kind = ((NU8) 15); break; case 0: (*G_153514).Kind = ((NU8) 0); break; default: if (!((TMP197261[((NU8)((*G_153514).Buf[Pos_153521]))/8] &(1<<(((NU8)((*G_153514).Buf[Pos_153521]))%8)))!=0)) goto LA59; (*G_153514).Kind = ((NU8) 14); while (1) { if (!((TMP197261[((NU8)((*G_153514).Buf[Pos_153521]))/8] &(1<<(((NU8)((*G_153514).Buf[Pos_153521]))%8)))!=0)) goto LA61; Pos_153521 += 1; } LA61: ; goto LA58; LA59: ; Pos_153521 += 1; (*G_153514).Kind = ((NU8) 1); LA58: ; break; } LA1: ; (*G_153514).Length = (NI64)(Pos_153521 - (*G_153514).Pos); LOC63 = !(((*G_153514).Kind == ((NU8) 0))); if (!(LOC63)) goto LA64; LOC63 = ((*G_153514).Length <= 0); LA64: ; if (!LOC63) goto LA65; LOC67 = 0; LOC68 = 0; LOC68 = cstrToNimstr((*G_153514).Buf); LOC67 = rawNewString(LOC68->Sup.len + 14); appendString(LOC67, ((NimStringDesc*) &TMP197262)); appendString(LOC67, LOC68); Internalerror_48163(LOC67); LA65: ; (*G_153514).Pos = Pos_153521; }
N_NIMCALL(trope144007*, makellvmstring_464684)(NimStringDesc* s) { trope144007* result; NimStringDesc* res; NI i_464702; NI HEX3Atmp_464714; NI TMP6200; NI res_464716; trope144007* LOC10; nimfr("makeLLVMString", "ccgutils.nim") result = 0; nimln(166, "ccgutils.nim"); result = NIM_NIL; nimln(167, "ccgutils.nim"); res = copyString(((NimStringDesc*) &TMP6199)); i_464702 = 0; HEX3Atmp_464714 = 0; nimln(168, "ccgutils.nim"); nimln(168, "ccgutils.nim"); nimln(168, "ccgutils.nim"); TMP6200 = subInt(s->Sup.len, 1); HEX3Atmp_464714 = (NI64)(TMP6200); nimln(1450, "system.nim"); res_464716 = 0; nimln(1451, "system.nim"); while (1) { nimln(1451, "system.nim"); if (!(res_464716 <= HEX3Atmp_464714)) goto LA1; nimln(1450, "system.nim"); i_464702 = res_464716; nimln(169, "ccgutils.nim"); { NI TMP6201; NI TMP6202; trope144007* LOC6; nimln(169, "ccgutils.nim"); nimln(169, "ccgutils.nim"); nimln(169, "ccgutils.nim"); TMP6201 = addInt(i_464702, 1); TMP6202 = modInt((NI64)(TMP6201), 64); if (!(((NI) ((NI64)(TMP6202))) == 0)) goto LA4; nimln(170, "ccgutils.nim"); nimln(170, "ccgutils.nim"); LOC6 = 0; LOC6 = torope_144058(res); app_144040(&result, LOC6); nimln(171, "ccgutils.nim"); res = setLengthStr(res, 0); } LA4: ; nimln(172, "ccgutils.nim"); if ((NU)(i_464702) > (NU)(s->Sup.len)) raiseIndexError(); switch (((NU8)(s->data[i_464702]))) { case 0 ... 31: case 128 ... 255: case 34: case 92: { NimStringDesc* LOC8; nimln(174, "ccgutils.nim"); res = addChar(res, 92); nimln(175, "ccgutils.nim"); nimln(175, "ccgutils.nim"); nimln(175, "ccgutils.nim"); if ((NU)(i_464702) > (NU)(s->Sup.len)) raiseIndexError(); LOC8 = 0; LOC8 = nsuToHex(((NI64) (((NU8)(s->data[i_464702])))), 2); res = resizeString(res, LOC8->Sup.len + 0); appendString(res, LOC8); } break; default: { nimln(176, "ccgutils.nim"); if ((NU)(i_464702) > (NU)(s->Sup.len)) raiseIndexError(); res = addChar(res, s->data[i_464702]); } break; } nimln(1453, "system.nim"); res_464716 = addInt(res_464716, 1); } LA1: ; nimln(177, "ccgutils.nim"); res = resizeString(res, 4); appendString(res, ((NimStringDesc*) &TMP6203)); nimln(178, "ccgutils.nim"); nimln(178, "ccgutils.nim"); LOC10 = 0; LOC10 = torope_144058(res); app_144040(&result, LOC10); popFrame(); 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; }
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY118589* Result) { { NIM_BOOL LOC3; LOC3 = 0; LOC3 = ((path ? path->Sup.len : 0) == ((NI) 0)); if (LOC3) goto LA4; LOC3 = (((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47))); LA4: ; if (!LOC3) goto LA5; unsureAsgnRef((void**) (&(*Result).Field0), copyString(path)); unsureAsgnRef((void**) (&(*Result).Field1), copyString(((NimStringDesc*) &TMP136))); unsureAsgnRef((void**) (&(*Result).Field2), copyString(((NimStringDesc*) &TMP136))); } goto LA1; LA5: ; { NI seppos; NI dotpos; seppos = ((NI) -1); dotpos = (path ? path->Sup.len : 0); { NI i_118619; NI HEX3Atmp_118643; NI res_118646; i_118619 = 0; HEX3Atmp_118643 = 0; HEX3Atmp_118643 = (NI)((path ? path->Sup.len : 0) - ((NI) 1)); res_118646 = HEX3Atmp_118643; { while (1) { if (!(((NI) 0) <= res_118646)) goto LA10; i_118619 = res_118646; { if (!((NU8)(path->data[i_118619]) == (NU8)(46))) goto LA13; { NIM_BOOL LOC17; NIM_BOOL LOC18; LOC17 = 0; LOC18 = 0; LOC18 = (dotpos == (path ? path->Sup.len : 0)); if (!(LOC18)) goto LA19; LOC18 = (((NI) 0) < i_118619); LA19: ; LOC17 = LOC18; if (!(LOC17)) goto LA20; LOC17 = !((((NU8)(path->data[(NI)(i_118619 - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(path->data[(NI)(i_118619 - ((NI) 1))])) == ((NU8)(47)))); LA20: ; if (!LOC17) goto LA21; dotpos = i_118619; } LA21: ; } goto LA11; LA13: ; { if (!(((NU8)(path->data[i_118619])) == ((NU8)(47)) || ((NU8)(path->data[i_118619])) == ((NU8)(47)))) goto LA24; seppos = i_118619; goto LA8; } goto LA11; LA24: ; LA11: ; res_118646 -= ((NI) 1); } LA10: ; } } LA8: ; unsureAsgnRef((void**) (&(*Result).Field0), copyStrLast(path, ((NI) 0), (NI)(seppos - ((NI) 1)))); unsureAsgnRef((void**) (&(*Result).Field1), copyStrLast(path, (NI)(seppos + ((NI) 1)), (NI)(dotpos - ((NI) 1)))); unsureAsgnRef((void**) (&(*Result).Field2), copyStr(path, dotpos)); } LA1: ; }
N_NIMCALL(void, renderrsttorst_295215)(trendercontext295211* d, trstnode295009* n, NimStringDesc** result) { NimStringDesc* ind; nimfr("renderRstToRst", "rstast.nim") nimln(112, "rstast.nim"); { nimln(112, "rstast.nim"); if (!(n == NIM_NIL)) goto LA3; nimln(112, "rstast.nim"); goto BeforeRet; } LA3: ; nimln(113, "rstast.nim"); ind = nsuRepeatChar((*d).Indent, 32); nimln(114, "rstast.nim"); switch ((*n).Kind) { case ((NU8) 0): { nimln(116, "rstast.nim"); renderrstsons_295223(d, n, result); } break; case ((NU8) 1): { NI oldlen; NI headlinelen; NI TMP3779; NimStringDesc* LOC7; nimln(118, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(119, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(121, "rstast.nim"); nimln(121, "rstast.nim"); oldlen = (*result)->Sup.len; nimln(122, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(123, "rstast.nim"); nimln(123, "rstast.nim"); nimln(123, "rstast.nim"); TMP3779 = subInt((*result)->Sup.len, oldlen); headlinelen = (NI32)(TMP3779); nimln(125, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(126, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(127, "rstast.nim"); nimln(127, "rstast.nim"); if ((NU)((*n).Level) > (NU)(8)) raiseIndexError(); LOC7 = 0; LOC7 = nsuRepeatChar(headlinelen, lvltochar_295257[((*n).Level)- 0]); (*result) = resizeString((*result), LOC7->Sup.len + 0); appendString((*result), LOC7); } break; case ((NU8) 2): { NimStringDesc* headline; NimStringDesc* lvl; NI TMP3781; nimln(129, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(130, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(132, "rstast.nim"); headline = copyString(((NimStringDesc*) &TMP3780)); nimln(133, "rstast.nim"); renderrstsons_295223(d, n, &headline); nimln(135, "rstast.nim"); nimln(135, "rstast.nim"); nimln(135, "rstast.nim"); TMP3781 = subInt(headline->Sup.len, (*d).Indent); if ((NU)((*n).Level) > (NU)(8)) raiseIndexError(); lvl = nsuRepeatChar((NI32)(TMP3781), lvltochar_295257[((*n).Level)- 0]); nimln(136, "rstast.nim"); (*result) = resizeString((*result), lvl->Sup.len + 0); appendString((*result), lvl); nimln(137, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(138, "rstast.nim"); (*result) = resizeString((*result), headline->Sup.len + 0); appendString((*result), headline); nimln(140, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(141, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(142, "rstast.nim"); (*result) = resizeString((*result), lvl->Sup.len + 0); appendString((*result), lvl); } break; case ((NU8) 3): { NI TMP3783; NimStringDesc* LOC10; nimln(144, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); nimln(145, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(146, "rstast.nim"); nimln(146, "rstast.nim"); nimln(146, "rstast.nim"); TMP3783 = subInt(78, (*d).Indent); LOC10 = 0; LOC10 = nsuRepeatChar((NI32)(TMP3783), 45); (*result) = resizeString((*result), LOC10->Sup.len + 0); appendString((*result), LOC10); nimln(147, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); } break; case ((NU8) 4): { nimln(149, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); nimln(150, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(151, "rstast.nim"); renderrstsons_295223(d, n, result); } break; case ((NU8) 6): { NimStringDesc* tmp; nimln(153, "rstast.nim"); (*d).Indent = addInt((*d).Indent, 2); nimln(154, "rstast.nim"); tmp = copyString(((NimStringDesc*) &TMP3780)); nimln(155, "rstast.nim"); renderrstsons_295223(d, n, &tmp); nimln(156, "rstast.nim"); { nimln(156, "rstast.nim"); nimln(156, "rstast.nim"); if (!(0 < tmp->Sup.len)) goto LA15; nimln(157, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(158, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(159, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3784)); nimln(160, "rstast.nim"); (*result) = resizeString((*result), tmp->Sup.len + 0); appendString((*result), tmp); } LA15: ; nimln(161, "rstast.nim"); (*d).Indent = subInt((*d).Indent, 2); } break; case ((NU8) 8): { NimStringDesc* tmp; nimln(163, "rstast.nim"); (*d).Indent = addInt((*d).Indent, 4); nimln(164, "rstast.nim"); tmp = copyString(((NimStringDesc*) &TMP3780)); nimln(165, "rstast.nim"); renderrstsons_295223(d, n, &tmp); nimln(166, "rstast.nim"); { nimln(166, "rstast.nim"); nimln(166, "rstast.nim"); if (!(0 < tmp->Sup.len)) goto LA20; nimln(167, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(168, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(169, "rstast.nim"); (*result) = resizeString((*result), 4); appendString((*result), ((NimStringDesc*) &TMP3785)); nimln(170, "rstast.nim"); (*result) = resizeString((*result), tmp->Sup.len + 0); appendString((*result), tmp); } LA20: ; nimln(171, "rstast.nim"); (*d).Indent = subInt((*d).Indent, 4); } break; case ((NU8) 17): case ((NU8) 13): case ((NU8) 9): case ((NU8) 10): case ((NU8) 26): case ((NU8) 15): case ((NU8) 16): case ((NU8) 37): case ((NU8) 5): case ((NU8) 7): { nimln(174, "rstast.nim"); renderrstsons_295223(d, n, result); } break; case ((NU8) 11): { nimln(176, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); nimln(177, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(178, "rstast.nim"); renderrstsons_295223(d, n, result); } break; case ((NU8) 12): { nimln(180, "rstast.nim"); (*d).Indent = addInt((*d).Indent, 2); nimln(181, "rstast.nim"); { nimln(181, "rstast.nim"); nimln(181, "rstast.nim"); if ((NU)(0) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); if (!!(((*(*n).Sons->data[0]).Kind == ((NU8) 5)))) goto LA27; nimln(182, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(183, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(184, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3786)); } LA27: ; nimln(185, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(186, "rstast.nim"); (*d).Indent = subInt((*d).Indent, 2); } break; case ((NU8) 14): { NimStringDesc* tmp; NI l; NI TMP3787; NI TMP3788; NI TMP3789; NimStringDesc* LOC30; nimln(188, "rstast.nim"); tmp = copyString(((NimStringDesc*) &TMP3780)); nimln(189, "rstast.nim"); if ((NU)(0) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[0], &tmp); nimln(191, "rstast.nim"); nimln(191, "rstast.nim"); nimln(191, "rstast.nim"); nimln(191, "rstast.nim"); TMP3787 = addInt(tmp->Sup.len, 3); l = (((NI32)(TMP3787) >= 30) ? (NI32)(TMP3787) : 30); nimln(192, "rstast.nim"); (*d).Indent = addInt((*d).Indent, l); nimln(194, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(195, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(196, "rstast.nim"); (*result) = addChar((*result), 58); nimln(197, "rstast.nim"); (*result) = resizeString((*result), tmp->Sup.len + 0); appendString((*result), tmp); nimln(198, "rstast.nim"); (*result) = addChar((*result), 58); nimln(199, "rstast.nim"); nimln(199, "rstast.nim"); nimln(199, "rstast.nim"); nimln(199, "rstast.nim"); nimln(199, "rstast.nim"); TMP3788 = subInt(l, tmp->Sup.len); TMP3789 = subInt((NI32)(TMP3788), 2); LOC30 = 0; LOC30 = nsuRepeatChar((NI32)(TMP3789), 32); (*result) = resizeString((*result), LOC30->Sup.len + 0); appendString((*result), LOC30); nimln(200, "rstast.nim"); if ((NU)(1) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[1], result); nimln(202, "rstast.nim"); (*d).Indent = subInt((*d).Indent, l); } break; case ((NU8) 27): { nimln(204, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3778)); nimln(205, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(206, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3790)); nimln(207, "rstast.nim"); renderrstsons_295223(d, n, result); } break; case ((NU8) 28): { nimln(209, "rstast.nim"); (*d).Indent = addInt((*d).Indent, 2); nimln(210, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(211, "rstast.nim"); (*d).Indent = subInt((*d).Indent, 2); } break; case ((NU8) 39): { nimln(213, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3791)); nimln(214, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(215, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3792)); } break; case ((NU8) 38): { nimln(217, "rstast.nim"); (*result) = addChar((*result), 96); nimln(218, "rstast.nim"); if ((NU)(0) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[0], result); nimln(219, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3793)); nimln(220, "rstast.nim"); if ((NU)(1) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[1], result); nimln(221, "rstast.nim"); (*result) = resizeString((*result), 3); appendString((*result), ((NimStringDesc*) &TMP3794)); } break; case ((NU8) 53): { nimln(223, "rstast.nim"); (*result) = addChar((*result), 96); nimln(224, "rstast.nim"); if ((NU)(0) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[0], result); nimln(225, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3795)); nimln(226, "rstast.nim"); if ((NU)(1) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrsttorst_295215(d, (*n).Sons->data[1], result); nimln(227, "rstast.nim"); (*result) = addChar((*result), 58); } break; case ((NU8) 54): { nimln(229, "rstast.nim"); (*result) = addChar((*result), 96); nimln(230, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(231, "rstast.nim"); (*result) = resizeString((*result), 6); appendString((*result), ((NimStringDesc*) &TMP3796)); } break; case ((NU8) 55): { nimln(233, "rstast.nim"); (*result) = addChar((*result), 96); nimln(234, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(235, "rstast.nim"); (*result) = resizeString((*result), 6); appendString((*result), ((NimStringDesc*) &TMP3797)); } break; case ((NU8) 56): { nimln(237, "rstast.nim"); (*result) = addChar((*result), 96); nimln(238, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(239, "rstast.nim"); (*result) = resizeString((*result), 6); appendString((*result), ((NimStringDesc*) &TMP3798)); } break; case ((NU8) 57): { nimln(241, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3799)); nimln(242, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(243, "rstast.nim"); (*result) = resizeString((*result), 1); appendString((*result), ((NimStringDesc*) &TMP3799)); } break; case ((NU8) 58): { nimln(245, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3800)); nimln(246, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(247, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3800)); } break; case ((NU8) 59): { nimln(249, "rstast.nim"); (*result) = resizeString((*result), 3); appendString((*result), ((NimStringDesc*) &TMP3801)); nimln(250, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(251, "rstast.nim"); (*result) = resizeString((*result), 3); appendString((*result), ((NimStringDesc*) &TMP3801)); } break; case ((NU8) 60): { nimln(253, "rstast.nim"); (*result) = addChar((*result), 96); nimln(254, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(255, "rstast.nim"); (*result) = addChar((*result), 96); } break; case ((NU8) 61): { nimln(257, "rstast.nim"); (*d).Verbatim = addInt((*d).Verbatim, 1); nimln(258, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3802)); nimln(259, "rstast.nim"); renderrstsons_295223(d, n, result); nimln(260, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3802)); nimln(261, "rstast.nim"); (*d).Verbatim = subInt((*d).Verbatim, 1); } break; case ((NU8) 63): { nimln(263, "rstast.nim"); (*result) = resizeString((*result), (*n).Text->Sup.len + 0); appendString((*result), (*n).Text); } break; case ((NU8) 64): { nimln(265, "rstast.nim"); { NIM_BOOL LOC48; nimln(265, "rstast.nim"); LOC48 = 0; nimln(265, "rstast.nim"); LOC48 = ((*d).Verbatim == 0); if (!(LOC48)) goto LA49; nimln(265, "rstast.nim"); LOC48 = eqStrings((*n).Text, ((NimStringDesc*) &TMP3803)); LA49: ; if (!LOC48) goto LA50; nimln(266, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3804)); } goto LA46; LA50: ; { nimln(268, "rstast.nim"); (*result) = resizeString((*result), (*n).Text->Sup.len + 0); appendString((*result), (*n).Text); } LA46: ; } break; case ((NU8) 51): { nimln(270, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); nimln(271, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(272, "rstast.nim"); (*result) = resizeString((*result), 11); appendString((*result), ((NimStringDesc*) &TMP3805)); nimln(274, "rstast.nim"); (*d).Indent = addInt((*d).Indent, 3); nimln(275, "rstast.nim"); { nimln(275, "rstast.nim"); nimln(275, "rstast.nim"); if ((NU)(2) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); if (!!(((*n).Sons->data[2] == NIM_NIL))) goto LA56; nimln(275, "rstast.nim"); if ((NU)(2) >= (NU)((*n).Sons->Sup.len)) raiseIndexError(); renderrstsons_295223(d, (*n).Sons->data[2], result); } LA56: ; nimln(276, "rstast.nim"); (*d).Indent = subInt((*d).Indent, 3); } break; case ((NU8) 44): { nimln(278, "rstast.nim"); (*result) = resizeString((*result), 2); appendString((*result), ((NimStringDesc*) &TMP3782)); nimln(279, "rstast.nim"); (*result) = resizeString((*result), ind->Sup.len + 0); appendString((*result), ind); nimln(280, "rstast.nim"); (*result) = resizeString((*result), 13); appendString((*result), ((NimStringDesc*) &TMP3806)); } break; default: { NimStringDesc* LOC60; nimln(282, "rstast.nim"); nimln(282, "rstast.nim"); LOC60 = 0; nimln(282, "rstast.nim"); LOC60 = rawNewString(reprEnum((*n).Kind, (&NTI295003))->Sup.len + 22); appendString(LOC60, ((NimStringDesc*) &TMP3807)); appendString(LOC60, reprEnum((*n).Kind, (&NTI295003))); (*result) = resizeString((*result), LOC60->Sup.len + 0); appendString((*result), LOC60); } break; } BeforeRet: ; popFrame(); }
N_NIMCALL(NimStringDesc*, nosunixToNativePath)(NimStringDesc* path, NimStringDesc* drive) { NimStringDesc* result; result = 0; result = copyString(path); return result; }
N_NIMCALL(tjsonnode290114*, renderrsttojsonnode_295567)(trstnode295009* node) { tjsonnode290114* result; TY295586 LOC1; nimfr("renderRstToJsonNode", "rstast.nim") result = 0; nimln(290, "rstast.nim"); memset((void*)LOC1, 0, sizeof(LOC1)); LOC1[0].Field0 = copyString(((NimStringDesc*) &TMP3809)); nimln(292, "rstast.nim"); nimln(292, "rstast.nim"); LOC1[0].Field1 = HEX25_290475(reprEnum((*node).Kind, (&NTI295003))); LOC1[1].Field0 = copyString(((NimStringDesc*) &TMP3810)); nimln(293, "rstast.nim"); LOC1[1].Field1 = HEX25_290511(((NI64) ((*node).Level))); result = HEX25_290619(LOC1, 2); nimln(295, "rstast.nim"); { tjsonnode290114* LOC6; nimln(295, "rstast.nim"); nimln(295, "rstast.nim"); if (!!(((*node).Text == NIM_NIL))) goto LA4; nimln(296, "rstast.nim"); nimln(296, "rstast.nim"); LOC6 = 0; LOC6 = HEX25_290475((*node).Text); add_291844(result, ((NimStringDesc*) &TMP3811), LOC6); } LA4: ; nimln(297, "rstast.nim"); { NIM_BOOL LOC9; NIM_BOOL LOC10; TY290134* accm; NI i_295838; trstnode295009* son_295839; TY295084* HEX3Atmp_295841; NI i_295843; tjsonnode290114* LOC15; nimln(297, "rstast.nim"); LOC9 = 0; nimln(297, "rstast.nim"); nimln(297, "rstast.nim"); LOC10 = 0; LOC10 = HEX3DHEX3D_295591((*node).Sons, NIM_NIL); LOC9 = !(LOC10); if (!(LOC9)) goto LA11; nimln(297, "rstast.nim"); nimln(297, "rstast.nim"); LOC9 = (0 < (*node).Sons->Sup.len); LA11: ; if (!LOC9) goto LA12; nimln(298, "rstast.nim"); nimln(298, "rstast.nim"); accm = newseq_295745((*node).Sons->Sup.len); i_295838 = 0; son_295839 = 0; HEX3Atmp_295841 = 0; nimln(299, "rstast.nim"); HEX3Atmp_295841 = (*node).Sons; nimln(1585, "system.nim"); i_295843 = 0; nimln(1586, "system.nim"); while (1) { nimln(1586, "system.nim"); nimln(1586, "system.nim"); if (!(i_295843 < HEX3Atmp_295841->Sup.len)) goto LA14; nimln(1585, "system.nim"); i_295838 = i_295843; nimln(1587, "system.nim"); if ((NU)(i_295843) >= (NU)(HEX3Atmp_295841->Sup.len)) raiseIndexError(); son_295839 = HEX3Atmp_295841->data[i_295843]; nimln(300, "rstast.nim"); if ((NU)(i_295838) >= (NU)(accm->Sup.len)) raiseIndexError(); asgnRefNoCycle((void**) &accm->data[i_295838], renderrsttojsonnode_295567(son_295839)); nimln(1588, "system.nim"); i_295843 = addInt(i_295843, 1); } LA14: ; nimln(301, "rstast.nim"); nimln(301, "rstast.nim"); LOC15 = 0; LOC15 = HEX25_290745(accm->data, accm->Sup.len); add_291844(result, ((NimStringDesc*) &TMP3812), LOC15); } LA12: ; popFrame(); return result; }
N_NIMCALL(void, parseassignment_210319)(Tlexer205173* L, Ttoken205169* tok) { Tlineinfo182337 info; NimStringDesc* s; NimStringDesc* val; NIM_BOOL percent; Tident189012* LOC22; { NIM_BOOL LOC3; Tident189012* LOC4; Tident189012* LOC6; LOC3 = 0; LOC4 = 0; LOC4 = getident_189441(((NimStringDesc*) &TMP2044)); LOC3 = ((*(*tok).ident).Sup.id == (*LOC4).Sup.id); if (LOC3) goto LA5; LOC6 = 0; LOC6 = getident_189441(((NimStringDesc*) &TMP2045)); LOC3 = ((*(*tok).ident).Sup.id == (*LOC6).Sup.id); LA5: ; if (!LOC3) goto LA7; conftok_210275(L, tok); } LA7: ; info = getlineinfo_205200((&(*L)), (&(*tok))); checksymbol_210294((&(*L)), (&(*tok))); s = toktostr_205281((&(*tok))); conftok_210275(L, tok); val = copyString(((NimStringDesc*) &TMP2046)); { while (1) { NimStringDesc* LOC11; if (!((*tok).toktype == ((NU8) 110))) goto LA10; s = addChar(s, 46); conftok_210275(L, tok); checksymbol_210294((&(*L)), (&(*tok))); LOC11 = 0; LOC11 = toktostr_205281((&(*tok))); s = resizeString(s, LOC11->Sup.len + 0); appendString(s, LOC11); conftok_210275(L, tok); } LA10: ; } { NimStringDesc* LOC16; if (!((*tok).toktype == ((NU8) 95))) goto LA14; conftok_210275(L, tok); checksymbol_210294((&(*L)), (&(*tok))); LOC16 = 0; LOC16 = toktostr_205281((&(*tok))); val = resizeString(val, LOC16->Sup.len + 0); appendString(val, LOC16); conftok_210275(L, tok); { if (!((*tok).toktype == ((NU8) 96))) goto LA19; conftok_210275(L, tok); } goto LA17; LA19: ; { lexmessage_205370((&(*L)), ((NU16) 24), ((NimStringDesc*) &TMP2047)); } LA17: ; val = addChar(val, 93); } LA14: ; LOC22 = 0; LOC22 = getident_189441(((NimStringDesc*) &TMP2048)); percent = ((*(*tok).ident).Sup.id == (*LOC22).Sup.id); { NIM_BOOL LOC25; NimStringDesc* LOC33; LOC25 = 0; LOC25 = ((*tok).toktype == ((NU8) 107) || (*tok).toktype == ((NU8) 109)); if (LOC25) goto LA26; LOC25 = percent; LA26: ; if (!LOC25) goto LA27; { if (!(((NI) 0) < (val ? val->Sup.len : 0))) goto LA31; val = addChar(val, 58); } LA31: ; conftok_210275(L, tok); checksymbol_210294((&(*L)), (&(*tok))); LOC33 = 0; LOC33 = toktostr_205281((&(*tok))); val = resizeString(val, LOC33->Sup.len + 0); appendString(val, LOC33); conftok_210275(L, tok); { while (1) { NIM_BOOL LOC36; Tident189012* LOC38; NimStringDesc* LOC39; LOC36 = 0; LOC36 = !(((*tok).ident == NIM_NIL)); if (!(LOC36)) goto LA37; LOC38 = 0; LOC38 = getident_189441(((NimStringDesc*) &TMP2049)); LOC36 = ((*(*tok).ident).Sup.id == (*LOC38).Sup.id); LA37: ; if (!LOC36) goto LA35; conftok_210275(L, tok); checksymbol_210294((&(*L)), (&(*tok))); LOC39 = 0; LOC39 = toktostr_205281((&(*tok))); val = resizeString(val, LOC39->Sup.len + 0); appendString(val, LOC39); conftok_210275(L, tok); } LA35: ; } } LA27: ; { NimStringDesc* LOC44; if (!percent) goto LA42; LOC44 = 0; LOC44 = nstFormat(val, gconfigvars_160195, 3); processswitch_200016(s, LOC44, ((NU8) 2), info); } goto LA40; LA42: ; { processswitch_200016(s, val, ((NU8) 2), info); } LA40: ; }
N_NIMCALL(void, loadconfigs_210603)(NimStringDesc* cfg) { NimStringDesc* pd; setdefaultlibpath_160298(); { NimStringDesc* LOC5; if (!!(((gglobaloptions_160121 &(1U<<((NU)(((NU8) 16))&31U)))!=0))) goto LA3; LOC5 = 0; LOC5 = getsystemconfigpath_210434(cfg); readconfigfile_210382(LOC5); } LA3: ; { NimStringDesc* LOC10; if (!!(((gglobaloptions_160121 &(1U<<((NU)(((NU8) 18))&31U)))!=0))) goto LA8; LOC10 = 0; LOC10 = getuserconfigpath_210428(cfg); readconfigfile_210382(LOC10); } LA8: ; { if (!(((NI) 0) < (gprojectpath_160200 ? gprojectpath_160200->Sup.len : 0))) goto LA13; pd = copyString(gprojectpath_160200); } goto LA11; LA13: ; { pd = nosgetCurrentDir(); } LA11: ; { if (!!(((gglobaloptions_160121 &(1U<<((NU)(((NU8) 19))&31U)))!=0))) goto LA18; { NimStringDesc* dir_210637; dir_210637 = 0; { NimStringDesc* current_210654; if (!NIM_FALSE) goto LA23; current_210654 = copyString(pd); { NimStringDesc* LOC29; if (!NIM_FALSE) goto LA27; dir_210637 = pd; LOC29 = 0; LOC29 = HEX2F_118465(dir_210637, cfg); readconfigfile_210382(LOC29); } LA27: ; { while (1) { NimStringDesc* LOC37; { NIM_BOOL LOC34; LOC34 = 0; LOC34 = nosisRootDir(current_210654); if (!LOC34) goto LA35; goto LA30; } LA35: ; current_210654 = nosparentDir(current_210654); dir_210637 = current_210654; LOC37 = 0; LOC37 = HEX2F_118465(dir_210637, cfg); readconfigfile_210382(LOC37); } } LA30: ; } goto LA21; LA23: ; { { NI i_210656; NI HEX3Atmp_210658; NI res_210660; i_210656 = 0; HEX3Atmp_210658 = 0; HEX3Atmp_210658 = (NI)((pd ? pd->Sup.len : 0) - ((NI) 2)); res_210660 = ((NI) 0); { while (1) { if (!(res_210660 <= HEX3Atmp_210658)) goto LA41; i_210656 = res_210660; { NIM_BOOL LOC44; NIM_BOOL LOC46; NimStringDesc* LOC50; LOC44 = 0; LOC44 = (((NU8)(pd->data[i_210656])) == ((NU8)(47)) || ((NU8)(pd->data[i_210656])) == ((NU8)(47))); if (!(LOC44)) goto LA45; LOC46 = 0; LOC46 = (i_210656 == ((NI) 0)); if (LOC46) goto LA47; LOC46 = !((((NU8)(pd->data[(NI)(i_210656 - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(pd->data[(NI)(i_210656 - ((NI) 1))])) == ((NU8)(47)))); LA47: ; LOC44 = LOC46; LA45: ; if (!LOC44) goto LA48; dir_210637 = copyStrLast(pd, ((NI) 0), i_210656); LOC50 = 0; LOC50 = HEX2F_118465(dir_210637, cfg); readconfigfile_210382(LOC50); } LA48: ; res_210660 += ((NI) 1); } LA41: ; } } { NimStringDesc* LOC55; if (!NIM_FALSE) goto LA53; dir_210637 = pd; LOC55 = 0; LOC55 = HEX2F_118465(dir_210637, cfg); readconfigfile_210382(LOC55); } LA53: ; } LA21: ; } } LA18: ; { NimStringDesc* LOC60; if (!!(((gglobaloptions_160121 &(1U<<((NU)(((NU8) 17))&31U)))!=0))) goto LA58; LOC60 = 0; LOC60 = HEX2F_118465(pd, cfg); readconfigfile_210382(LOC60); { NimStringDesc* projectconfig; if (!!(((gprojectname_160199 ? gprojectname_160199->Sup.len : 0) == ((NI) 0)))) goto LA63; projectconfig = noschangeFileExt(gprojectfull_160201, ((NimStringDesc*) &TMP2054)); { NIM_BOOL LOC67; LOC67 = 0; LOC67 = fileexists_121804(projectconfig); if (!!(LOC67)) goto LA68; projectconfig = noschangeFileExt(gprojectfull_160201, ((NimStringDesc*) &TMP2055)); } LA68: ; { NIM_BOOL LOC72; LOC72 = 0; LOC72 = fileexists_121804(projectconfig); if (!!(LOC72)) goto LA73; projectconfig = noschangeFileExt(gprojectfull_160201, ((NimStringDesc*) &TMP2056)); { NIM_BOOL LOC77; LOC77 = 0; LOC77 = fileexists_121804(projectconfig); if (!LOC77) goto LA78; rawmessage_185612(((NU16) 241), projectconfig); } LA78: ; } LA73: ; readconfigfile_210382(projectconfig); } LA63: ; } LA58: ; }
int rdf_GetURL (MWContext *cx, int method, Net_GetUrlExitFunc *exit_routine, RDFFile rdfFile) { MozillaEvent_rdf_GetURL *event; URL_Struct *urls = NULL; char *url; #ifdef DEBUG_gagan return 0; #endif if (cx == NULL) return 0; if (rdfFile->refreshingp && rdfFile->updateURL) { url = rdfFile->updateURL; } else { url = rdfFile->url; } if (strcmp(url, gNavCntrUrl) == 0) { urls = NET_CreateURLStruct(url, NET_CACHE_ONLY_RELOAD); #ifdef NU_CACHE if (!CacheManager_Contains(url)) { #else if (NET_IsURLInDiskCache(urls) || NET_IsURLInMemCache(urls)) { } else { #endif NET_FreeURLStruct(urls); urls = NULL; } } if (!urls) urls = NET_CreateURLStruct(url, (rdfFile->refreshingp ? NET_SUPER_RELOAD : NET_NORMAL_RELOAD)); if (urls == NULL) return 0; urls->fe_data = rdfFile; if (method) urls->method = method; if (PR_CurrentThread() == mozilla_thread) { htLoadBegins(urls, url); NET_GetURL(urls, FO_CACHE_AND_RDF, cx, rdf_GetUrlExitFunc); } else { /* send event to Mozilla thread */ if (mozilla_event_queue == NULL) return(0); event = PR_NEW(MozillaEvent_rdf_GetURL); if (event == NULL) return(0); PR_InitEvent(&(event->ce.event), cx, (PRHandleEventProc)rdf_HandleEvent_GetURL, (PRDestroyEventProc)rdf_DisposeEvent_GetURL); event->url = copyString(url); event->urls = urls; event->method = FO_CACHE_AND_RDF; event->cx = cx; event->exitFunc = rdf_GetUrlExitFunc; PR_PostEvent(mozilla_event_queue, &(event->ce.event)); } return 1; } #endif /* MOZILLA_CLIENT */ void possiblyRereadRDFFiles (void* data) { possiblyRefreshRDFFiles(); /* timerID = FE_SetTimeout(possiblyRereadRDFFiles, NULL, 1000 * 60 * 10); once every 10 minutes diabled for legal reasons.*/ } void RDFglueInitialize() { #ifdef MOZILLA_CLIENT timerID = FE_SetTimeout(possiblyRereadRDFFiles, NULL, 1000 * 60 * 10); /* once every 10 minutes */ if (gRLForbiddenDomains != NULL) { freeMem(gRLForbiddenDomains); gRLForbiddenDomains = NULL; } if (PREF_CopyCharPref("browser.relatedLinksDisabledForDomains", &gRLForbiddenDomains) != PREF_OK) { gRLForbiddenDomains = NULL; } #endif /* MOZILLA_CLIENT */ }
N_NIMCALL(NimStringDesc*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail) { NimStringDesc* result; result = 0; { if (!((head ? head->Sup.len : 0) == ((NI) 0))) goto LA3; result = copyString(tail); } goto LA1; LA3: ; { if (!(((NU8)(head->data[(NI)((head ? head->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(head->data[(NI)((head ? head->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)))) goto LA6; { NimStringDesc* LOC12; NimStringDesc* LOC13; if (!(((NU8)(tail->data[((NI) 0)])) == ((NU8)(47)) || ((NU8)(tail->data[((NI) 0)])) == ((NU8)(47)))) goto LA10; LOC12 = 0; LOC13 = 0; LOC13 = copyStr(tail, ((NI) 1)); LOC12 = rawNewString(head->Sup.len + LOC13->Sup.len + 0); appendString(LOC12, head); appendString(LOC12, LOC13); result = LOC12; } goto LA8; LA10: ; { NimStringDesc* LOC15; LOC15 = 0; LOC15 = rawNewString(head->Sup.len + tail->Sup.len + 0); appendString(LOC15, head); appendString(LOC15, tail); result = LOC15; } LA8: ; } goto LA1; LA6: ; { { NimStringDesc* LOC21; if (!(((NU8)(tail->data[((NI) 0)])) == ((NU8)(47)) || ((NU8)(tail->data[((NI) 0)])) == ((NU8)(47)))) goto LA19; LOC21 = 0; LOC21 = rawNewString(head->Sup.len + tail->Sup.len + 0); appendString(LOC21, head); appendString(LOC21, tail); result = LOC21; } goto LA17; LA19: ; { NimStringDesc* LOC23; LOC23 = 0; LOC23 = rawNewString(head->Sup.len + tail->Sup.len + 1); appendString(LOC23, head); appendChar(LOC23, 47); appendString(LOC23, tail); result = LOC23; } LA17: ; } LA1: ; return result; }
N_NIMCALL(void, Clikenexttoken_154547)(TY153007* G_154550, NimStringDesc** Keywords_154552, NI Keywords_154552Len0, NU8 Flags_154553) { NI Pos_154562; NI Nested_154766; NimStringDesc* Id_154938; NI LOC39; NIM_BOOL LOC66; Pos_154562 = 0; Pos_154562 = (*G_154550).Pos; (*G_154550).Start = (*G_154550).Pos; if (!((*G_154550).State == ((NU8) 10))) goto LA2; (*G_154550).Kind = ((NU8) 10); while (1) { switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 92: (*G_154550).Kind = ((NU8) 13); Pos_154562 += 1; switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 120: case 88: Pos_154562 += 1; if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(70)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(102)))) goto LA6; Pos_154562 += 1; LA6: ; if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(70)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(102)))) goto LA9; Pos_154562 += 1; LA9: ; break; case 48 ... 57: while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)))) goto LA11; Pos_154562 += 1; } LA11: ; break; case 0: (*G_154550).State = ((NU8) 1); break; default: Pos_154562 += 1; break; } goto LA4; break; case 0: case 13: case 10: (*G_154550).State = ((NU8) 1); goto LA4; break; case 34: Pos_154562 += 1; (*G_154550).State = ((NU8) 1); goto LA4; break; default: Pos_154562 += 1; break; } } LA4: ; goto LA1; LA2: ; switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 32: case 9 ... 13: (*G_154550).Kind = ((NU8) 2); while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(32)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(9)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(13)))) goto LA12; Pos_154562 += 1; } LA12: ; break; case 47: Pos_154562 += 1; if (!((NU8)((*G_154550).Buf[Pos_154562]) == (NU8)(47))) goto LA14; (*G_154550).Kind = ((NU8) 16); while (1) { if (!!((((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(0)) || ((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(10)) || ((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(13))))) goto LA16; Pos_154562 += 1; } LA16: ; goto LA13; LA14: ; if (!((NU8)((*G_154550).Buf[Pos_154562]) == (NU8)(42))) goto LA17; (*G_154550).Kind = ((NU8) 17); Nested_154766 = 0; Nested_154766 = 0; Pos_154562 += 1; while (1) { switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 42: Pos_154562 += 1; if (!((NU8)((*G_154550).Buf[Pos_154562]) == (NU8)(47))) goto LA21; Pos_154562 += 1; if (!(Nested_154766 == 0)) goto LA24; goto LA19; LA24: ; LA21: ; break; case 47: Pos_154562 += 1; if (!((NU8)((*G_154550).Buf[Pos_154562]) == (NU8)(42))) goto LA27; Pos_154562 += 1; if (!((Flags_154553 &(1<<((((NU8) 1))&7)))!=0)) goto LA30; Nested_154766 += 1; LA30: ; LA27: ; break; case 0: goto LA19; break; default: Pos_154562 += 1; break; } } LA19: ; goto LA13; LA17: ; LA13: ; break; case 35: Pos_154562 += 1; if (!((Flags_154553 &(1<<((((NU8) 0))&7)))!=0)) goto LA33; (*G_154550).Kind = ((NU8) 25); while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(32)) || ((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(9)))) goto LA35; Pos_154562 += 1; } LA35: ; while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)) || ((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(95)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(128)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(255)))) goto LA36; Pos_154562 += 1; } LA36: ; goto LA32; LA33: ; (*G_154550).Kind = ((NU8) 14); LA32: ; break; case 97 ... 122: case 65 ... 90: case 95: case 128 ... 255: Id_154938 = 0; Id_154938 = copyString(((NimStringDesc*) &TMP197260)); while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)) || ((NU8)((*G_154550).Buf[Pos_154562])) == ((NU8)(95)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(128)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(255)))) goto LA37; Id_154938 = addChar(Id_154938, (*G_154550).Buf[Pos_154562]); Pos_154562 += 1; } LA37: ; LOC39 = Iskeyword_154481(Keywords_154552, Keywords_154552Len0, Id_154938); if (!(0 <= LOC39)) goto LA40; (*G_154550).Kind = ((NU8) 9); goto LA38; LA40: ; (*G_154550).Kind = ((NU8) 8); LA38: ; break; case 48: Pos_154562 += 1; switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 98: case 66: Pos_154562 += 1; while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(49)))) goto LA42; Pos_154562 += 1; } LA42: ; if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)))) goto LA44; Pos_154562 += 1; LA44: ; break; case 120: case 88: Pos_154562 += 1; while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(57)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(70)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(102)))) goto LA46; Pos_154562 += 1; } LA46: ; if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)))) goto LA48; Pos_154562 += 1; LA48: ; break; case 48 ... 55: Pos_154562 += 1; while (1) { if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(48)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(55)))) goto LA50; Pos_154562 += 1; } LA50: ; if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)))) goto LA52; Pos_154562 += 1; LA52: ; break; default: Pos_154562 = Generalnumber_154186(G_154550, Pos_154562); if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)))) goto LA55; Pos_154562 += 1; LA55: ; break; } break; case 49 ... 57: Pos_154562 = Generalnumber_154186(G_154550, Pos_154562); if (!(((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(65)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(90)) || ((NU8)((*G_154550).Buf[Pos_154562])) >= ((NU8)(97)) && ((NU8)((*G_154550).Buf[Pos_154562])) <= ((NU8)(122)))) goto LA58; Pos_154562 += 1; LA58: ; break; case 39: Pos_154562 = Generalstrlit_154326(G_154550, Pos_154562); (*G_154550).Kind = ((NU8) 12); break; case 34: Pos_154562 += 1; (*G_154550).Kind = ((NU8) 10); while (1) { switch (((NU8)((*G_154550).Buf[Pos_154562]))) { case 0: goto LA60; break; case 34: Pos_154562 += 1; goto LA60; break; case 92: (*G_154550).State = (*G_154550).Kind; goto LA60; break; default: Pos_154562 += 1; break; } } LA60: ; break; case 40: case 41: case 91: case 93: case 123: case 125: case 58: case 44: case 59: case 46: Pos_154562 += 1; (*G_154550).Kind = ((NU8) 15); break; case 0: (*G_154550).Kind = ((NU8) 0); break; default: if (!((TMP197261[((NU8)((*G_154550).Buf[Pos_154562]))/8] &(1<<(((NU8)((*G_154550).Buf[Pos_154562]))%8)))!=0)) goto LA62; (*G_154550).Kind = ((NU8) 14); while (1) { if (!((TMP197261[((NU8)((*G_154550).Buf[Pos_154562]))/8] &(1<<(((NU8)((*G_154550).Buf[Pos_154562]))%8)))!=0)) goto LA64; Pos_154562 += 1; } LA64: ; goto LA61; LA62: ; Pos_154562 += 1; (*G_154550).Kind = ((NU8) 1); LA61: ; break; } LA1: ; (*G_154550).Length = (NI64)(Pos_154562 - (*G_154550).Pos); LOC66 = !(((*G_154550).Kind == ((NU8) 0))); if (!(LOC66)) goto LA67; LOC66 = ((*G_154550).Length <= 0); LA67: ; if (!LOC66) goto LA68; Internalerror_48163(((NimStringDesc*) &TMP197311)); LA68: ; (*G_154550).Pos = Pos_154562; }
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_LIB_PRIVATE N_NIMCALL(void, processCmdLine_tw2pZl8Nisz38VPmsT5WZA)(tyEnum_TCmdLinePass_IiBn9cB6WYIMDHOT44O82wA pass, NimStringDesc* cmd) { tyObject_OptParser_fe5bDDfRbVwQIuUOouExnA p; NI argsCount; memset((void*)(&p), 0, sizeof(p)); p.Sup.m_type = (&NTI_fe5bDDfRbVwQIuUOouExnA_); initOptParser_xt25Cv9cQqaNt3Mscl7nHFA(cmd, (&p)); argsCount = ((NI) 0); { while (1) { nponext((&p)); switch (p.kind) { case ((tyEnum_CmdLineKind_XkdXq9atxjiuhkFFh0XYrSA) 0): { goto LA1; } break; case ((tyEnum_CmdLineKind_XkdXq9atxjiuhkFFh0XYrSA) 2): case ((tyEnum_CmdLineKind_XkdXq9atxjiuhkFFh0XYrSA) 3): { { if (!eqStrings(p.key, ((NimStringDesc*) &TM_AxyNANBXigTKyIcRAbufXw_5))) goto LA7_; p.key = copyString(((NimStringDesc*) &TM_AxyNANBXigTKyIcRAbufXw_6)); { NIM_BOOL T11_; T11_ = (NIM_BOOL)0; T11_ = processArgument_lWiIBVoVYe1MHypeoTZrBw(pass, (&p), (&argsCount)); if (!T11_) goto LA12_; goto LA1; } LA12_: ; } goto LA5_; LA7_: ; { processSwitch_TdGOW9ciAVvdBm6nv23Sz9aA(pass, (&p)); } LA5_: ; } break; case ((tyEnum_CmdLineKind_XkdXq9atxjiuhkFFh0XYrSA) 1): { { NIM_BOOL T18_; T18_ = (NIM_BOOL)0; T18_ = processArgument_lWiIBVoVYe1MHypeoTZrBw(pass, (&p), (&argsCount)); if (!T18_) goto LA19_; goto LA1; } LA19_: ; } break; } } } LA1: ; { if (!(pass == ((tyEnum_TCmdLinePass_IiBn9cB6WYIMDHOT44O82wA) 1))) goto LA23_; { NIM_BOOL T27_; NIM_BOOL T28_; NimStringDesc* T31_; tyArray_8ZvwQIddfpj2THRVPsFzIQ T34_; T27_ = (NIM_BOOL)0; T28_ = (NIM_BOOL)0; T28_ = !(((gGlobalOptions_j042VVDC9cT5ENYoXnmhhVg &(1U<<((NU)(((tyEnum_TGlobalOption_RAfAEZqjnKMDumgyKKc1qw) 12))&31U)))!=0)); if (!(T28_)) goto LA29_; T28_ = !(((arguments_J4sVmqKDJ3MkfxziRX9cODA) && (arguments_J4sVmqKDJ3MkfxziRX9cODA)->Sup.len == 0)); LA29_: ; T27_ = T28_; if (!(T27_)) goto LA30_; T31_ = (NimStringDesc*)0; T31_ = nsuNormalize(command_zo83h8QWwtDIGDuqkGhjqg); T27_ = !(eqStrings(T31_, ((NimStringDesc*) &TM_AxyNANBXigTKyIcRAbufXw_7))); LA30_: ; if (!T27_) goto LA32_; memset((void*)T34_, 0, sizeof(T34_)); rawMessage_wSQLHRsYvHJ4DSWgdFrFaA(((tyEnum_TMsgKind_IGAWgv9aR2KqPKJfPZPEWaw) 60), T34_, 0); } LA32_: ; } LA23_: ; }
/** * Method: Log::getName */ INV_EXPORT _string INV_CALL log_get_name(InvHandle self) { return copyString(asLog(self)->getName()); }
N_NIMCALL(void, loadconfigs_185811)(NimStringDesc* cfg) { NimStringDesc* pd; { NimStringDesc* prefix; if (!((libpath_153233) && (libpath_153233)->Sup.len == 0)) goto LA3; prefix = getprefixdir_153371(); { NimStringDesc* LOC9; if (!eqStrings(prefix, ((NimStringDesc*) &TMP1872))) goto LA7; LOC9 = 0; LOC9 = libpath_153233; libpath_153233 = copyStringRC1(((NimStringDesc*) &TMP1873)); if (LOC9) nimGCunrefNoCycle(LOC9); } goto LA5; LA7: ; { NimStringDesc* LOC13; if (!eqStrings(prefix, ((NimStringDesc*) &TMP1874))) goto LA11; LOC13 = 0; LOC13 = libpath_153233; libpath_153233 = copyStringRC1(((NimStringDesc*) &TMP1875)); if (LOC13) nimGCunrefNoCycle(LOC13); } goto LA5; LA11: ; { asgnRefNoCycle((void**) (&libpath_153233), nosjoinPath(prefix, ((NimStringDesc*) &TMP1876))); } LA5: ; } LA3: ; { NimStringDesc* LOC19; if (!!(((gglobaloptions_153128 &(1<<((((NU8) 16))&31)))!=0))) goto LA17; LOC19 = 0; LOC19 = getsystemconfigpath_185592(cfg); readconfigfile_185522(LOC19); } LA17: ; { NimStringDesc* LOC24; if (!!(((gglobaloptions_153128 &(1<<((((NU8) 18))&31)))!=0))) goto LA22; LOC24 = 0; LOC24 = getuserconfigpath_185580(cfg); readconfigfile_185522(LOC24); } LA22: ; { if (!(((NI) 0) < (gprojectpath_153235 ? gprojectpath_153235->Sup.len : 0))) goto LA27; pd = copyString(gprojectpath_153235); } goto LA25; LA27: ; { pd = nosgetCurrentDir(); } LA25: ; { if (!!(((gglobaloptions_153128 &(1<<((((NU8) 19))&31)))!=0))) goto LA32; { NimStringDesc* dir_186034; dir_186034 = 0; { NimStringDesc* current_186051; if (!NIM_FALSE) goto LA37; current_186051 = copyString(pd); { NimStringDesc* LOC43; if (!NIM_FALSE) goto LA41; dir_186034 = pd; LOC43 = 0; LOC43 = HEX2F_118292(dir_186034, cfg); readconfigfile_185522(LOC43); } LA41: ; { while (1) { NimStringDesc* LOC51; { NIM_BOOL LOC48; LOC48 = 0; LOC48 = nosisRootDir(current_186051); if (!LOC48) goto LA49; goto LA44; } LA49: ; current_186051 = nosparentDir(current_186051); dir_186034 = current_186051; LOC51 = 0; LOC51 = HEX2F_118292(dir_186034, cfg); readconfigfile_185522(LOC51); } } LA44: ; } goto LA35; LA37: ; { { NI i_186053; NI HEX3Atmp_186055; NI res_186057; i_186053 = 0; HEX3Atmp_186055 = 0; HEX3Atmp_186055 = (NI)((pd ? pd->Sup.len : 0) - ((NI) 2)); res_186057 = ((NI) 0); { while (1) { if (!(res_186057 <= HEX3Atmp_186055)) goto LA55; i_186053 = res_186057; { NIM_BOOL LOC58; NIM_BOOL LOC60; NimStringDesc* LOC64; LOC58 = 0; LOC58 = (((NU8)(pd->data[i_186053])) == ((NU8)(47)) || ((NU8)(pd->data[i_186053])) == ((NU8)(47))); if (!(LOC58)) goto LA59; LOC60 = 0; LOC60 = (i_186053 == ((NI) 0)); if (LOC60) goto LA61; LOC60 = !((((NU8)(pd->data[(NI)(i_186053 - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(pd->data[(NI)(i_186053 - ((NI) 1))])) == ((NU8)(47)))); LA61: ; LOC58 = LOC60; LA59: ; if (!LOC58) goto LA62; dir_186034 = copyStrLast(pd, ((NI) 0), i_186053); LOC64 = 0; LOC64 = HEX2F_118292(dir_186034, cfg); readconfigfile_185522(LOC64); } LA62: ; res_186057 += ((NI) 1); } LA55: ; } } { NimStringDesc* LOC69; if (!NIM_FALSE) goto LA67; dir_186034 = pd; LOC69 = 0; LOC69 = HEX2F_118292(dir_186034, cfg); readconfigfile_185522(LOC69); } LA67: ; } LA35: ; } } LA32: ; { NimStringDesc* LOC74; if (!!(((gglobaloptions_153128 &(1<<((((NU8) 17))&31)))!=0))) goto LA72; LOC74 = 0; LOC74 = HEX2F_118292(pd, cfg); readconfigfile_185522(LOC74); { NimStringDesc* projectconfig; if (!!(((gprojectname_153234 ? gprojectname_153234->Sup.len : 0) == ((NI) 0)))) goto LA77; projectconfig = noschangeFileExt(gprojectfull_153236, ((NimStringDesc*) &TMP1896)); { NIM_BOOL LOC81; LOC81 = 0; LOC81 = fileexists_117010(projectconfig); if (!!(LOC81)) goto LA82; projectconfig = noschangeFileExt(gprojectfull_153236, ((NimStringDesc*) &TMP1897)); } LA82: ; { NIM_BOOL LOC86; LOC86 = 0; LOC86 = fileexists_117010(projectconfig); if (!!(LOC86)) goto LA87; projectconfig = noschangeFileExt(gprojectfull_153236, ((NimStringDesc*) &TMP1898)); { NIM_BOOL LOC91; LOC91 = 0; LOC91 = fileexists_117010(projectconfig); if (!LOC91) goto LA92; rawmessage_163970(((NU16) 234), projectconfig); } LA92: ; } LA87: ; readconfigfile_185522(projectconfig); } LA77: ; } LA72: ; }
static void testAll(World &world) { auto sourceString = reinterpret_cast<const std::uint8_t*>(u8"Hello world everyone!"); const size_t sourceLength = 21; // Create a source bytevector alloc::BytevectorRef origBv(world, BytevectorCell::fromData(world, sourceString, sourceLength)); // Create a direct copy alloc::BytevectorRef copyBv(world, origBv->copy(world)); ASSERT_TRUE(sharedByteArrayFor(origBv) == sharedByteArrayFor(copyBv)); // Set an byte of the copy ASSERT_TRUE(copyBv->setByteAt(0, 4)); // The sharing should now be broken ASSERT_FALSE(sharedByteArrayFor(origBv) == sharedByteArrayFor(copyBv)); // Create a copy from appending a single bytevector alloc::BytevectorRef appendedBv(world, BytevectorCell::fromAppended(world, {origBv})); ASSERT_TRUE(sharedByteArrayFor(origBv) == sharedByteArrayFor(appendedBv)); // Replace part of the byte array ASSERT_TRUE(appendedBv->replace(3, origBv, 0, 1)); // Sharing should now be broken ASSERT_FALSE(sharedByteArrayFor(origBv) == sharedByteArrayFor(appendedBv)); // Create a string from the bytevector alloc::StringRef origString(world, origBv->utf8ToString(world)); ASSERT_TRUE(sharedByteArrayFor(origBv) == sharedByteArrayFor(origString)); // Create a string as a copy alloc::StringRef copyString(world, origString->copy(world)); ASSERT_TRUE(sharedByteArrayFor(origString) == sharedByteArrayFor(copyString)); // Set a character in the string ASSERT_TRUE(copyString->setCharAt(5, UnicodeChar('!'))); // Sharing should now be broken ASSERT_FALSE(sharedByteArrayFor(origString) == sharedByteArrayFor(copyString)); // Create a string from appending a single string alloc::StringRef appendedString(world, StringCell::fromAppended(world, {origString})); ASSERT_TRUE(sharedByteArrayFor(origString) == sharedByteArrayFor(appendedString)); // Fill the string ASSERT_TRUE(appendedString->fill(UnicodeChar(4))); // Sharing should now be broken ASSERT_FALSE(sharedByteArrayFor(origString) == sharedByteArrayFor(appendedString)); // Create a symbol from the appended string alloc::SymbolRef symbol(world, SymbolCell::fromString(world, appendedString)); ASSERT_TRUE(sharedByteArrayFor(appendedString) == sharedByteArrayFor(symbol)); // Writing to the string again should break sharing // Symbols are immutable so breaking cannot happen from the symbol side appendedString->replace(1, origString, 0, 1); ASSERT_FALSE(sharedByteArrayFor(appendedString) == sharedByteArrayFor(symbol)); // // Test a grand tour of string -> symbol -> string -> bytevector -> string // alloc::StringRef firstString(world, StringCell::fromUtf8StdString(world, u8"Hello world everyone!")); alloc::SymbolRef firstSymbol(world, SymbolCell::fromString(world, firstString)); alloc::StringRef secondString(world, StringCell::fromSymbol(world, firstSymbol)); alloc::BytevectorRef firstBv(world, secondString->toUtf8Bytevector(world)); alloc::StringRef thirdString(world, firstBv->utf8ToString(world)); ASSERT_TRUE(sharedByteArrayFor(firstString) == sharedByteArrayFor(thirdString)); }
N_NIMCALL(void, processcmdline_521209)(NU8 pass, NimStringDesc* cmd) { Optparser174011 p; NI argscount; nimfr("processCmdLine", "service.nim") memset((void*)(&p), 0, sizeof(p)); p.Sup.m_type = (&NTI174011); nimln(30, "service.nim"); chckNil((void*)(&p)); memset((void*)(&p), 0, sizeof(p)); p.Sup.m_type = (&NTI174011); initoptparser_174030(cmd, (&p)); nimln(31, "service.nim"); argscount = ((NI) 0); { nimln(32, "service.nim"); while (1) { nimln(33, "service.nim"); nponext((&p)); nimln(34, "service.nim"); switch (p.kind) { case ((NU8) 0): { nimln(35, "service.nim"); goto LA1; } break; case ((NU8) 2): case ((NU8) 3): { nimln(37, "service.nim"); { if (!eqStrings(p.key, ((NimStringDesc*) &TMP10633))) goto LA7; nimln(38, "service.nim"); p.key = copyString(((NimStringDesc*) &TMP10634)); nimln(39, "service.nim"); { NIM_BOOL LOC11; LOC11 = 0; LOC11 = processargument_176738(pass, (&p), (&argscount)); if (!LOC11) goto LA12; goto LA1; } LA12: ; } goto LA5; LA7: ; { nimln(41, "service.nim"); processswitch_176725(pass, (&p)); } LA5: ; } break; case ((NU8) 1): { nimln(43, "service.nim"); { NIM_BOOL LOC18; LOC18 = 0; LOC18 = processargument_176738(pass, (&p), (&argscount)); if (!LOC18) goto LA19; goto LA1; } LA19: ; } break; } } } LA1: ; nimln(44, "service.nim"); { if (!(pass == ((NU8) 1))) goto LA23; nimln(45, "service.nim"); { NIM_BOOL LOC27; NIM_BOOL LOC28; NimStringDesc* LOC31; TY143651 LOC34; LOC27 = 0; LOC28 = 0; LOC28 = !(((gglobaloptions_153128 &(1<<((((NU8) 13))&31)))!=0)); if (!(LOC28)) goto LA29; LOC28 = !(((arguments_176721) && (arguments_176721)->Sup.len == 0)); LA29: ; LOC27 = LOC28; if (!(LOC27)) goto LA30; LOC31 = 0; LOC31 = nsuNormalize(command_153239); LOC27 = !(eqStrings(LOC31, ((NimStringDesc*) &TMP10635))); LA30: ; if (!LOC27) goto LA32; nimln(46, "service.nim"); memset((void*)LOC34, 0, sizeof(LOC34)); rawmessage_163888(((NU16) 57), LOC34, 0); } LA32: ; } LA23: ; popFrame(); }
N_NIMCALL(NimStringDesc*, nstFormat)(NimStringDesc* f, tstringtable113610* t, NU8 flags) { NimStringDesc* result; NI i; nimfr("%", "strtabs.nim") result = 0; nimln(194, "strtabs.nim"); result = copyString(((NimStringDesc*) &TMP297)); nimln(195, "strtabs.nim"); i = 0; nimln(196, "strtabs.nim"); while (1) { nimln(196, "strtabs.nim"); nimln(196, "strtabs.nim"); if (!(i < f->Sup.len)) goto LA1; nimln(197, "strtabs.nim"); { NI TMP314; nimln(197, "strtabs.nim"); if ((NU)(i) > (NU)(f->Sup.len)) raiseIndexError(); if (!((NU8)(f->data[i]) == (NU8)(36))) goto LA4; nimln(198, "strtabs.nim"); nimln(198, "strtabs.nim"); TMP314 = addInt(i, 1); if ((NU)((NI32)(TMP314)) > (NU)(f->Sup.len)) raiseIndexError(); switch (((NU8)(f->data[(NI32)(TMP314)]))) { case 36: { nimln(200, "strtabs.nim"); result = addChar(result, 36); nimln(201, "strtabs.nim"); i = addInt(i, 2); } break; case 123: { NI j; NI TMP315; NI TMP316; NI TMP317; NimStringDesc* LOC11; NimStringDesc* LOC12; NI TMP318; nimln(203, "strtabs.nim"); nimln(203, "strtabs.nim"); TMP315 = addInt(i, 1); j = (NI32)(TMP315); nimln(204, "strtabs.nim"); while (1) { NIM_BOOL LOC9; nimln(204, "strtabs.nim"); LOC9 = 0; nimln(204, "strtabs.nim"); nimln(204, "strtabs.nim"); LOC9 = (j < f->Sup.len); if (!(LOC9)) goto LA10; nimln(698, "system.nim"); nimln(698, "system.nim"); if ((NU)(j) > (NU)(f->Sup.len)) raiseIndexError(); LOC9 = !(((NU8)(f->data[j]) == (NU8)(125))); LA10: ; if (!LOC9) goto LA8; nimln(204, "strtabs.nim"); j = addInt(j, 1); } LA8: ; nimln(205, "strtabs.nim"); nimln(205, "strtabs.nim"); nimln(205, "strtabs.nim"); nimln(205, "strtabs.nim"); TMP316 = addInt(i, 2); nimln(205, "strtabs.nim"); TMP317 = subInt(j, 1); LOC11 = 0; LOC11 = copyStrLast(f, (NI32)(TMP316), (NI32)(TMP317)); LOC12 = 0; LOC12 = getvalue_113975(t, flags, LOC11); result = resizeString(result, LOC12->Sup.len + 0); appendString(result, LOC12); nimln(206, "strtabs.nim"); nimln(206, "strtabs.nim"); TMP318 = addInt(j, 1); i = (NI32)(TMP318); } break; case 97 ... 122: case 65 ... 90: case 128 ... 255: case 95: { NI j; NI TMP319; NI TMP320; NI TMP321; NimStringDesc* LOC17; NimStringDesc* LOC18; nimln(208, "strtabs.nim"); nimln(208, "strtabs.nim"); TMP319 = addInt(i, 1); j = (NI32)(TMP319); nimln(209, "strtabs.nim"); while (1) { NIM_BOOL LOC15; nimln(209, "strtabs.nim"); LOC15 = 0; nimln(209, "strtabs.nim"); nimln(209, "strtabs.nim"); LOC15 = (j < f->Sup.len); if (!(LOC15)) goto LA16; nimln(730, "system.nim"); if ((NU)(j) > (NU)(f->Sup.len)) raiseIndexError(); LOC15 = (((NU8)(f->data[j])) >= ((NU8)(97)) && ((NU8)(f->data[j])) <= ((NU8)(122)) || ((NU8)(f->data[j])) >= ((NU8)(65)) && ((NU8)(f->data[j])) <= ((NU8)(90)) || ((NU8)(f->data[j])) >= ((NU8)(48)) && ((NU8)(f->data[j])) <= ((NU8)(57)) || ((NU8)(f->data[j])) == ((NU8)(95)) || ((NU8)(f->data[j])) >= ((NU8)(128)) && ((NU8)(f->data[j])) <= ((NU8)(255))); LA16: ; if (!LOC15) goto LA14; nimln(209, "strtabs.nim"); j = addInt(j, 1); } LA14: ; nimln(210, "strtabs.nim"); nimln(210, "strtabs.nim"); nimln(210, "strtabs.nim"); nimln(210, "strtabs.nim"); TMP320 = addInt(i, 1); nimln(210, "strtabs.nim"); TMP321 = subInt(j, 1); LOC17 = 0; LOC17 = copyStrLast(f, (NI32)(TMP320), (NI32)(TMP321)); LOC18 = 0; LOC18 = getvalue_113975(t, flags, LOC17); result = resizeString(result, LOC18->Sup.len + 0); appendString(result, LOC18); nimln(211, "strtabs.nim"); i = j; } break; default: { nimln(213, "strtabs.nim"); if ((NU)(i) > (NU)(f->Sup.len)) raiseIndexError(); result = addChar(result, f->data[i]); nimln(214, "strtabs.nim"); i = addInt(i, 1); } break; } } goto LA2; LA4: ; { nimln(216, "strtabs.nim"); if ((NU)(i) > (NU)(f->Sup.len)) raiseIndexError(); result = addChar(result, f->data[i]); nimln(217, "strtabs.nim"); i = addInt(i, 1); } LA2: ; } LA1: ; popFrame(); return result; }
N_NIMCALL(void, rawgettok_156048)(tcfgparser156014* c, ttoken156012* tok) { (*tok).Kind = ((NU8) 0); (*tok).Literal = setLengthStr((*tok).Literal, 0); skip_156628(c); switch (((NU8)((*c).Sup.Buf[(*c).Sup.Bufpos]))) { case 61: { (*tok).Kind = ((NU8) 3); (*c).Sup.Bufpos += 1; unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP126))); } break; case 45: { (*c).Sup.Bufpos += 1; { if (!((NU8)((*c).Sup.Buf[(*c).Sup.Bufpos]) == (NU8)(45))) goto LA5; (*c).Sup.Bufpos += 1; } LA5: ; (*tok).Kind = ((NU8) 7); unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP127))); } break; case 58: { (*tok).Kind = ((NU8) 4); (*c).Sup.Bufpos += 1; unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP128))); } break; case 114: case 82: { { if (!((NU8)((*c).Sup.Buf[(NI64)((*c).Sup.Bufpos + 1)]) == (NU8)(34))) goto LA11; (*c).Sup.Bufpos += 1; getstring_156478(c, tok, NIM_TRUE); } goto LA9; LA11: ; { getsymbol_156582(c, tok); } LA9: ; } break; case 91: { (*tok).Kind = ((NU8) 5); (*c).Sup.Bufpos += 1; unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP130))); } break; case 93: { (*tok).Kind = ((NU8) 6); (*c).Sup.Bufpos += 1; unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP130))); } break; case 34: { getstring_156478(c, tok, NIM_FALSE); } break; case 0: { (*tok).Kind = ((NU8) 1); unsureAsgnRef((void**) &(*tok).Literal, copyString(((NimStringDesc*) &TMP131))); } break; default: { getsymbol_156582(c, tok); } break; } }
N_NIMCALL(NimStringDesc*, nstDollar)(tstringtable113610* t) { NimStringDesc* result; nimfr("$", "strtabs.nim") result = 0; nimln(221, "strtabs.nim"); { NI LOC3; nimln(221, "strtabs.nim"); nimln(221, "strtabs.nim"); LOC3 = 0; LOC3 = nstlen(t); if (!(LOC3 == 0)) goto LA4; nimln(222, "strtabs.nim"); result = copyString(((NimStringDesc*) &TMP322)); } goto LA1; LA4: ; { NimStringDesc* key_114194; NimStringDesc* val_114195; NI h_114198; NI HEX3Atmp_114200; NI res_114202; nimln(224, "strtabs.nim"); result = copyString(((NimStringDesc*) &TMP323)); key_114194 = 0; val_114195 = 0; h_114198 = 0; HEX3Atmp_114200 = 0; nimln(40, "strtabs.nim"); nimln(40, "strtabs.nim"); HEX3Atmp_114200 = ((*t).Data->Sup.len-1); nimln(1308, "system.nim"); res_114202 = 0; nimln(1309, "system.nim"); while (1) { nimln(1309, "system.nim"); if (!(res_114202 <= HEX3Atmp_114200)) goto LA7; nimln(1308, "system.nim"); h_114198 = res_114202; nimln(41, "strtabs.nim"); { nimln(41, "strtabs.nim"); nimln(41, "strtabs.nim"); if ((NU)(h_114198) >= (NU)((*t).Data->Sup.len)) raiseIndexError(); if (!!((*t).Data->data[h_114198].Field0 == 0)) goto LA10; nimln(42, "strtabs.nim"); if ((NU)(h_114198) >= (NU)((*t).Data->Sup.len)) raiseIndexError(); key_114194 = (*t).Data->data[h_114198].Field0; nimln(42, "strtabs.nim"); if ((NU)(h_114198) >= (NU)((*t).Data->Sup.len)) raiseIndexError(); val_114195 = (*t).Data->data[h_114198].Field1; nimln(226, "strtabs.nim"); { nimln(706, "system.nim"); nimln(226, "strtabs.nim"); if (!(1 < result->Sup.len)) goto LA14; nimln(226, "strtabs.nim"); result = resizeString(result, 2); appendString(result, ((NimStringDesc*) &TMP324)); } LA14: ; nimln(227, "strtabs.nim"); result = resizeString(result, key_114194->Sup.len + 0); appendString(result, key_114194); nimln(228, "strtabs.nim"); result = resizeString(result, 2); appendString(result, ((NimStringDesc*) &TMP325)); nimln(229, "strtabs.nim"); result = resizeString(result, val_114195->Sup.len + 0); appendString(result, val_114195); } LA10: ; nimln(1311, "system.nim"); res_114202 = addInt(res_114202, 1); } LA7: ; nimln(230, "strtabs.nim"); result = resizeString(result, 1); appendString(result, ((NimStringDesc*) &TMP326)); } LA1: ; popFrame(); return result; }
N_NIMCALL(NimStringDesc*, setcookie_339106)(NimStringDesc* key, NimStringDesc* value, NimStringDesc* domain, NimStringDesc* path, NimStringDesc* expires, NIM_BOOL noname) { NimStringDesc* result; NimStringDesc* LOC5; nimfr("setCookie", "cookies.nim") result = 0; nimln(35, "cookies.nim"); result = copyString(((NimStringDesc*) &TMP4690)); nimln(36, "cookies.nim"); { nimln(36, "cookies.nim"); if (!!(noname)) goto LA3; nimln(36, "cookies.nim"); result = resizeString(result, 12); appendString(result, ((NimStringDesc*) &TMP4691)); } LA3: ; nimln(37, "cookies.nim"); nimln(37, "cookies.nim"); LOC5 = 0; LOC5 = rawNewString(key->Sup.len + value->Sup.len + 1); appendString(LOC5, key); appendString(LOC5, ((NimStringDesc*) &TMP4692)); appendString(LOC5, value); result = resizeString(result, LOC5->Sup.len + 0); appendString(result, LOC5); nimln(38, "cookies.nim"); { NimStringDesc* LOC10; nimln(38, "cookies.nim"); nimln(38, "cookies.nim"); if (!!(((domain) && (domain)->Sup.len == 0))) goto LA8; nimln(38, "cookies.nim"); nimln(38, "cookies.nim"); LOC10 = 0; LOC10 = rawNewString(domain->Sup.len + 9); appendString(LOC10, ((NimStringDesc*) &TMP4693)); appendString(LOC10, domain); result = resizeString(result, LOC10->Sup.len + 0); appendString(result, LOC10); } LA8: ; nimln(39, "cookies.nim"); { NimStringDesc* LOC15; nimln(39, "cookies.nim"); nimln(39, "cookies.nim"); if (!!(((path) && (path)->Sup.len == 0))) goto LA13; nimln(39, "cookies.nim"); nimln(39, "cookies.nim"); LOC15 = 0; LOC15 = rawNewString(path->Sup.len + 7); appendString(LOC15, ((NimStringDesc*) &TMP4694)); appendString(LOC15, path); result = resizeString(result, LOC15->Sup.len + 0); appendString(result, LOC15); } LA13: ; nimln(40, "cookies.nim"); { NimStringDesc* LOC20; nimln(40, "cookies.nim"); nimln(40, "cookies.nim"); if (!!(((expires) && (expires)->Sup.len == 0))) goto LA18; nimln(40, "cookies.nim"); nimln(40, "cookies.nim"); LOC20 = 0; LOC20 = rawNewString(expires->Sup.len + 10); appendString(LOC20, ((NimStringDesc*) &TMP4695)); appendString(LOC20, expires); result = resizeString(result, LOC20->Sup.len + 0); appendString(result, LOC20); } LA18: ; popFrame(); return result; }
N_NIMCALL(NimStringDesc*, getvalue_113975)(tstringtable113610* t, NU8 flags, NimStringDesc* key) { NimStringDesc* result; nimfr("getValue", "strtabs.nim") result = 0; nimln(150, "strtabs.nim"); { NIM_BOOL LOC3; nimln(150, "strtabs.nim"); LOC3 = 0; LOC3 = nsthasKey(t, key); if (!LOC3) goto LA4; nimln(150, "strtabs.nim"); nimln(150, "strtabs.nim"); result = nstGet(t, key); goto BeforeRet; } LA4: ; nimln(152, "strtabs.nim"); { nimln(730, "system.nim"); if (!((flags &(1<<((((NU8) 0))&7)))!=0)) goto LA8; nimln(152, "strtabs.nim"); nimln(152, "strtabs.nim"); result = getenv_104824(key); } goto LA6; LA8: ; { nimln(153, "strtabs.nim"); result = copyString(((NimStringDesc*) &TMP297)); } LA6: ; nimln(154, "strtabs.nim"); { nimln(154, "strtabs.nim"); nimln(154, "strtabs.nim"); if (!(result->Sup.len == 0)) goto LA13; nimln(155, "strtabs.nim"); { NimStringDesc* LOC19; nimln(730, "system.nim"); if (!((flags &(1<<((((NU8) 2))&7)))!=0)) goto LA17; nimln(155, "strtabs.nim"); nimln(155, "strtabs.nim"); LOC19 = 0; LOC19 = rawNewString(key->Sup.len + 1); appendChar(LOC19, 36); appendString(LOC19, key); result = LOC19; } goto LA15; LA17: ; { nimln(156, "strtabs.nim"); nimln(730, "system.nim"); if (!!(((flags &(1<<((((NU8) 1))&7)))!=0))) goto LA21; nimln(156, "strtabs.nim"); raiseformatexception_113955(key); } goto LA15; LA21: ; LA15: ; } LA13: ; BeforeRet: ; popFrame(); return result; }
bool Model::parseMeshes(FS::IFile& file) { int object_count = 0; file.read(&object_count, sizeof(object_count)); if (object_count <= 0) return false; m_meshes.reserve(object_count); char model_dir[MAX_PATH_LENGTH]; PathUtils::getDir(model_dir, MAX_PATH_LENGTH, getPath().c_str()); for (int i = 0; i < object_count; ++i) { int32 str_size; file.read(&str_size, sizeof(str_size)); char material_name[MAX_PATH_LENGTH]; file.read(material_name, str_size); if (str_size >= MAX_PATH_LENGTH) return false; material_name[str_size] = 0; char material_path[MAX_PATH_LENGTH]; copyString(material_path, model_dir); catString(material_path, material_name); catString(material_path, ".mat"); auto* material_manager = m_resource_manager.get(ResourceManager::MATERIAL); Material* material = static_cast<Material*>(material_manager->load(Path(material_path))); int32 attribute_array_offset = 0; file.read(&attribute_array_offset, sizeof(attribute_array_offset)); int32 attribute_array_size = 0; file.read(&attribute_array_size, sizeof(attribute_array_size)); int32 indices_offset = 0; file.read(&indices_offset, sizeof(indices_offset)); int32 mesh_tri_count = 0; file.read(&mesh_tri_count, sizeof(mesh_tri_count)); file.read(&str_size, sizeof(str_size)); if (str_size >= MAX_PATH_LENGTH) { material_manager->unload(*material); return false; } char mesh_name[MAX_PATH_LENGTH]; mesh_name[str_size] = 0; file.read(mesh_name, str_size); bgfx::VertexDecl def; parseVertexDef(file, &def); m_meshes.emplace(def, material, attribute_array_offset, attribute_array_size, indices_offset, mesh_tri_count * 3, mesh_name, m_allocator); addDependency(*material); } return true; }
/* * Object creation/destruction. */ LinuxFilesystemInfo* newLinuxFilesystemInfo(EFilesystemOperation operation, const char* dev_name, const char* dir_name, const char* type) { LinuxFilesystemInfo* object; #ifdef TALPA_HAVE_PATH_LOOKUP struct nameidata nd; #else struct path p; #endif struct vfsmount *mnt; struct dentry *dentry; int rc; object = talpa_alloc(sizeof(template_LinuxFilesystemInfo)); if ( likely(object != NULL) ) { memcpy(object, &template_LinuxFilesystemInfo, sizeof(template_LinuxFilesystemInfo)); object->i_IFilesystemInfo.object = object; object->mOperation = operation; /* Two cases, mount and umount. On mount we are receiving all the strings and have very little extra work to do. On umount we are receiving just the mount point and will get the other data */ if ( operation == EFS_Mount ) { object->mType = copyString(type); mnt = 0; dentry = 0; #ifdef TALPA_HAVE_PATH_LOOKUP rc = talpa_path_lookup(dev_name, TALPA_LOOKUP, &nd); #else rc = kern_path(dev_name, TALPA_LOOKUP, &p); #endif if ( rc == 0 ) { struct inode *inode; #ifdef TALPA_HAVE_PATH_LOOKUP mnt = talpa_nd_mnt(&nd); dentry = talpa_nd_dentry(&nd); #else mnt = p.mnt; dentry = p.dentry; #endif inode = dentry->d_inode; object->mDeviceName = absolutePath(dentry,mnt); if (S_ISBLK(inode->i_mode)) { object->mDevice = kdev_t_to_nr(inode->i_rdev); object->mDeviceMajor = MAJOR(inode->i_rdev); object->mDeviceMinor = MINOR(inode->i_rdev); } #ifdef TALPA_HAVE_PATH_LOOKUP talpa_path_release(&nd); #else path_put(&p); #endif } if ( !object->mDeviceName ) { dbg("DEBUG: EFS_Mount absolutePath deviceName failed: %s",dev_name); object->mDeviceName = copyString(dev_name); if ( !object->mDeviceName ) { goto error; } } if ( dir_name ) { mnt = 0; dentry = 0; #ifdef TALPA_HAVE_PATH_LOOKUP rc = talpa_path_lookup(dir_name, TALPA_LOOKUP, &nd); #else rc = kern_path(dir_name, TALPA_LOOKUP, &p); #endif if ( rc == 0 ) { #ifdef TALPA_HAVE_PATH_LOOKUP mnt = talpa_nd_mnt(&nd); dentry = talpa_nd_dentry(&nd); #else mnt = p.mnt; dentry = p.dentry; #endif object->mMountPoint = absolutePath(dentry,mnt); #ifdef TALPA_HAVE_PATH_LOOKUP talpa_path_release(&nd); #else path_put(&p); #endif } if ( object->mMountPoint == 0 ) { dbg("DEBUG: EFS_Mount absolutePath dir_name failed: %s",dir_name); object->mMountPoint = copyString(dir_name); } } } else if ( (operation == EFS_Umount) && dir_name ) { const char* mnt_devname; #ifdef TALPA_HAVE_PATH_LOOKUP rc = talpa_path_lookup(dir_name, TALPA_LOOKUP, &nd); #else rc = kern_path(dir_name, TALPA_LOOKUP, &p); #endif if ( unlikely(rc != 0) ) { dbg("DEBUG: EFS_Umount talpa_path_lookup/kern_path failed (%d)", rc); goto error; } #ifdef TALPA_HAVE_PATH_LOOKUP mnt = talpa_nd_mnt(&nd); dentry = talpa_nd_dentry(&nd); #else mnt = p.mnt; dentry = p.dentry; #endif if ( dentry != mnt->mnt_root ) { dbg("DEBUG: EFS_Umount dentry != mnt->mnt_root"); goto error2; } object->mMountPoint = absolutePath(dentry,mnt); if ( object->mMountPoint == 0 ) { dbg("DEBUG: EFS_Umount absolutePath dir_name failed"); object->mMountPoint = copyString(dir_name); if ( !object->mMountPoint ) { goto error2; } } mnt_devname = getDeviceName(mnt); if ( mnt_devname ) { if ( mnt->mnt_sb->s_bdev ) { #ifdef TALPA_HAVE_PATH_LOOKUP struct nameidata dnd; #else struct path dp; #endif struct vfsmount *dmnt; struct dentry *ddentry; #ifdef TALPA_HAVE_PATH_LOOKUP rc = talpa_path_lookup(mnt_devname, TALPA_LOOKUP, &dnd); #else rc = kern_path(mnt_devname, TALPA_LOOKUP, &dp); #endif if ( rc == 0 ) { struct inode *inode; #ifdef TALPA_HAVE_PATH_LOOKUP dmnt = talpa_nd_mnt(&dnd); ddentry = talpa_nd_dentry(&dnd); #else dmnt = dp.mnt; ddentry = dp.dentry; #endif inode = ddentry->d_inode; object->mDeviceName = absolutePath(ddentry,dmnt); if (S_ISBLK(inode->i_mode)) { object->mDevice = kdev_t_to_nr(inode->i_rdev); object->mDeviceMajor = MAJOR(kdev_t_to_nr(inode->i_rdev)); object->mDeviceMinor = MINOR(kdev_t_to_nr(inode->i_rdev)); } #ifdef TALPA_HAVE_PATH_LOOKUP talpa_path_release(&dnd); #else path_put(&dp); #endif } } if ( !object->mDeviceName ) { dbg("DEBUG: EFS_Umount absolutePath mnt_devname failed"); object->mDeviceName = copyString(mnt_devname); if ( !object->mDeviceName ) { goto error2; } } } if ( mnt->mnt_sb->s_type->name ) { object->mType = copyString(mnt->mnt_sb->s_type->name); } if ( !object->mType ) { object->mType = copyString(type); } dbg("Device %s resolved from mount point %s - %s", object->mDeviceName, object->mMountPoint, object->mType); object->mPropagationCount = countPropagationPoints(mnt); #ifdef TALPA_HAVE_PATH_LOOKUP talpa_path_release(&nd); #else path_put(&p); #endif } else { dbg("DEBUG: unknown operation"); goto error; } dbg("NAME:%s MAJOR:%u MINOR:%u",object->mDeviceName, object->mDeviceMajor, object->mDeviceMinor); } else { err("talpa_alloc() failed"); } return object; error2: #ifdef TALPA_HAVE_PATH_LOOKUP talpa_path_release(&nd); #else path_put(&p); #endif error: talpa_free(object->mDeviceName); talpa_free(object->mMountPoint); talpa_free(object->mType); talpa_free(object); return NULL; }