示例#1
0
N_NIMCALL(NimStringDesc*, renderparamtypes_339658)(Tnode191813* n, NimStringDesc* sep) {
	NimStringDesc* result;
	TY121008* found;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP4801));
	found = (TY121008*) newSeq((&NTI121008), 0);
	renderparamtypes_339275((&found), n);
	{
		if (!(((NI) 0) < (found ? found->Sup.len : 0))) goto LA3;
		result = nsuJoinSep(found->data, found->Sup.len, sep);
	}
	LA3: ;
	return result;
}
示例#2
0
N_NIMCALL(NimStringDesc*, renderparamtypes_le9bedpmveKS6qhiVCc9c7cg)(Tnode_bROa11lyF5vxEN9aYNbHmhw* n0, NimStringDesc* sep0) {
	NimStringDesc* result0;
	TY_sM4lkSb7zS6F7OVMvW9cffQ* found0;
	result0 = (NimStringDesc*)0;
	result0 = copyString(((NimStringDesc*) &T_SgHDIVcSir4dkKoe0Xsi0A_2));
	found0 = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ), 0);
	renderparamtypes_nsr8uxcmlhx5QS6xeTtlLA((&found0), n0);
	{
		if (!(((NI) 0) < (found0 ? found0->Sup.len : 0))) goto LA3;
		result0 = nsuJoinSep(found0->data, found0->Sup.len, sep0);
	}
	LA3: ;
	return result0;
}
示例#3
0
N_NIMCALL(NimStringDesc*, renderparamtypes_359634)(Tnode215790* n, NimStringDesc* sep) {
	NimStringDesc* result;
	TY125202* found;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP5076));
	found = (TY125202*) newSeq((&NTI125202), 0);
	renderparamtypes_359233((&found), n);
	{
		if (!(((NI) 0) < (found ? found->Sup.len : 0))) goto LA3;
		result = nsuJoinSep(found->data, found->Sup.len, sep);
	}
	LA3: ;
	return result;
}
N_NIMCALL(NimStringDesc*, renderparamtypes_416471_117375469)(Tnode294802* n0, NimStringDesc* sep0) {
	NimStringDesc* result0;
	TY136002* found0;
	result0 = (NimStringDesc*)0;
	result0 = copyString(((NimStringDesc*) &T117375469_2));
	found0 = (TY136002*) newSeq((&NTI136002), 0);
	renderparamtypes_416233_117375469((&found0), n0);
	{
		if (!(((NI) 0) < (found0 ? found0->Sup.len : 0))) goto LA3;
		result0 = nsuJoinSep(found0->data, found0->Sup.len, sep0);
	}
	LA3: ;
	return result0;
}
示例#5
0
N_NIMCALL(NimStringDesc*, renderparamtypes_345847)(tnode192813* n, NimStringDesc* sep) {
	NimStringDesc* result;
	TY10865* found;
	nimfr("renderParamTypes", "typesrenderer.nim")
	result = 0;
	nimln(107, "typesrenderer.nim");
	result = copyString(((NimStringDesc*) &TMP4773));
	nimln(108, "typesrenderer.nim");
	found = (TY10865*) newSeq((&NTI10865), 0);
	nimln(109, "typesrenderer.nim");
	renderparamtypes_345423(&found, n);
	nimln(110, "typesrenderer.nim");
	{
		nimln(110, "typesrenderer.nim");
		nimln(110, "typesrenderer.nim");
		if (!(0 < found->Sup.len)) goto LA3;
		nimln(111, "typesrenderer.nim");
		result = nsuJoinSep(found->data, found->Sup.len, sep);
	}
	LA3: ;
	popFrame();
	return result;
}
示例#6
0
文件: osproc.c 项目: ddlsmurf/Nimrod
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;
}
示例#7
0
N_NIMCALL(Processobj143402*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingdir, NimStringDesc** args, NI argsLen0, Stringtableobj134012* env, NU8 options) {
	Processobj143402* result;
	TY145025 pstdin;
	TY145025 pstdout;
	TY145025 pstderr;
	NimStringDesc* syscommand;
	TY122208* sysargsraw;
	pid_t volatile pid;
	NCSTRING* sysargs;
	TSafePoint TMP2889;
	result = 0;
	memset((void*)pstdin, 0, sizeof(pstdin));
	memset((void*)pstdout, 0, sizeof(pstdout));
	memset((void*)pstderr, 0, sizeof(pstderr));
	result = (Processobj143402*) newObj((&NTI143404), sizeof(Processobj143402));
	(*result).Sup.m_type = (&NTI143402);
	(*result).exitcode = ((int) -3);
	{
		if (!!(((options &(1<<((((NU8) 4))&7)))!=0))) goto LA3;
		{
			NIM_BOOL LOC7;
			NIM_BOOL LOC8;
			int LOC9;
			int LOC11;
			int LOC13;
			NI32 LOC16;
			LOC7 = 0;
			LOC8 = 0;
			LOC9 = 0;
			LOC9 = pipe(pstdin);
			LOC8 = !((LOC9 == ((NI32) 0)));
			if (LOC8) goto LA10;
			LOC11 = 0;
			LOC11 = pipe(pstdout);
			LOC8 = !((LOC11 == ((NI32) 0)));
			LA10: ;
			LOC7 = LOC8;
			if (LOC7) goto LA12;
			LOC13 = 0;
			LOC13 = pipe(pstderr);
			LOC7 = !((LOC13 == ((NI32) 0)));
			LA12: ;
			if (!LOC7) goto LA14;
			LOC16 = 0;
			LOC16 = oslasterror_117033();
			raiseoserror_117009(LOC16);
		}
		LA14: ;
	}
	LA3: ;
	syscommand = 0;
	sysargsraw = 0;
	{
		TY176063 LOC21;
		NimStringDesc* LOC22;
		NimStringDesc* LOC23;
		NimStringDesc* LOC24;
		if (!((options &(1<<((((NU8) 2))&7)))!=0)) goto LA19;
		syscommand = copyString(((NimStringDesc*) &TMP2887));
		sysargsraw = (TY122208*) newSeq((&NTI122208), 3);
		memset((void*)LOC21, 0, sizeof(LOC21));
		LOC21[0] = copyString(syscommand);
		LOC21[1] = copyString(((NimStringDesc*) &TMP2888));
		LOC21[2] = copyString(command);
		LOC22 = 0;
		LOC22 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC21[0]);
		if (LOC22) nimGCunrefNoCycle(LOC22);
		LOC23 = 0;
		LOC23 = sysargsraw->data[1]; sysargsraw->data[1] = copyStringRC1(LOC21[1]);
		if (LOC23) nimGCunrefNoCycle(LOC23);
		LOC24 = 0;
		LOC24 = sysargsraw->data[2]; sysargsraw->data[2] = copyStringRC1(LOC21[2]);
		if (LOC24) nimGCunrefNoCycle(LOC24);
	}
	goto LA17;
	LA19: ;
	{
		TY164580 LOC26;
		NimStringDesc* LOC27;
		syscommand = copyString(command);
		sysargsraw = (TY122208*) newSeq((&NTI122208), 1);
		memset((void*)LOC26, 0, sizeof(LOC26));
		LOC26[0] = copyString(command);
		LOC27 = 0;
		LOC27 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC26[0]);
		if (LOC27) nimGCunrefNoCycle(LOC27);
		{
			NimStringDesc* arg_145224;
			NI i_145481;
			arg_145224 = 0;
			i_145481 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC31;
					if (!(i_145481 < argsLen0)) goto LA30;
					arg_145224 = args[i_145481];
					sysargsraw = (TY122208*) incrSeq(&(sysargsraw)->Sup, sizeof(NimStringDesc*));
					LOC31 = 0;
					LOC31 = sysargsraw->data[sysargsraw->Sup.len-1]; sysargsraw->data[sysargsraw->Sup.len-1] = copyStringRC1(arg_145224);
					if (LOC31) nimGCunrefNoCycle(LOC31);
					i_145481 += ((NI) 1);
				} LA30: ;
			}
		}
	}
	LA17: ;
	pid = 0;
	sysargs = alloccstringarray_14201(sysargsraw->data, sysargsraw->Sup.len);
	pushSafePoint(&TMP2889);
	TMP2889.status = _setjmp(TMP2889.context);
	if (TMP2889.status == 0) {
		NCSTRING* sysenv;
		TSafePoint TMP2891;
		{
			if (!(env == NIM_NIL)) goto LA35;
			sysenv = envtocstringarray_144854();
		}
		goto LA33;
		LA35: ;
		{
			sysenv = envtocstringarray_144806(env);
		}
		LA33: ;
		pushSafePoint(&TMP2891);
		TMP2891.status = _setjmp(TMP2891.context);
		if (TMP2891.status == 0) {
			Tstartprocessdata144948 data;
			memset((void*)(&data), 0, sizeof(data));
			data.syscommand = syscommand->data;
			data.sysargs = sysargs;
			data.sysenv = sysenv;
			memcpy((void*)data.pstdin, (NIM_CONST void*)pstdin, sizeof(data.pstdin));
			memcpy((void*)data.pstdout, (NIM_CONST void*)pstdout, sizeof(data.pstdout));
			memcpy((void*)data.pstderr, (NIM_CONST void*)pstderr, sizeof(data.pstderr));
			data.optionpoparentstreams = ((options &(1<<((((NU8) 4))&7)))!=0);
			data.optionpousepath = ((options &(1<<((((NU8) 1))&7)))!=0);
			data.optionpostderrtostdout = ((options &(1<<((((NU8) 3))&7)))!=0);
			data.workingdir = workingdir->data;
			pid = startprocessauxspawn_145001((&data));
			{
				NimStringDesc* LOC43;
				if (!((options &(1<<((((NU8) 0))&7)))!=0)) goto LA41;
				LOC43 = 0;
				LOC43 = nsuJoinSep(args, argsLen0, ((NimStringDesc*) &TMP2892));
				printf("%s%s%s\012", command? (command)->data:"nil", ((NimStringDesc*) &TMP2892)? (((NimStringDesc*) &TMP2892))->data:"nil", LOC43? (LOC43)->data:"nil");
			}
			LA41: ;
			(*result).id = pid;
			{
				if (!((options &(1<<((((NU8) 4))&7)))!=0)) goto LA46;
				(*result).inhandle = ((int) 0);
				(*result).outhandle = ((int) 1);
				{
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA50;
					(*result).errhandle = (*result).outhandle;
				}
				goto LA48;
				LA50: ;
				{
					(*result).errhandle = ((int) 2);
				}
				LA48: ;
			}
			goto LA44;
			LA46: ;
			{
				int LOC60;
				int LOC61;
				int LOC62;
				(*result).inhandle = pstdin[(((NI) 1))- 0];
				(*result).outhandle = pstdout[(((NI) 0))- 0];
				{
					int LOC58;
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA56;
					(*result).errhandle = (*result).outhandle;
					LOC58 = 0;
					LOC58 = close(pstderr[(((NI) 0))- 0]);
				}
				goto LA54;
				LA56: ;
				{
					(*result).errhandle = pstderr[(((NI) 0))- 0];
				}
				LA54: ;
				LOC60 = 0;
				LOC60 = close(pstderr[(((NI) 1))- 0]);
				LOC61 = 0;
				LOC61 = close(pstdin[(((NI) 0))- 0]);
				LOC62 = 0;
				LOC62 = close(pstdout[(((NI) 1))- 0]);
			}
			LA44: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			dealloccstringarray_14450(sysenv);
		}
		if (TMP2891.status != 0) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		dealloccstringarray_14450(sysargs);
	}
	if (TMP2889.status != 0) reraiseException();
	return result;
}