コード例 #1
0
N_NIMCALL(void, loadmaxids_190501)(NimStringDesc* project) {
	FILE* f;
	nimfr("loadMaxIds", "idgen.nim")
	f = 0;
	nimln(57, "idgen.nim");
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line;
		nimln(57, "idgen.nim");
		nimln(57, "idgen.nim");
		LOC3 = 0;
		LOC3 = togid_190457(project);
		LOC4 = 0;
		LOC4 = open_10403(&f, LOC3, ((NU8) 0), -1);
		if (!LOC4) goto LA5;
		nimln(58, "idgen.nim");
		nimln(58, "idgen.nim");
		line = rawNewString(20);
		nimln(59, "idgen.nim");
		{
			NIM_BOOL LOC9;
			NI frontendid;
			nimln(59, "idgen.nim");
			LOC9 = 0;
			LOC9 = readline_10687(f, &line);
			if (!LOC9) goto LA10;
			nimln(60, "idgen.nim");
			frontendid = nsuParseInt(line);
			nimln(61, "idgen.nim");
			{
				NIM_BOOL LOC14;
				NI backendid;
				nimln(61, "idgen.nim");
				LOC14 = 0;
				LOC14 = readline_10687(f, &line);
				if (!LOC14) goto LA15;
				nimln(62, "idgen.nim");
				backendid = nsuParseInt(line);
				nimln(63, "idgen.nim");
				nimln(63, "idgen.nim");
				gfrontendid_190007 = ((gfrontendid_190007 >= frontendid) ? gfrontendid_190007 : frontendid);
				nimln(64, "idgen.nim");
				nimln(64, "idgen.nim");
				gbackendid_190008 = ((gbackendid_190008 >= backendid) ? gbackendid_190008 : backendid);
			}
			LA15: ;
		}
		LA10: ;
		nimln(65, "idgen.nim");
		fclose(f);
	}
	LA5: ;
	popFrame();
}
コード例 #2
0
ファイル: compiler_idgen.c プロジェクト: nim-lang/csources
N_NIMCALL(void, loadmaxids_YGw2jee9aWCa1xh69bRnItGQ)(NimStringDesc* project0) {
	FILE* f0;
	f0 = (FILE*)0;
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line0;
		LOC3 = (NimStringDesc*)0;
		LOC3 = togid_Fvw9bbsIDNn4yf7dHlKp4Bg(project0);
		LOC4 = (NIM_BOOL)0;
		LOC4 = open_sEp0GH2306oGo9bqBpj5oTQ(&f0, LOC3, ((Filemode_fVUBHvW79bXUw1j55Oo9avSQ) 0), ((NI) -1));
		if (!LOC4) goto LA5;
		line0 = rawNewString(((NI) 20));
		{
			NIM_BOOL LOC9;
			NI frontendid0;
			LOC9 = (NIM_BOOL)0;
			LOC9 = readline_sO1bQXVRA6RP9cdYJXNKeSw(f0, (&line0));
			if (!LOC9) goto LA10;
			frontendid0 = nsuParseInt(line0);
			{
				NIM_BOOL LOC14;
				LOC14 = (NIM_BOOL)0;
				LOC14 = readline_sO1bQXVRA6RP9cdYJXNKeSw(f0, (&line0));
				if (!LOC14) goto LA15;
				gfrontendid_gyRrMPnY7JyC6tAu9bCfGng = ((gfrontendid_gyRrMPnY7JyC6tAu9bCfGng >= frontendid0) ? gfrontendid_gyRrMPnY7JyC6tAu9bCfGng : frontendid0);
			}
			LA15: ;
		}
		LA10: ;
		close_BWnr8V7RERYno9bIdPmw8Hw_2(f0);
	}
	LA5: ;
}
コード例 #3
0
N_NIMCALL(void, loadmaxids_293443_644355110)(NimStringDesc* project0) {
	FILE* f0;
	f0 = (FILE*)0;
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line0;
		LOC3 = (NimStringDesc*)0;
		LOC3 = togid_293423_644355110(project0);
		LOC4 = (NIM_BOOL)0;
		LOC4 = open_14803_1689653243(&f0, LOC3, ((Filemode13009) 0), ((NI) -1));
		if (!LOC4) goto LA5;
		line0 = rawNewString(((NI) 20));
		{
			NIM_BOOL LOC9;
			NI frontendid0;
			LOC9 = (NIM_BOOL)0;
			LOC9 = readline_14915_1689653243(f0, (&line0));
			if (!LOC9) goto LA10;
			frontendid0 = nsuParseInt(line0);
			{
				NIM_BOOL LOC14;
				LOC14 = (NIM_BOOL)0;
				LOC14 = readline_14915_1689653243(f0, (&line0));
				if (!LOC14) goto LA15;
				gfrontendid_293004_644355110 = ((gfrontendid_293004_644355110 >= frontendid0) ? gfrontendid_293004_644355110 : frontendid0);
			}
			LA15: ;
		}
		LA10: ;
		close_14853_1689653243(f0);
	}
	LA5: ;
}
コード例 #4
0
N_NIMCALL(void, loadmaxids_292443)(NimStringDesc* project) {
	FILE* f;
	f = 0;
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line;
		LOC3 = 0;
		LOC3 = togid_292423(project);
		LOC4 = 0;
		LOC4 = open_14803(&f, LOC3, ((NU8) 0), ((NI) -1));
		if (!LOC4) goto LA5;
		line = rawNewString(((NI) 20));
		{
			NIM_BOOL LOC9;
			NI frontendid;
			LOC9 = 0;
			LOC9 = readline_14915(f, (&line));
			if (!LOC9) goto LA10;
			frontendid = nsuParseInt(line);
			{
				NIM_BOOL LOC14;
				LOC14 = 0;
				LOC14 = readline_14915(f, (&line));
				if (!LOC14) goto LA15;
				gfrontendid_292007 = ((gfrontendid_292007 >= frontendid) ? gfrontendid_292007 : frontendid);
			}
			LA15: ;
		}
		LA10: ;
		close_14853(f);
	}
	LA5: ;
}
コード例 #5
0
ファイル: osproc.c プロジェクト: ddlsmurf/Nimrod
N_NIMCALL(NI, nospcountProcessors)(void) {
NI Result_63403;
NimStringDesc* X_63404;
Result_63403 = 0;
X_63404 = 0;
X_63404 = Getenv_34218(((NimStringDesc*) &TMP192866));
if (!(0 < X_63404->Sup.len)) goto LA2;
Result_63403 = nsuParseInt(X_63404);
LA2: ;
if (!(Result_63403 <= 0)) goto LA5;
Result_63403 = 1;
LA5: ;
return Result_63403;
}
コード例 #6
0
ファイル: compiler_idgen.c プロジェクト: apense/csources
N_NIMCALL(void, loadmaxids_191510)(NimStringDesc* project) {
	FILE* f;
	f = 0;
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line;
		LOC3 = 0;
		LOC3 = togid_191462(project);
		LOC4 = 0;
		LOC4 = open_13203(&f, LOC3, ((NU8) 0), ((NI) -1));
		if (!LOC4) goto LA5;
		line = rawNewString(((NI) 20));
		{
			NIM_BOOL LOC9;
			NI frontendid;
			LOC9 = 0;
			LOC9 = readline_13481(f, (&line));
			if (!LOC9) goto LA10;
			frontendid = nsuParseInt(line);
			{
				NIM_BOOL LOC14;
				NI backendid;
				LOC14 = 0;
				LOC14 = readline_13481(f, (&line));
				if (!LOC14) goto LA15;
				backendid = nsuParseInt(line);
				gfrontendid_191012 = ((gfrontendid_191012 >= frontendid) ? gfrontendid_191012 : frontendid);
				gbackendid_191013 = ((gbackendid_191013 >= backendid) ? gbackendid_191013 : backendid);
			}
			LA15: ;
		}
		LA10: ;
		fclose(f);
	}
	LA5: ;
}
コード例 #7
0
ファイル: compiler_idgen.c プロジェクト: digideskio/csources
N_NIMCALL(void, loadmaxids_213467)(NimStringDesc* project) {
	FILE* f;
	f = 0;
	{
		NimStringDesc* LOC3;
		NIM_BOOL LOC4;
		NimStringDesc* line;
		LOC3 = 0;
		LOC3 = togid_213435(project);
		LOC4 = 0;
		LOC4 = open_15403(&f, LOC3, ((NU8) 0), ((NI) -1));
		if (!LOC4) goto LA5;
		line = rawNewString(((NI) 20));
		{
			NIM_BOOL LOC9;
			NI frontendid;
			LOC9 = 0;
			LOC9 = readline_15513(f, (&line));
			if (!LOC9) goto LA10;
			frontendid = nsuParseInt(line);
			{
				NIM_BOOL LOC14;
				NI backendid;
				LOC14 = 0;
				LOC14 = readline_15513(f, (&line));
				if (!LOC14) goto LA15;
				backendid = nsuParseInt(line);
				gfrontendid_213003 = ((gfrontendid_213003 >= frontendid) ? gfrontendid_213003 : frontendid);
				gbackendid_213004 = ((gbackendid_213004 >= backendid) ? gbackendid_213004 : backendid);
			}
			LA15: ;
		}
		LA10: ;
		fclose(f);
	}
	LA5: ;
}
コード例 #8
0
ファイル: extccomp.c プロジェクト: ddlsmurf/Nimrod
N_NIMCALL(NIM_BOOL, Externalfilechanged_70524)(NimStringDesc* Filename_70526) {
NIM_BOOL Result_70527;
NimStringDesc* Crcfile_70528;
NI Currentcrc_70529;
int LOC1;
FILE* F_70530;
NIM_BOOL LOC3;
NimStringDesc* Line_70532;
NIM_BOOL LOC7;
NI Oldcrc_70537;
NIM_BOOL LOC15;
NimStringDesc* LOC18;
Result_70527 = 0;
Crcfile_70528 = 0;
Crcfile_70528 = Togeneratedfile_46105(Filename_70526, ((NimStringDesc*) &TMP195647));
Currentcrc_70529 = 0;
LOC1 = Footprint_70520(Filename_70526);
Currentcrc_70529 = ((NI) (LOC1));
F_70530 = 0;
LOC3 = Open_3817(&F_70530, Crcfile_70528, ((NU8) 0), -1);
if (!LOC3) goto LA4;
Line_70532 = 0;
Line_70532 = Readline_3887(F_70530);
LOC7 = Line_70532 == 0;
if (LOC7) goto LA8;
LOC7 = (Line_70532->Sup.len == 0);
LA8: ;
if (!LOC7) goto LA9;
Line_70532 = copyString(((NimStringDesc*) &TMP195649));
LA9: ;
fclose(F_70530);
Oldcrc_70537 = 0;
Oldcrc_70537 = nsuParseInt(Line_70532);
Result_70527 = !((Oldcrc_70537 == Currentcrc_70529));
goto LA2;
LA4: ;
Result_70527 = NIM_TRUE;
LA2: ;
if (!Result_70527) goto LA12;
LOC15 = Open_3817(&F_70530, Crcfile_70528, ((NU8) 1), -1);
if (!LOC15) goto LA16;
LOC18 = 0;
LOC18 = nimIntToStr(Currentcrc_70529);
Writeln_70546(F_70530, LOC18);
fclose(F_70530);
LA16: ;
LA12: ;
return Result_70527;
}
コード例 #9
0
N_NIMCALL(NI, ncpicountProcessors)(void) {
	NI result0;
	NimStringDesc* x0;
	result0 = (NI)0;
	x0 = getenv_135424_2125978480(((NimStringDesc*) &T989850506_2));
	{
		if (!(((NI) 0) < (x0 ? x0->Sup.len : 0))) goto LA3;
		result0 = nsuParseInt(x0);
	}
	LA3: ;
	{
		if (!(result0 <= ((NI) 0))) goto LA7;
		result0 = ((NI) 1);
	}
	LA7: ;
	return result0;
}
コード例 #10
0
N_NIMCALL(NI, ncpicountProcessors)(void) {
	NI result0;
	NimStringDesc* x0;
	result0 = (NI)0;
	x0 = getenv_8zNgT9bxx7m9cTt2TeVdTdIw(((NimStringDesc*) &T_h5LhXa1x7tiRXpXshXFkHA_2));
	{
		if (!(((NI) 0) < (x0 ? x0->Sup.len : 0))) goto LA3;
		result0 = nsuParseInt(x0);
	}
	LA3: ;
	{
		if (!(result0 <= ((NI) 0))) goto LA7;
		result0 = ((NI) 1);
	}
	LA7: ;
	return result0;
}
コード例 #11
0
ファイル: compiler_service.c プロジェクト: undecided/csources
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();
}
コード例 #12
0
ファイル: compiler_service.c プロジェクト: StetHD/csources
N_NIMCALL(void, serve_531236)(TY531238 action) {
	TY531421* HEX3Aenv_531426;
	NimStringDesc* typ;
	HEX3Aenv_531426 = 0;
	HEX3Aenv_531426 = (TY531421*) newObj((&NTI531420), sizeof(TY531421));
	typ = getconfigvar_161282(((NimStringDesc*) &TMP5275));
	if (eqStrings(typ, ((NimStringDesc*) &TMP5276))) goto LA1;
	if (eqStrings(typ, ((NimStringDesc*) &TMP5277))) goto LA2;
	if (eqStrings(typ, ((NimStringDesc*) &TMP1195))) goto LA2;
	goto LA3;
	LA1: ;
	{
		{
			while (1) {
				NimStringDesc* line;
				NimStringDesc* LOC12;
				line = readline_15510(stdin);
				{
					if (!eqStrings(line, ((NimStringDesc*) &TMP5278))) goto LA10;
					exit(((NI) 0));
				}
				LA10: ;
				LOC12 = 0;
				LOC12 = curcaascmd_531201; curcaascmd_531201 = copyStringRC1(line);
				if (LOC12) nimGCunrefNoCycle(LOC12);
				processcmdline_531203(((NU8) 1), line);
				action();
				gerrorcounter_184081 = ((NI) 0);
				printf("%s\012", ((NimStringDesc*) &TMP1195)? (((NimStringDesc*) &TMP1195))->data:"nil");
				fflush(stdout);
				fflush(stdout);
			}
		}
	}
	goto LA4;
	LA2: ;
	{
		Socketimpl523404* server;
		NimStringDesc* p;
		NU16 port;
		NimStringDesc* LOC20;
		NimStringDesc* inp;
		TY184114 LOC21;
		server = newsocket_523821(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE);
		p = getconfigvar_161282(((NimStringDesc*) &TMP5280));
		{
			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: ;
		LOC20 = 0;
		LOC20 = getconfigvar_161282(((NimStringDesc*) &TMP5281));
		bindaddr_524608(server, port, LOC20);
		inp = copyString(((NimStringDesc*) &TMP1195));
		listen_524604(server, SOMAXCONN);
		asgnRefNoCycle((void**) (&(*HEX3Aenv_531426).stdoutsocket531408), newsocket_523821(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE));
		memset((void*)(&LOC21), 0, sizeof(LOC21));
		LOC21.ClPrc = HEX3Aanonymous_531409; LOC21.ClEnv = HEX3Aenv_531426;
		asgnRef((void**) (&writelnhook_184117.ClEnv), LOC21.ClEnv);
		writelnhook_184117.ClPrc = LOC21.ClPrc;
		{
			while (1) {
				NimStringDesc* LOC24;
				accept_525401(server, &(*HEX3Aenv_531426).stdoutsocket531408, 2);
				readline_527602((*HEX3Aenv_531426).stdoutsocket531408, (&inp), ((NI) -1), 2);
				LOC24 = 0;
				LOC24 = curcaascmd_531201; curcaascmd_531201 = copyStringRC1(inp);
				if (LOC24) nimGCunrefNoCycle(LOC24);
				processcmdline_531203(((NU8) 1), inp);
				action();
				gerrorcounter_184081 = ((NI) 0);
				send_528202((*HEX3Aenv_531426).stdoutsocket531408, ((NimStringDesc*) &TMP5284), 2);
				close_525411((*HEX3Aenv_531426).stdoutsocket531408);
			}
		}
	}
	goto LA4;
	LA3: ;
	{
		printf("%s%s\012", ((NimStringDesc*) &TMP5292)? (((NimStringDesc*) &TMP5292))->data:"nil", typ? (typ)->data:"nil");
		fflush(stdout);
		msgquit_184152(((NI8) 1));
	}
	LA4: ;
}
コード例 #13
0
ファイル: service.c プロジェクト: reactormonk/csources
N_NIMCALL(void, serve_525292)(TY525294 action) {
	NimStringDesc* typ;
	nimfr("serve", "service.nim")
	nimln(74, "service.nim");
	typ = getconfigvar_137311(((NimStringDesc*) &TMP7646));
	nimln(75, "service.nim");
	if (eqStrings(typ, ((NimStringDesc*) &TMP7647))) goto LA1;
	if (eqStrings(typ, ((NimStringDesc*) &TMP7648))) goto LA2;
	if (eqStrings(typ, ((NimStringDesc*) &TMP7639))) goto LA2;
	goto LA3;
	LA1: ;
	{
		nimln(77, "service.nim");
		while (1) {
			NimStringDesc* line;
			NimStringDesc* LOC11;
			nimln(78, "service.nim");
			nimln(78, "service.nim");
			line = readline_10484(stdin);
			nimln(79, "service.nim");
			{
				nimln(79, "service.nim");
				if (!eqStrings(line, ((NimStringDesc*) &TMP7649))) goto LA9;
				nimln(79, "service.nim");
				exit(0);
			}
			LA9: ;
			nimln(67, "service.nim");
			LOC11 = 0;
			LOC11 = curcaascmd_525203; curcaascmd_525203 = copyStringRC1(line);
			if (LOC11) nimGCunrefNoCycle(LOC11);
			nimln(68, "service.nim");
			processcmdline_525207(((NU8) 1), line);
			nimln(69, "service.nim");
			action();
			nimln(70, "service.nim");
			gdirtybufferidx_137127 = ((NI32) 0);
			nimln(71, "service.nim");
			gdirtyoriginalidx_137128 = ((NI32) 0);
			nimln(72, "service.nim");
			gerrorcounter_164182 = 0;
			nimln(81, "service.nim");
			printf("%s\012", (((NimStringDesc*) &TMP7639))->data);
			nimln(82, "service.nim");
			fflush(stdout);
		}
	}
	goto LA4;
	LA2: ;
	{
		tsocketimpl150605* server;
		NimStringDesc* p;
		NU16 port;
		NimStringDesc* LOC24;
		NimStringDesc* inp;
		nimln(86, "service.nim");
		server = socket_151402(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE);
		nimln(87, "service.nim");
		{
			NI32 LOC17;
			nimln(87, "service.nim");
			if (!(server == invalidsocket_150678)) goto LA15;
			nimln(87, "service.nim");
			nimln(87, "service.nim");
			LOC17 = 0;
			LOC17 = oslasterror_107231();
			oserror_107205(LOC17);
		}
		LA15: ;
		nimln(88, "service.nim");
		p = getconfigvar_137311(((NimStringDesc*) &TMP7654));
		nimln(89, "service.nim");
		nimln(89, "service.nim");
		{
			NI LOC22;
			nimln(89, "service.nim");
			nimln(89, "service.nim");
			if (!(0 < p->Sup.len)) goto LA20;
			nimln(89, "service.nim");
			LOC22 = 0;
			LOC22 = nsuParseInt(p);
			port = ((NU16) (LOC22));
		}
		goto LA18;
		LA20: ;
		{
			port = ((NU16) 6000);
		}
		LA18: ;
		nimln(90, "service.nim");
		nimln(90, "service.nim");
		LOC24 = 0;
		LOC24 = getconfigvar_137311(((NimStringDesc*) &TMP7655));
		bindaddr_152584(server, port, LOC24);
		nimln(91, "service.nim");
		inp = copyString(((NimStringDesc*) &TMP7639));
		nimln(92, "service.nim");
		listen_152405(server, SOMAXCONN);
		nimln(93, "service.nim");
		if (stdoutsocket_164192) nimGCunrefNoCycle(stdoutsocket_164192);
		stdoutsocket_164192 = (tsocketimpl150605*) newObjRC1((&NTI150607), sizeof(tsocketimpl150605));
		nimln(94, "service.nim");
		while (1) {
			NimStringDesc* LOC26;
			nimln(95, "service.nim");
			accept_154201(server, &stdoutsocket_164192);
			nimln(96, "service.nim");
			readline_159033(stdoutsocket_164192, &inp, -1);
			nimln(67, "service.nim");
			LOC26 = 0;
			LOC26 = curcaascmd_525203; curcaascmd_525203 = copyStringRC1(inp);
			if (LOC26) nimGCunrefNoCycle(LOC26);
			nimln(68, "service.nim");
			processcmdline_525207(((NU8) 1), inp);
			nimln(69, "service.nim");
			action();
			nimln(70, "service.nim");
			gdirtybufferidx_137127 = ((NI32) 0);
			nimln(71, "service.nim");
			gdirtyoriginalidx_137128 = ((NI32) 0);
			nimln(72, "service.nim");
			gerrorcounter_164182 = 0;
			nimln(98, "service.nim");
			send_160604(stdoutsocket_164192, ((NimStringDesc*) &TMP7681));
			nimln(99, "service.nim");
			close_154266(stdoutsocket_164192);
		}
	}
	goto LA4;
	LA3: ;
	{
		nimln(103, "service.nim");
		printf("%s%s\012", (((NimStringDesc*) &TMP7682))->data, (typ)->data);
		nimln(104, "service.nim");
		exit(1);
	}
	LA4: ;
	popFrame();
}
コード例 #14
0
N_NIMCALL(void, serve_418277)(TY418279 action) {
	NimStringDesc* typ;
	nimfr("serve", "service.nim")
	nimln(74, "service.nim");
	typ = getconfigvar_114292(((NimStringDesc*) &TMP7044));
	nimln(75, "service.nim");
	if (eqStrings(typ, ((NimStringDesc*) &TMP7045))) goto LA1;
	if (eqStrings(typ, ((NimStringDesc*) &TMP7046))) goto LA2;
	if (eqStrings(typ, ((NimStringDesc*) &TMP7037))) goto LA2;
	goto LA3;
	LA1: ;
	{
		nimln(77, "service.nim");
		while (1) {
			NimStringDesc* line;
			NimStringDesc* LOC11;
			nimln(78, "service.nim");
			nimln(78, "service.nim");
			line = readline_9480(stdin);
			nimln(79, "service.nim");
			{
				nimln(79, "service.nim");
				if (!eqStrings(line, ((NimStringDesc*) &TMP7047))) goto LA9;
				nimln(79, "service.nim");
				exit(0);			}			LA9: ;
			nimln(67, "service.nim");
			LOC11 = 0;
			LOC11 = curcaascmd_418203; curcaascmd_418203 = copyStringRC1(line);
			if (LOC11) nimGCunrefNoCycle(LOC11);
			nimln(68, "service.nim");
			processcmdline_418207(((NU8) 1), line);			nimln(69, "service.nim");
			action();			nimln(70, "service.nim");
			gdirtybufferidx_114124 = ((NI32) 0);
			nimln(71, "service.nim");
			gdirtyoriginalidx_114125 = ((NI32) 0);
			nimln(72, "service.nim");
			gerrorcounter_137071 = 0;
			nimln(81, "service.nim");
			printf("%s\012", (((NimStringDesc*) &TMP7037))->data);
			nimln(82, "service.nim");
			fflush(stdout);		}	}	goto LA4;
	LA2: ;
	{
		tsocketimpl124605* server;
		NimStringDesc* p;
		NU16 port;
		NimStringDesc* LOC19;
		NimStringDesc* inp;
		nimln(86, "service.nim");
		server = socket_125402(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE);
		nimln(87, "service.nim");
		p = getconfigvar_114292(((NimStringDesc*) &TMP7052));
		nimln(88, "service.nim");
		nimln(88, "service.nim");
		{
			NI LOC17;
			nimln(706, "system.nim");
			nimln(88, "service.nim");
			if (!(0 < p->Sup.len)) goto LA15;
			nimln(88, "service.nim");
			LOC17 = 0;
			LOC17 = nsuParseInt(p);
			port = ((NU16) (LOC17));
		}		goto LA13;
		LA15: ;
		{
			port = ((NU16) 6000);
		}		LA13: ;
		nimln(89, "service.nim");
		nimln(89, "service.nim");
		LOC19 = 0;
		LOC19 = getconfigvar_114292(((NimStringDesc*) &TMP7053));
		bindaddr_126534(server, port, LOC19);		nimln(90, "service.nim");
		inp = copyString(((NimStringDesc*) &TMP7037));
		nimln(91, "service.nim");
		listen_126405(server, SOMAXCONN);		nimln(92, "service.nim");
		if (stdoutsocket_137081) nimGCunrefNoCycle(stdoutsocket_137081);
		stdoutsocket_137081 = (tsocketimpl124605*) newObjRC1((&NTI124607), sizeof(tsocketimpl124605));
		nimln(93, "service.nim");
		while (1) {
			NimStringDesc* LOC21;
			nimln(94, "service.nim");
			accept_128201(server, &stdoutsocket_137081);			nimln(95, "service.nim");
			readline_132630(stdoutsocket_137081, &inp, -1);			nimln(67, "service.nim");
			LOC21 = 0;
			LOC21 = curcaascmd_418203; curcaascmd_418203 = copyStringRC1(inp);
			if (LOC21) nimGCunrefNoCycle(LOC21);
			nimln(68, "service.nim");
			processcmdline_418207(((NU8) 1), inp);			nimln(69, "service.nim");
			action();			nimln(70, "service.nim");
			gdirtybufferidx_114124 = ((NI32) 0);
			nimln(71, "service.nim");
			gdirtyoriginalidx_114125 = ((NI32) 0);
			nimln(72, "service.nim");
			gerrorcounter_137071 = 0;
			nimln(97, "service.nim");
			send_134204(stdoutsocket_137081, ((NimStringDesc*) &TMP7078));			nimln(98, "service.nim");
			close_128258(stdoutsocket_137081);		}	}	goto LA4;
	LA3: ;
	{
		nimln(102, "service.nim");
		printf("%s%s\012", (((NimStringDesc*) &TMP7079))->data, (typ)->data);
		nimln(103, "service.nim");
		exit(1);	}	LA4: ;
	popFrame();
}N_NOINLINE(void, compilerserviceInit)(void) {
コード例 #15
0
N_NIMCALL(void, serve_593236_3526807654)(TY593238 action0) {
	TY593421* HEX3Aenv_593426_3526807654;
	NimStringDesc* typ0;
	HEX3Aenv_593426_3526807654 = (TY593421*)0;
	HEX3Aenv_593426_3526807654 = (TY593421*) newObj((&NTI593420), sizeof(TY593421));
	typ0 = getconfigvar_170292_2607990831(((NimStringDesc*) &T3526807654_10));
	if (eqStrings(typ0, ((NimStringDesc*) &T3526807654_11))) goto LA1;
	if (eqStrings(typ0, ((NimStringDesc*) &T3526807654_12))) goto LA2;
	if (eqStrings(typ0, ((NimStringDesc*) &T3526807654_3))) goto LA2;
	goto LA3;
	LA1: ;
	{
		{
			while (1) {
				NimStringDesc* line0;
				NimStringDesc* LOC12;
				line0 = readline_14912_1689653243(stdin);
				{
					if (!eqStrings(line0, ((NimStringDesc*) &T3526807654_13))) goto LA10;
					exit(((NI) 0));
				}
				LA10: ;
				LOC12 = (NimStringDesc*)0;
				LOC12 = curcaascmd_593201_3526807654; curcaascmd_593201_3526807654 = copyStringRC1(line0);
				if (LOC12) nimGCunrefNoCycle(LOC12);
				processcmdline_593203_3526807654(((Tcmdlinepass281008) 1), line0);
				action0();
				gerrorcounter_193069_155036129 = ((NI) 0);
				printf("%s\012", ((NimStringDesc*) &T3526807654_3)? (((NimStringDesc*) &T3526807654_3))->data:"nil");
				fflush(stdout);
				flushfile_14862_1689653243(stdout);
			}
		}
	}
	goto LA4;
	LA2: ;
	{
		Socketimpl584406* server0;
		NimStringDesc* p0;
		NU16 port0;
		NimStringDesc* LOC20;
		NimStringDesc* inp0;
		TY193104 LOC21;
		server0 = newsocket_585009_170061329(((Domain578604) 2), ((Socktype578606) 1), ((Protocol578608) 6), NIM_TRUE);
		p0 = getconfigvar_170292_2607990831(((NimStringDesc*) &T3526807654_14));
		{
			NI LOC18;
			if (!(((NI) 0) < (p0 ? p0->Sup.len : 0))) goto LA16;
			LOC18 = (NI)0;
			LOC18 = nsuParseInt(p0);
			port0 = ((NU16) (LOC18));
		}
		goto LA14;
		LA16: ;
		{
			port0 = ((NU16) 6000);
		}
		LA14: ;
		LOC20 = (NimStringDesc*)0;
		LOC20 = getconfigvar_170292_2607990831(((NimStringDesc*) &T3526807654_15));
		bindaddr_585808_170061329(server0, port0, LOC20);
		inp0 = copyString(((NimStringDesc*) &T3526807654_3));
		listen_585804_170061329(server0, SOMAXCONN);
		asgnRefNoCycle((void**) (&(*HEX3Aenv_593426_3526807654).stdoutsocket593408), newsocket_585009_170061329(((Domain578604) 2), ((Socktype578606) 1), ((Protocol578608) 6), NIM_TRUE));
		memset((void*)(&LOC21), 0, sizeof(LOC21));
		LOC21.ClPrc = HEX3Aanonymous_593409_3526807654; LOC21.ClEnv = HEX3Aenv_593426_3526807654;
		asgnRef((void**) (&writelnhook_193107_155036129.ClEnv), LOC21.ClEnv);
		writelnhook_193107_155036129.ClPrc = LOC21.ClPrc;
		{
			while (1) {
				NimStringDesc* LOC24;
				accept_586601_170061329(server0, &(*HEX3Aenv_593426_3526807654).stdoutsocket593408, 2);
				readline_589402_170061329((*HEX3Aenv_593426_3526807654).stdoutsocket593408, (&inp0), ((NI) -1), 2, ((NI) 1000000));
				LOC24 = (NimStringDesc*)0;
				LOC24 = curcaascmd_593201_3526807654; curcaascmd_593201_3526807654 = copyStringRC1(inp0);
				if (LOC24) nimGCunrefNoCycle(LOC24);
				processcmdline_593203_3526807654(((Tcmdlinepass281008) 1), inp0);
				action0();
				gerrorcounter_193069_155036129 = ((NI) 0);
				send_590002_170061329((*HEX3Aenv_593426_3526807654).stdoutsocket593408, ((NimStringDesc*) &T3526807654_16), 2);
				close_586611_170061329((*HEX3Aenv_593426_3526807654).stdoutsocket593408);
			}
		}
	}
	goto LA4;
	LA3: ;
	{
		printf("%s%s\012", ((NimStringDesc*) &T3526807654_17)? (((NimStringDesc*) &T3526807654_17))->data:"nil", typ0? (typ0)->data:"nil");
		fflush(stdout);
		msgquit_193146_155036129(((NI8) 1));
	}
	LA4: ;
}
コード例 #16
0
ファイル: compiler_service.c プロジェクト: jlp765/csources
N_NIMCALL(void, serve_521257)(TY521259 action) {
	TY521428* HEX3Aenv_521449;
	NimStringDesc* typ;
	HEX3Aenv_521449 = 0;
	HEX3Aenv_521449 = (TY521428*) newObj((&NTI521450), sizeof(TY521428));
	typ = getconfigvar_153340(((NimStringDesc*) &TMP4988));
	if (eqStrings(typ, ((NimStringDesc*) &TMP4989))) goto LA1;
	if (eqStrings(typ, ((NimStringDesc*) &TMP4990))) goto LA2;
	if (eqStrings(typ, ((NimStringDesc*) &TMP1075))) goto LA2;
	goto LA3;
	LA1: ;
	{
		{
			while (1) {
				NimStringDesc* line;
				NimStringDesc* LOC12;
				line = readline_13478(stdin);
				{
					if (!eqStrings(line, ((NimStringDesc*) &TMP4992))) goto LA10;
					exit(((NI) 0));
				}
				LA10: ;
				LOC12 = 0;
				LOC12 = curcaascmd_521204; curcaascmd_521204 = copyStringRC1(line);
				if (LOC12) nimGCunrefNoCycle(LOC12);
				processcmdline_521209(((NU8) 1), line);
				action();
				gerrorcounter_163016 = ((NI) 0);
				printf("%s\012", ((NimStringDesc*) &TMP1075)? (((NimStringDesc*) &TMP1075))->data:"nil");
				fflush(stdout);
			}
		}
	}
	goto LA4;
	LA2: ;
	{
		Socketimpl513407* server;
		NimStringDesc* p;
		NU16 port;
		NimStringDesc* LOC20;
		NimStringDesc* inp;
		TY163060 LOC21;
		server = newsocket_513830(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE);
		p = getconfigvar_153340(((NimStringDesc*) &TMP4993));
		{
			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: ;
		LOC20 = 0;
		LOC20 = getconfigvar_153340(((NimStringDesc*) &TMP4994));
		bindaddr_514620(server, port, LOC20);
		inp = copyString(((NimStringDesc*) &TMP1075));
		listen_514610(server, SOMAXCONN);
		asgnRefNoCycle((void**) (&(*HEX3Aenv_521449).stdoutsocket521408), newsocket_513830(((NU8) 2), ((NU8) 1), ((NU8) 6), NIM_TRUE));
		memset((void*)(&LOC21), 0, sizeof(LOC21));
		LOC21.ClPrc = HEX3Aanonymous_521409; LOC21.ClEnv = HEX3Aenv_521449;
		asgnRef((void**) (&writelnhook_163063.ClEnv), LOC21.ClEnv);
		writelnhook_163063.ClPrc = LOC21.ClPrc;
		{
			while (1) {
				NimStringDesc* LOC24;
				accept_515401(server, &(*HEX3Aenv_521449).stdoutsocket521408, 2);
				readline_517608((*HEX3Aenv_521449).stdoutsocket521408, (&inp), ((NI) -1), 2);
				LOC24 = 0;
				LOC24 = curcaascmd_521204; curcaascmd_521204 = copyStringRC1(inp);
				if (LOC24) nimGCunrefNoCycle(LOC24);
				processcmdline_521209(((NU8) 1), inp);
				action();
				gerrorcounter_163016 = ((NI) 0);
				send_518208((*HEX3Aenv_521449).stdoutsocket521408, ((NimStringDesc*) &TMP4997), 2);
				close_515417((*HEX3Aenv_521449).stdoutsocket521408);
			}
		}
	}
	goto LA4;
	LA3: ;
	{
		printf("%s%s\012", ((NimStringDesc*) &TMP5006)? (((NimStringDesc*) &TMP5006))->data:"nil", typ? (typ)->data:"nil");
		msgquit_163112(((NI8) 1));
	}
	LA4: ;
}