예제 #1
0
N_NIMCALL(void, getservbyport_511233)(NU16 port, NimStringDesc* proto, Servent509610* Result) {
	struct servent* s;
	nimfr("getServByPort", "rawsockets.nim")
	nimln(261, "rawsockets.nim");
	s = getservbyport(((int) (((NI)(NU)(NU16)(((NI16)chckRange(port, ((NI16) -32768), ((NI16) 32767))))))), proto->data);
	nimln(262, "rawsockets.nim");
	{
		Oserror3433* e_511416;
		NimStringDesc* LOC5;
		if (!(s == NIM_NIL)) goto LA3;
		e_511416 = 0;
		nimln(2265, "system.nim");
		e_511416 = (Oserror3433*) newObj((&NTI116812), sizeof(Oserror3433));
		(*e_511416).Sup.Sup.Sup.m_type = (&NTI3433);
		nimln(2266, "system.nim");
		LOC5 = 0;
		LOC5 = (*e_511416).Sup.Sup.message; (*e_511416).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TMP10617));
		if (LOC5) nimGCunrefNoCycle(LOC5);
		nimln(262, "rawsockets.nim");
		raiseException((Exception*)e_511416, "OSError");
	}
	LA3: ;
	nimln(263, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).name), cstrToNimstr((*s).s_name));
	nimln(264, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).aliases), cstringarraytoseq_13843((*s).s_aliases));
	nimln(265, "rawsockets.nim");
	(*Result).port = ((NU16) ((*s).s_port));
	nimln(266, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).proto), cstrToNimstr((*s).s_proto));
	popFrame();
}
예제 #2
0
N_NIMCALL(void, getservbyname_511027)(NimStringDesc* name, NimStringDesc* proto, Servent509610* Result) {
	struct servent* s;
	nimfr("getServByName", "rawsockets.nim")
	nimln(245, "rawsockets.nim");
	s = getservbyname(name->data, proto->data);
	nimln(246, "rawsockets.nim");
	{
		Oserror3433* e_511216;
		NimStringDesc* LOC5;
		if (!(s == NIM_NIL)) goto LA3;
		e_511216 = 0;
		nimln(2265, "system.nim");
		e_511216 = (Oserror3433*) newObj((&NTI116812), sizeof(Oserror3433));
		(*e_511216).Sup.Sup.Sup.m_type = (&NTI3433);
		nimln(2266, "system.nim");
		LOC5 = 0;
		LOC5 = (*e_511216).Sup.Sup.message; (*e_511216).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TMP10617));
		if (LOC5) nimGCunrefNoCycle(LOC5);
		nimln(246, "rawsockets.nim");
		raiseException((Exception*)e_511216, "OSError");
	}
	LA3: ;
	nimln(247, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).name), cstrToNimstr((*s).s_name));
	nimln(248, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).aliases), cstringarraytoseq_13843((*s).s_aliases));
	nimln(249, "rawsockets.nim");
	(*Result).port = ((NU16) ((*s).s_port));
	nimln(250, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).proto), cstrToNimstr((*s).s_proto));
	popFrame();
}
예제 #3
0
N_NIMCALL(void, gettzname_107546)(Keyvaluepair136008* Result) {
    {   unsureAsgnRef((void**) (&(*Result).Field0), cstrToNimstr(tzname[(((NI) 0))- 0]));
        unsureAsgnRef((void**) (&(*Result).Field1), cstrToNimstr(tzname[(((NI) 1))- 0]));
        goto BeforeRet;
    }
BeforeRet:
    ;
}
예제 #4
0
N_NIMCALL(NimStringDesc*, getenumfield_213235_1760177012)(Any203101 x0, NI ordinalvalue0) {
	NimStringDesc* result0;
	TNimType* typ0;
	NI e0;
{	result0 = (NimStringDesc*)0;
	typ0 = skiprange_204802_1760177012(((TNimType*) (x0.rawtypeptr)));
	e0 = ordinalvalue0;
	{
		if (!!((((*typ0).flags &(1U<<((NU)(((Tnimtypeflag203009) 2))&7U)))!=0))) goto LA3;
		{
			if (!((NU32)(e0) < (NU32)((*(*typ0).node).len))) goto LA7;
			result0 = cstrToNimstr((*(*(*typ0).node).sons[(e0)- 0]).name);
			goto BeforeRet;
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		TNimNode* n0;
		TNimNode** s0;
		n0 = (*typ0).node;
		s0 = (*n0).sons;
		{
			NI i_213432_1760177012;
			NI HEX3Atmp_213435_1760177012;
			NI res_213438_1760177012;
			i_213432_1760177012 = (NI)0;
			HEX3Atmp_213435_1760177012 = (NI)0;
			HEX3Atmp_213435_1760177012 = (NI)((*n0).len - ((NI) 1));
			res_213438_1760177012 = ((NI) 0);
			{
				while (1) {
					if (!(res_213438_1760177012 <= HEX3Atmp_213435_1760177012)) goto LA12;
					i_213432_1760177012 = res_213438_1760177012;
					{
						if (!((*s0[(i_213432_1760177012)- 0]).offset == e0)) goto LA15;
						result0 = cstrToNimstr((*s0[(i_213432_1760177012)- 0]).name);
						goto BeforeRet;
					}
					LA15: ;
					res_213438_1760177012 += ((NI) 1);
				} LA12: ;
			}
		}
	}
	LA1: ;
	result0 = nimIntToStr(e0);
	}BeforeRet: ;
	return result0;
}
예제 #5
0
N_NIMCALL(void, acceptaddr_514813)(Socketimpl513407* server, Socketimpl513407** client, NimStringDesc** address, NU8 flags) {
	struct sockaddr_in sockaddress;
	socklen_t addrlen;
	int sock;
	memset((void*)(&sockaddress), 0, sizeof(sockaddress));
	addrlen = ((socklen_t) (((NI)sizeof(struct sockaddr_in))));
	sock = accept((*server).fd, ((struct sockaddr*) ((&sockaddress))), (&addrlen));
	{
		NI32 err;
		if (!(sock == osinvalidsocket_508651)) goto LA3;
		err = oslasterror_115833();
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = isdisconnectionerror_513481(flags, err);
			if (!LOC7) goto LA8;
			acceptaddr_514813(server, client, address, flags);
		}
		LA8: ;
		raiseoserror_115809(err);
	}
	goto LA1;
	LA3: ;
	{
		NCSTRING LOC11;
		(*(*client)).fd = sock;
		(*(*client)).isbuffered = (*server).isbuffered;
		LOC11 = 0;
		LOC11 = inet_ntoa(sockaddress.sin_addr);
		unsureAsgnRef((void**) (&(*address)), cstrToNimstr(LOC11));
	}
	LA1: ;
}
예제 #6
0
파일: stdlib_os.c 프로젝트: apense/csources
N_NIMCALL(NimStringDesc*, paramstr_124809)(NI i) {
	NimStringDesc* result;
	Indexerror3455* e_124815;
	NimStringDesc* LOC7;
{	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (i < ((NI) (cmdCount)));
		if (!(LOC3)) goto LA4;
		LOC3 = (((NI) 0) <= i);
		LA4: ;
		if (!LOC3) goto LA5;
		result = cstrToNimstr(cmdLine[(i)- 0]);
		goto BeforeRet;
	}
	LA5: ;
	e_124815 = 0;
	e_124815 = (Indexerror3455*) newObj((&NTI124816), sizeof(Indexerror3455));
	(*e_124815).Sup.Sup.m_type = (&NTI3455);
	LOC7 = 0;
	LOC7 = (*e_124815).Sup.message; (*e_124815).Sup.message = copyStringRC1(((NimStringDesc*) &TMP1146));
	if (LOC7) nimGCunrefNoCycle(LOC7);
	raiseException((Exception*)e_124815, "IndexError");
	}BeforeRet: ;
	return result;
}
예제 #7
0
파일: rodutils.c 프로젝트: ddlsmurf/Nimrod
N_NIMCALL(NimStringDesc*, Tostrmaxprecision_59011)(NF64 F_59013) {
NimStringDesc* Result_59014;
TY59015 Buf_59017;
Result_59014 = 0;
if (!!((((NF) (F_59013)) == ((NF) (F_59013))))) goto LA2;
Result_59014 = copyString(((NimStringDesc*) &TMP196458));
goto LA1;
LA2: ;
if (!(((NF) (F_59013)) == 0.0)) goto LA4;
Result_59014 = copyString(((NimStringDesc*) &TMP196459));
goto LA1;
LA4: ;
if (!(((NF) (F_59013)) == (5.0000000000000000e-01 * ((NF) (F_59013))))) goto LA6;
if (!(0.0 < ((NF) (F_59013)))) goto LA9;
Result_59014 = copyString(((NimStringDesc*) &TMP196460));
goto LA8;
LA9: ;
Result_59014 = copyString(((NimStringDesc*) &TMP196461));
LA8: ;
goto LA1;
LA6: ;
memset((void*)&Buf_59017, 0, sizeof(Buf_59017));
sprintf(((NCSTRING) (Buf_59017)), "%#.16e", F_59013);
Result_59014 = cstrToNimstr(((NCSTRING) (Buf_59017)));
LA1: ;
return Result_59014;
}
예제 #8
0
파일: stdlib_os.c 프로젝트: apense/csources
N_NIMCALL(void, getenvvarsc_121202)(void) {
	{
		NI i;
		if (!!(envcomputed_121007)) goto LA3;
		if (environment_121009) nimGCunrefNoCycle(environment_121009);
		environment_121009 = (TY121008*) newSeqRC1((&NTI121008), 0);
		i = ((NI) 0);
		{
			while (1) {
				NimStringDesc* LOC11;
				NimStringDesc* LOC12;
				{
					if (!(environ[(i)- 0] == NIM_NIL)) goto LA9;
					goto LA5;
				}
				LA9: ;
				LOC11 = 0;
				LOC11 = cstrToNimstr(environ[(i)- 0]);
				environment_121009 = (TY121008*) incrSeq(&(environment_121009)->Sup, sizeof(NimStringDesc*));
				LOC12 = 0;
				LOC12 = environment_121009->data[environment_121009->Sup.len-1]; environment_121009->data[environment_121009->Sup.len-1] = copyStringRC1(LOC11);
				if (LOC12) nimGCunrefNoCycle(LOC12);
				i += ((NI) 1);
			}
		} LA5: ;
		envcomputed_121007 = NIM_TRUE;
	}
	LA3: ;
}
예제 #9
0
파일: stdlib_os.c 프로젝트: apense/csources
N_NIMCALL(NimStringDesc*, getenv_121644)(NimStringDesc* key) {
	NimStringDesc* result;
	NI i;
{	result = 0;
	i = findenvvar_121605(key);
	{
		NI LOC5;
		if (!(((NI) 0) <= i)) goto LA3;
		LOC5 = 0;
		LOC5 = nsuFindChar(environment_121009->data[i], 61, ((NI) 0));
		result = copyStr(environment_121009->data[i], (NI)(LOC5 + ((NI) 1)));
		goto BeforeRet;
	}
	goto LA1;
	LA3: ;
	{
		NCSTRING env;
		env = getenv(key->data);
		{
			if (!(env == NIM_NIL)) goto LA9;
			result = copyString(((NimStringDesc*) &TMP136));
			goto BeforeRet;
		}
		LA9: ;
		result = cstrToNimstr(env);
	}
	LA1: ;
	}BeforeRet: ;
	return result;
}
예제 #10
0
N_NIMCALL(struct addrinfo*, getaddrinfo_510408)(NimStringDesc* address, NU16 port, NU8 af, NU8 typ, NU8 prot) {
	struct addrinfo* result;
	struct addrinfo hints;
	int gairesult;
	NimStringDesc* LOC1;
	result = 0;
	memset((void*)(&hints), 0, sizeof(hints));
	result = NIM_NIL;
	hints.ai_family = toint_509829(af);
	hints.ai_socktype = toint_509835(typ);
	hints.ai_protocol = toint_509841(prot);
	LOC1 = 0;
	LOC1 = HEX24_6401(port);
	gairesult = getaddrinfo(address->data, LOC1->data, (&hints), &result);
	{
		Oserror3433* e_510603;
		NCSTRING LOC6;
		if (!!((gairesult == ((NI32) 0)))) goto LA4;
		e_510603 = 0;
		e_510603 = (Oserror3433*) newObj((&NTI116812), sizeof(Oserror3433));
		(*e_510603).Sup.Sup.Sup.m_type = (&NTI3433);
		LOC6 = 0;
		LOC6 = gai_strerror(gairesult);
		asgnRefNoCycle((void**) (&(*e_510603).Sup.Sup.message), cstrToNimstr(LOC6));
		raiseException((Exception*)e_510603, "OSError");
	}
	LA4: ;
	return result;
}
예제 #11
0
N_NIMCALL(void, acceptaddr_525807)(Socketimpl524404* server, Socketimpl524404** client, NimStringDesc** address, NU8 flags) {
	SOCKADDR_IN sockaddress;
	unsigned int addrlen;
	NI sock;
	memset((void*)(&sockaddress), 0, sizeof(sockaddress));
	addrlen = ((unsigned int) (((NI)sizeof(SOCKADDR_IN))));
	sock = Dl_107989((*server).fd, ((SOCKADDR*) ((&sockaddress))), (&addrlen));
	{
		NI32 err;
		if (!(sock == osinvalidsocket_518645)) goto LA3;
		err = oslasterror_120040();
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = isdisconnectionerror_524473(flags, err);
			if (!LOC7) goto LA8;
			acceptaddr_525807(server, client, address, flags);
		}
		LA8: ;
		raiseoserror_120024(err, ((NimStringDesc*) &TMP5280));
	}
	goto LA1;
	LA3: ;
	{
		NCSTRING LOC11;
		(*(*client)).fd = sock;
		(*(*client)).isbuffered = (*server).isbuffered;
		LOC11 = 0;
		LOC11 = Dl_108146(sockaddress.sin_addr);
		unsureAsgnRef((void**) (&(*address)), cstrToNimstr(LOC11));
	}
	LA1: ;
}
예제 #12
0
N_NIMCALL(NimStringDesc*, tostrmaxprecision_199017)(NF f) {
	NimStringDesc* result;
	nimfr("toStrMaxPrecision", "rodutils.nim")
	result = 0;
	nimln(16, "rodutils.nim");
	{
		nimln(16, "rodutils.nim");
		nimln(16, "rodutils.nim");
		if (!!((f == f))) goto LA3;
		nimln(17, "rodutils.nim");
		result = copyString(((NimStringDesc*) &TMP2097));
	}
	goto LA1;
	LA3: ;
	{
		nimln(18, "rodutils.nim");
		if (!(f == 0.0)) goto LA6;
		nimln(19, "rodutils.nim");
		result = copyString(((NimStringDesc*) &TMP2098));
	}
	goto LA1;
	LA6: ;
	{
		nimln(20, "rodutils.nim");
		nimln(20, "rodutils.nim");
		if (!(f == ((NF)(5.0000000000000000e-001) * (NF)(f)))) goto LA9;
		nimln(21, "rodutils.nim");
		{
			nimln(21, "rodutils.nim");
			if (!(0.0 < f)) goto LA13;
			nimln(21, "rodutils.nim");
			result = copyString(((NimStringDesc*) &TMP2099));
		}
		goto LA11;
		LA13: ;
		{
			nimln(22, "rodutils.nim");
			result = copyString(((NimStringDesc*) &TMP2100));
		}
		LA11: ;
	}
	goto LA1;
	LA9: ;
	{
		TY199024 buf;
		memset((void*)buf, 0, sizeof(buf));
		nimln(25, "rodutils.nim");
		sprintf(((NCSTRING) (buf)), "%#.16e", f);
		nimln(26, "rodutils.nim");
		nimln(26, "rodutils.nim");
		result = cstrToNimstr(((NCSTRING) (buf)));
	}
	LA1: ;
	popFrame();
	return result;
}
예제 #13
0
N_NIMCALL(void, gethostbyname_511824)(NimStringDesc* name, Hostent509612* Result) {
	struct hostent* s;
	nimfr("getHostByName", "rawsockets.nim")
	nimln(302, "rawsockets.nim");
	s = gethostbyname(name->data);
	nimln(303, "rawsockets.nim");
	{
		NI32 LOC5;
		if (!(s == NIM_NIL)) goto LA3;
		LOC5 = 0;
		LOC5 = oslasterror_116833();
		raiseoserror_116809(LOC5);
	}
	LA3: ;
	nimln(304, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).name), cstrToNimstr((*s).h_name));
	nimln(305, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).aliases), cstringarraytoseq_13843((*s).h_aliases));
	nimln(309, "rawsockets.nim");
	{
		if (!((*s).h_addrtype == AF_INET)) goto LA8;
		nimln(310, "rawsockets.nim");
		(*Result).addrtype = ((NU8) 2);
	}
	goto LA6;
	LA8: ;
	{
		nimln(311, "rawsockets.nim");
		if (!((*s).h_addrtype == AF_INET6)) goto LA11;
		nimln(312, "rawsockets.nim");
		(*Result).addrtype = ((NU8) 23);
	}
	goto LA6;
	LA11: ;
	{
		Oserror3433* e_512203;
		NimStringDesc* LOC14;
		e_512203 = 0;
		nimln(2265, "system.nim");
		e_512203 = (Oserror3433*) newObj((&NTI116812), sizeof(Oserror3433));
		(*e_512203).Sup.Sup.Sup.m_type = (&NTI3433);
		nimln(2266, "system.nim");
		LOC14 = 0;
		LOC14 = (*e_512203).Sup.Sup.message; (*e_512203).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TMP10618));
		if (LOC14) nimGCunrefNoCycle(LOC14);
		nimln(314, "rawsockets.nim");
		raiseException((Exception*)e_512203, "OSError");
	}
	LA6: ;
	nimln(315, "rawsockets.nim");
	unsureAsgnRef((void**) (&(*Result).addrlist), cstringarraytoseq_13843((*s).h_addr_list));
	nimln(316, "rawsockets.nim");
	(*Result).length = ((NI) ((*s).h_length));
	popFrame();
}
예제 #14
0
파일: stdlib_os.c 프로젝트: apense/csources
N_NIMCALL(NimStringDesc*, oserrormsg_115620)(NI32 errorcode) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP136));
	{
		NCSTRING LOC5;
		if (!!((errorcode == ((NI32) 0)))) goto LA3;
		LOC5 = 0;
		LOC5 = strerror(errorcode);
		result = cstrToNimstr(LOC5);
	}
	LA3: ;
	return result;
}
예제 #15
0
파일: stdlib_os.c 프로젝트: apense/csources
N_NIMCALL(NimStringDesc*, nososErrorMsg)(void) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP136));
	{
		NCSTRING LOC5;
		if (!!((errno == ((NI32) 0)))) goto LA3;
		LOC5 = 0;
		LOC5 = strerror(errno);
		result = cstrToNimstr(LOC5);
	}
	LA3: ;
	return result;
}
예제 #16
0
N_NIMCALL(void, addpathrec_3JEODh79bt1SXwL9cUHI7lhw)(NimStringDesc* dir0, Tlineinfo_T9c3PM9bs7WZ4LIQfEici9cZw info0) {
	Stringtableobj_DKRIdH9c9cKI7YpQb9c0wKlEw* packages0;
	NI pos0;
	packages0 = nstnewStringTable(((Stringtablemode_G9c4wVDFIzf0xHmQvxso9a9cQ) 2));
	pos0 = (NI)((dir0 ? dir0->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir0->data[pos0])) == ((NU8)(47)) || ((NU8)(dir0->data[pos0])) == ((NU8)(47)))) goto LA3;
		pos0 += ((NI) 1);
	}
	LA3: ;
	{
		Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg k_KeWeZHiyBnWbJ7NUxRxrzQ;
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug;
		DIR* d_ZfFno5oDVOm9aHJ009cmNoGQ;
		k_KeWeZHiyBnWbJ7NUxRxrzQ = (Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg)0;
		p_dm2MlSSgl6QuA4g3oqnzug = (NimStringDesc*)0;
		d_ZfFno5oDVOm9aHJ009cmNoGQ = opendir(dir0->data);
		{
			TSafePoint T_asNQM9aynXXg9ccUABbReyew_2;
			if (!!((d_ZfFno5oDVOm9aHJ009cmNoGQ == NIM_NIL))) goto LA8;
			pushSafePoint(&T_asNQM9aynXXg9ccUABbReyew_2);
			T_asNQM9aynXXg9ccUABbReyew_2.status = setjmp(T_asNQM9aynXXg9ccUABbReyew_2.context);
			if (T_asNQM9aynXXg9ccUABbReyew_2.status == 0) {
				{
					while (1) {
						{
							struct dirent* x_rBzPa0W2aCO6C2N57Y0ovQ;
							NimStringDesc* volatile y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
							x_rBzPa0W2aCO6C2N57Y0ovQ = readdir(d_ZfFno5oDVOm9aHJ009cmNoGQ);
							{
								if (!(x_rBzPa0W2aCO6C2N57Y0ovQ == NIM_NIL)) goto LA16;
								goto LA11;
							}
							LA16: ;
							y_KzqyWmE69cwQ0l9c9bXwsjU9cw = cstrToNimstr(((NCSTRING) ((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_name)));
							{
								NIM_BOOL LOC20;
								struct stat s_k2PyMBHM0O7gW5niqUdMGA;
								Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg volatile k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
								LOC20 = (NIM_BOOL)0;
								LOC20 = !(eqStrings(y_KzqyWmE69cwQ0l9c9bXwsjU9cw, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_3)));
								if (!(LOC20)) goto LA21;
								LOC20 = !(eqStrings(y_KzqyWmE69cwQ0l9c9bXwsjU9cw, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_4)));
								LA21: ;
								if (!LOC20) goto LA22;
								memset((void*)(&s_k2PyMBHM0O7gW5niqUdMGA), 0, sizeof(s_k2PyMBHM0O7gW5niqUdMGA));
								{
									if (!NIM_TRUE) goto LA26;
									y_KzqyWmE69cwQ0l9c9bXwsjU9cw = HEX2F_BsTQv9c9anbxt9bKmR0aN1elQ(dir0, y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
								}
								LA26: ;
								k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 0);
								{
									if (!!(((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 0)))) goto LA30;
									{
										if (!((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 4))) goto LA34;
										k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2);
									}
									LA34: ;
									{
										if (!((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 10))) goto LA38;
										{
											NIM_BOOL LOC42;
											LOC42 = (NIM_BOOL)0;
											LOC42 = direxists_wf0Ae3eLXw0lSNEFJMV3ognimblecmd(y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
											if (!LOC42) goto LA43;
											k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 3);
										}
										goto LA40;
										LA43: ;
										{
											k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 1);
										}
										LA40: ;
									}
									LA38: ;
									k_KeWeZHiyBnWbJ7NUxRxrzQ = k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
									p_dm2MlSSgl6QuA4g3oqnzug = y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
									{
										NIM_BOOL LOC48;
										LOC48 = (NIM_BOOL)0;
										LOC48 = (k_KeWeZHiyBnWbJ7NUxRxrzQ == ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2));
										if (!(LOC48)) goto LA49;
										LOC48 = !(((NU8)(p_dm2MlSSgl6QuA4g3oqnzug->data[pos0]) == (NU8)(46)));
										LA49: ;
										if (!LOC48) goto LA50;
										addpackage_mPfTsfux8gBVeyQ8xwDYTQ(packages0, p_dm2MlSSgl6QuA4g3oqnzug);
									}
									LA50: ;
									goto LA13;
								}
								LA30: ;
								{
									int LOC54;
									LOC54 = (int)0;
									LOC54 = lstat(y_KzqyWmE69cwQ0l9c9bXwsjU9cw->data, (&s_k2PyMBHM0O7gW5niqUdMGA));
									if (!(LOC54 < ((NI32) 0))) goto LA55;
									goto LA11;
								}
								LA55: ;
								{
									NIM_BOOL LOC59;
									LOC59 = (NIM_BOOL)0;
									LOC59 = S_ISDIR(s_k2PyMBHM0O7gW5niqUdMGA.st_mode);
									if (!LOC59) goto LA60;
									k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2);
								}
								goto LA57;
								LA60: ;
								{
									NIM_BOOL LOC63;
									LOC63 = (NIM_BOOL)0;
									LOC63 = S_ISLNK(s_k2PyMBHM0O7gW5niqUdMGA.st_mode);
									if (!LOC63) goto LA64;
									k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = getsymlinkfilekind_WoXOp8qmMec1P4MyA3LBKg(y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
								}
								goto LA57;
								LA64: ;
								LA57: ;
								k_KeWeZHiyBnWbJ7NUxRxrzQ = k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
								p_dm2MlSSgl6QuA4g3oqnzug = y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
								{
									NIM_BOOL LOC68;
									LOC68 = (NIM_BOOL)0;
									LOC68 = (k_KeWeZHiyBnWbJ7NUxRxrzQ == ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2));
									if (!(LOC68)) goto LA69;
									LOC68 = !(((NU8)(p_dm2MlSSgl6QuA4g3oqnzug->data[pos0]) == (NU8)(46)));
									LA69: ;
									if (!LOC68) goto LA70;
									addpackage_mPfTsfux8gBVeyQ8xwDYTQ(packages0, p_dm2MlSSgl6QuA4g3oqnzug);
								}
								LA70: ;
							}
							LA22: ;
						} LA13: ;
					}
				} LA11: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int LOC74;
				LOC74 = (int)0;
				LOC74 = closedir(d_ZfFno5oDVOm9aHJ009cmNoGQ);
			}
			if (T_asNQM9aynXXg9ccUABbReyew_2.status != 0) reraiseException();
		}
		LA8: ;
	}
	{
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug_2;
		p_dm2MlSSgl6QuA4g3oqnzug_2 = (NimStringDesc*)0;
		{
			NimStringDesc* key_Ev9apnmbO2PJJuXUQfg55Zg;
			NimStringDesc* val_ybgqP7AeGJc5RfjZOOmLIA;
			key_Ev9apnmbO2PJJuXUQfg55Zg = (NimStringDesc*)0;
			val_ybgqP7AeGJc5RfjZOOmLIA = (NimStringDesc*)0;
			{
				NI h_0lk9afqbBF9cAQtskh16RYmQ;
				NI HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g;
				NI res_yPiyJP1ZM9abouUrPkQkp8Q;
				h_0lk9afqbBF9cAQtskh16RYmQ = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = ((*packages0).data ? ((*packages0).data->Sup.len-1) : -1);
				res_yPiyJP1ZM9abouUrPkQkp8Q = ((NI) 0);
				{
					while (1) {
						if (!(res_yPiyJP1ZM9abouUrPkQkp8Q <= HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g)) goto LA79;
						h_0lk9afqbBF9cAQtskh16RYmQ = res_yPiyJP1ZM9abouUrPkQkp8Q;
						{
							NimStringDesc* res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							if (!!(((*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field0 == 0))) goto LA82;
							key_Ev9apnmbO2PJJuXUQfg55Zg = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field0;
							val_ybgqP7AeGJc5RfjZOOmLIA = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field1;
							{
								if (!eqStrings(val_ybgqP7AeGJc5RfjZOOmLIA, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_5))) goto LA86;
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = key_Ev9apnmbO2PJJuXUQfg55Zg;
							}
							goto LA84;
							LA86: ;
							{
								NimStringDesc* LOC89;
								LOC89 = (NimStringDesc*)0;
								LOC89 = rawNewString(key_Ev9apnmbO2PJJuXUQfg55Zg->Sup.len + val_ybgqP7AeGJc5RfjZOOmLIA->Sup.len + 1);
appendString(LOC89, key_Ev9apnmbO2PJJuXUQfg55Zg);
appendChar(LOC89, 45);
appendString(LOC89, val_ybgqP7AeGJc5RfjZOOmLIA);
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = LOC89;
							}
							LA84: ;
							p_dm2MlSSgl6QuA4g3oqnzug_2 = res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							addnimblepath_Io0tiMEKgDlbf67BdbC9cWw(p_dm2MlSSgl6QuA4g3oqnzug_2, info0);
						}
						LA82: ;
						res_yPiyJP1ZM9abouUrPkQkp8Q += ((NI) 1);
					} LA79: ;
				}
			}
		}
	}
}
예제 #17
0
N_NIMCALL(void, addpathrec_172266)(NimStringDesc* dir, Tlineinfo162338 info) {
	Stringtableobj133012* packages;
	NI pos;
	packages = nstnewStringTable(((NU8) 2));
	pos = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
		pos += ((NI) 1);
	}
	LA3: ;
	{
		NU8 k_172292;
		NimStringDesc* p_172293;
		DIR* d_172308;
		k_172292 = 0;
		p_172293 = 0;
		d_172308 = opendir(dir->data);
		{
			int LOC62;
			if (!!((d_172308 == NIM_NIL))) goto LA8;
			{
				while (1) {
					{
						struct dirent* x_172310;
						NimStringDesc* y_172312;
						x_172310 = readdir(d_172308);
						{
							if (!(x_172310 == NIM_NIL)) goto LA15;
							goto LA10;
						}
						LA15: ;
						y_172312 = cstrToNimstr(((NCSTRING) ((*x_172310).d_name)));
						{
							NIM_BOOL LOC19;
							struct stat s_172314;
							NU8 k_172316;
							LOC19 = 0;
							LOC19 = !(eqStrings(y_172312, ((NimStringDesc*) &TMP1658)));
							if (!(LOC19)) goto LA20;
							LOC19 = !(eqStrings(y_172312, ((NimStringDesc*) &TMP1659)));
							LA20: ;
							if (!LOC19) goto LA21;
							memset((void*)(&s_172314), 0, sizeof(s_172314));
							y_172312 = HEX2F_118292(dir, y_172312);
							k_172316 = ((NU8) 0);
							{
								if (!!(((*x_172310).d_type == ((NI8) 0)))) goto LA25;
								{
									if (!((*x_172310).d_type == ((NI8) 4))) goto LA29;
									k_172316 = ((NU8) 2);
								}
								LA29: ;
								{
									if (!((*x_172310).d_type == ((NI8) 10))) goto LA33;
									k_172316 = (NU8)(k_172316 + ((NI) 1));
								}
								LA33: ;
								k_172292 = k_172316;
								p_172293 = y_172312;
								{
									NIM_BOOL LOC37;
									LOC37 = 0;
									LOC37 = (k_172292 == ((NU8) 2));
									if (!(LOC37)) goto LA38;
									LOC37 = !(((NU8)(p_172293->data[pos]) == (NU8)(46)));
									LA38: ;
									if (!LOC37) goto LA39;
									addpackage_172126(packages, p_172293);
								}
								LA39: ;
								goto LA12;
							}
							LA25: ;
							{
								int LOC43;
								LOC43 = 0;
								LOC43 = lstat(y_172312->data, (&s_172314));
								if (!(LOC43 < ((NI32) 0))) goto LA44;
								goto LA10;
							}
							LA44: ;
							{
								NIM_BOOL LOC48;
								LOC48 = 0;
								LOC48 = S_ISDIR(s_172314.st_mode);
								if (!LOC48) goto LA49;
								k_172316 = ((NU8) 2);
							}
							LA49: ;
							{
								NIM_BOOL LOC53;
								LOC53 = 0;
								LOC53 = S_ISLNK(s_172314.st_mode);
								if (!LOC53) goto LA54;
								k_172316 = (NU8)(k_172316 + ((NI) 1));
							}
							LA54: ;
							k_172292 = k_172316;
							p_172293 = y_172312;
							{
								NIM_BOOL LOC58;
								LOC58 = 0;
								LOC58 = (k_172292 == ((NU8) 2));
								if (!(LOC58)) goto LA59;
								LOC58 = !(((NU8)(p_172293->data[pos]) == (NU8)(46)));
								LA59: ;
								if (!LOC58) goto LA60;
								addpackage_172126(packages, p_172293);
							}
							LA60: ;
						}
						LA21: ;
					} LA12: ;
				}
			} LA10: ;
			LOC62 = 0;
			LOC62 = closedir(d_172308);
		}
		LA8: ;
	}
	{
		NimStringDesc* p_172303;
		p_172303 = 0;
		{
			NimStringDesc* key_172322;
			NimStringDesc* val_172324;
			key_172322 = 0;
			val_172324 = 0;
			{
				NI h_172326;
				NI HEX3Atmp_172328;
				NI res_172330;
				h_172326 = 0;
				HEX3Atmp_172328 = 0;
				HEX3Atmp_172328 = ((*packages).data ? ((*packages).data->Sup.len-1) : -1);
				res_172330 = ((NI) 0);
				{
					while (1) {
						if (!(res_172330 <= HEX3Atmp_172328)) goto LA67;
						h_172326 = res_172330;
						{
							NimStringDesc* res_172334;
							if (!!((*packages).data->data[h_172326].Field0 == 0)) goto LA70;
							key_172322 = (*packages).data->data[h_172326].Field0;
							val_172324 = (*packages).data->data[h_172326].Field1;
							{
								if (!eqStrings(val_172324, ((NimStringDesc*) &TMP1660))) goto LA74;
								res_172334 = key_172322;
							}
							goto LA72;
							LA74: ;
							{
								NimStringDesc* LOC77;
								LOC77 = 0;
								LOC77 = rawNewString(key_172322->Sup.len + val_172324->Sup.len + 1);
appendString(LOC77, key_172322);
appendChar(LOC77, 45);
appendString(LOC77, val_172324);
								res_172334 = LOC77;
							}
							LA72: ;
							p_172303 = res_172334;
							addnimblepath_172175(p_172303, info);
						}
						LA70: ;
						res_172330 += ((NI) 1);
					} LA67: ;
				}
			}
		}
	}
}
예제 #18
0
N_NIMCALL(void, addpathrec_150180)(NimStringDesc* dir, tlineinfo136509 info) {
	tstringtable112610* packages;
	NI pos;
	NI TMP1402;
	NU8 k_150207;
	NimStringDesc* p_150208;
	DIR* d_150219;
	NimStringDesc* p_150217;
	NimStringDesc* key_150229;
	NimStringDesc* val_150231;
	NI h_150233;
	NI HEX3Atmp_150235;
	NI res_150237;
	nimfr("addPathRec", "babelcmd.nim")
	nimln(79, "babelcmd.nim");
	packages = nstnewStringTable(((NU8) 2));
	nimln(80, "babelcmd.nim");
	nimln(80, "babelcmd.nim");
	nimln(80, "babelcmd.nim");
	TMP1402 = subInt(dir->Sup.len, 1);
	pos = (NI32)(TMP1402);
	nimln(81, "babelcmd.nim");
	{
		nimln(730, "system.nim");
		if ((NU)(pos) > (NU)(dir->Sup.len)) raiseIndexError();
		if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
		nimln(81, "babelcmd.nim");
		pos = addInt(pos, 1);
	}	LA3: ;
	k_150207 = 0;
	p_150208 = 0;
	nimln(1227, "os.nim");
	d_150219 = opendir(dir->data);
	nimln(1228, "os.nim");
	{
		int LOC41;
		nimln(698, "system.nim");
		nimln(698, "system.nim");
		if (!!((d_150219 == NIM_NIL))) goto LA7;
		nimln(1229, "os.nim");
		while (1) {
			struct dirent* x_150221;
			NimStringDesc* y_150223;
			nimln(1230, "os.nim");
			x_150221 = readdir(d_150219);
			nimln(1231, "os.nim");
			{
				nimln(1231, "os.nim");
				if (!(x_150221 == NIM_NIL)) goto LA12;
				nimln(1231, "os.nim");
				goto LA9;
			}			LA12: ;
			nimln(1232, "os.nim");
			nimln(1232, "os.nim");
			y_150223 = cstrToNimstr(((NCSTRING) ((*x_150221).d_name)));
			nimln(1233, "os.nim");
			{
				NIM_BOOL LOC16;
				struct stat s_150225;
				NU8 k_150227;
				nimln(1233, "os.nim");
				LOC16 = 0;
				nimln(698, "system.nim");
				nimln(698, "system.nim");
				LOC16 = !(eqStrings(y_150223, ((NimStringDesc*) &TMP1396)));
				if (!(LOC16)) goto LA17;
				nimln(698, "system.nim");
				nimln(698, "system.nim");
				LOC16 = !(eqStrings(y_150223, ((NimStringDesc*) &TMP1397)));
				LA17: ;
				if (!LOC16) goto LA18;
				memset((void*)&s_150225, 0, sizeof(s_150225));
				nimln(1235, "os.nim");
				y_150223 = HEX2F_102067(dir, y_150223);
				nimln(1236, "os.nim");
				{
					int LOC22;
					nimln(1236, "os.nim");
					nimln(1236, "os.nim");
					LOC22 = 0;
					LOC22 = lstat(y_150223->data, &s_150225);
					if (!(LOC22 < ((NI32) 0))) goto LA23;
					nimln(1236, "os.nim");
					goto LA9;
				}				LA23: ;
				nimln(1237, "os.nim");
				k_150227 = ((NU8) 0);
				nimln(1238, "os.nim");
				{
					NIM_BOOL LOC27;
					nimln(1238, "os.nim");
					LOC27 = 0;
					LOC27 = S_ISDIR(s_150225.st_mode);
					if (!LOC27) goto LA28;
					nimln(1238, "os.nim");
					k_150227 = ((NU8) 2);
				}				LA28: ;
				nimln(1239, "os.nim");
				{
					NIM_BOOL LOC32;
					nimln(1239, "os.nim");
					LOC32 = 0;
					LOC32 = S_ISLNK(s_150225.st_mode);
					if (!LOC32) goto LA33;
					nimln(1239, "os.nim");
					nimln(1239, "os.nim");
					k_150227 = addInt(k_150227, 1);
				}				LA33: ;
				nimln(1237, "os.nim");
				k_150207 = k_150227;
				nimln(1232, "os.nim");
				p_150208 = y_150223;
				nimln(83, "babelcmd.nim");
				{
					NIM_BOOL LOC37;
					nimln(83, "babelcmd.nim");
					LOC37 = 0;
					nimln(83, "babelcmd.nim");
					LOC37 = (k_150207 == ((NU8) 2));
					if (!(LOC37)) goto LA38;
					nimln(698, "system.nim");
					nimln(698, "system.nim");
					if ((NU)(pos) > (NU)(p_150208->Sup.len)) raiseIndexError();
					LOC37 = !(((NU8)(p_150208->data[pos]) == (NU8)(46)));
					LA38: ;
					if (!LOC37) goto LA39;
					nimln(84, "babelcmd.nim");
					addpackage_150103(packages, p_150208);				}				LA39: ;
			}			LA18: ;
		} LA9: ;
		nimln(1241, "os.nim");
		nimln(1241, "os.nim");
		LOC41 = 0;
		LOC41 = closedir(d_150219);
	}	LA7: ;
	p_150217 = 0;
	key_150229 = 0;
	val_150231 = 0;
	h_150233 = 0;
	HEX3Atmp_150235 = 0;
	nimln(40, "strtabs.nim");
	nimln(40, "strtabs.nim");
	HEX3Atmp_150235 = ((*packages).Data->Sup.len-1);
	nimln(1308, "system.nim");
	res_150237 = 0;
	nimln(1309, "system.nim");
	while (1) {
		nimln(1309, "system.nim");
		if (!(res_150237 <= HEX3Atmp_150235)) goto LA42;
		nimln(1308, "system.nim");
		h_150233 = res_150237;
		nimln(41, "strtabs.nim");
		{
			NimStringDesc* res_150239;
			nimln(41, "strtabs.nim");
			nimln(41, "strtabs.nim");
			if ((NU)(h_150233) >= (NU)((*packages).Data->Sup.len)) raiseIndexError();
			if (!!((*packages).Data->data[h_150233].Field0 == 0)) goto LA45;
			nimln(42, "strtabs.nim");
			if ((NU)(h_150233) >= (NU)((*packages).Data->Sup.len)) raiseIndexError();
			key_150229 = (*packages).Data->data[h_150233].Field0;
			nimln(42, "strtabs.nim");
			if ((NU)(h_150233) >= (NU)((*packages).Data->Sup.len)) raiseIndexError();
			val_150231 = (*packages).Data->data[h_150233].Field1;
			nimln(58, "babelcmd.nim");
			nimln(58, "babelcmd.nim");
			{
				nimln(58, "babelcmd.nim");
				if (!eqStrings(val_150231, ((NimStringDesc*) &TMP1393))) goto LA49;
				res_150239 = key_150229;
			}			goto LA47;
			LA49: ;
			{
				NimStringDesc* LOC52;
				nimln(58, "babelcmd.nim");
				LOC52 = 0;
				LOC52 = rawNewString(key_150229->Sup.len + val_150231->Sup.len + 1);
appendString(LOC52, key_150229);
appendChar(LOC52, 45);
appendString(LOC52, val_150231);
				res_150239 = LOC52;
			}			LA47: ;
			nimln(58, "babelcmd.nim");
			p_150217 = res_150239;
			nimln(86, "babelcmd.nim");
			addbabelpath_150128(p_150217, info);		}		LA45: ;
		nimln(1311, "system.nim");
		res_150237 = addInt(res_150237, 1);
	} LA42: ;
	popFrame();
}
예제 #19
0
N_NIMCALL(void, addpathwithnimfiles_150135)(NimStringDesc* p, tlineinfo136509 info) {
	nimfr("addPathWithNimFiles", "babelcmd.nim")
	nimln(72, "babelcmd.nim");
	{
		NIM_BOOL LOC3;
		nimln(72, "babelcmd.nim");
		LOC3 = 0;
		LOC3 = hasnimfile_150139(p);
		if (!LOC3) goto LA4;
		nimln(73, "babelcmd.nim");
		addbabelpath_150128(p, info);	}	goto LA1;
	LA4: ;
	{
		NU8 kind_150165;
		NimStringDesc* p2_150166;
		DIR* d_150168;
		kind_150165 = 0;
		p2_150166 = 0;
		nimln(1227, "os.nim");
		d_150168 = opendir(p->data);
		nimln(1228, "os.nim");
		{
			int LOC42;
			nimln(698, "system.nim");
			nimln(698, "system.nim");
			if (!!((d_150168 == NIM_NIL))) goto LA9;
			nimln(1229, "os.nim");
			while (1) {
				struct dirent* x_150170;
				NimStringDesc* y_150172;
				nimln(1230, "os.nim");
				x_150170 = readdir(d_150168);
				nimln(1231, "os.nim");
				{
					nimln(1231, "os.nim");
					if (!(x_150170 == NIM_NIL)) goto LA14;
					nimln(1231, "os.nim");
					goto LA11;
				}				LA14: ;
				nimln(1232, "os.nim");
				nimln(1232, "os.nim");
				y_150172 = cstrToNimstr(((NCSTRING) ((*x_150170).d_name)));
				nimln(1233, "os.nim");
				{
					NIM_BOOL LOC18;
					struct stat s_150174;
					NU8 k_150176;
					nimln(1233, "os.nim");
					LOC18 = 0;
					nimln(698, "system.nim");
					nimln(698, "system.nim");
					LOC18 = !(eqStrings(y_150172, ((NimStringDesc*) &TMP1396)));
					if (!(LOC18)) goto LA19;
					nimln(698, "system.nim");
					nimln(698, "system.nim");
					LOC18 = !(eqStrings(y_150172, ((NimStringDesc*) &TMP1397)));
					LA19: ;
					if (!LOC18) goto LA20;
					memset((void*)&s_150174, 0, sizeof(s_150174));
					nimln(1235, "os.nim");
					y_150172 = HEX2F_102067(p, y_150172);
					nimln(1236, "os.nim");
					{
						int LOC24;
						nimln(1236, "os.nim");
						nimln(1236, "os.nim");
						LOC24 = 0;
						LOC24 = lstat(y_150172->data, &s_150174);
						if (!(LOC24 < ((NI32) 0))) goto LA25;
						nimln(1236, "os.nim");
						goto LA11;
					}					LA25: ;
					nimln(1237, "os.nim");
					k_150176 = ((NU8) 0);
					nimln(1238, "os.nim");
					{
						NIM_BOOL LOC29;
						nimln(1238, "os.nim");
						LOC29 = 0;
						LOC29 = S_ISDIR(s_150174.st_mode);
						if (!LOC29) goto LA30;
						nimln(1238, "os.nim");
						k_150176 = ((NU8) 2);
					}					LA30: ;
					nimln(1239, "os.nim");
					{
						NIM_BOOL LOC34;
						nimln(1239, "os.nim");
						LOC34 = 0;
						LOC34 = S_ISLNK(s_150174.st_mode);
						if (!LOC34) goto LA35;
						nimln(1239, "os.nim");
						nimln(1239, "os.nim");
						k_150176 = addInt(k_150176, 1);
					}					LA35: ;
					nimln(1237, "os.nim");
					kind_150165 = k_150176;
					nimln(1232, "os.nim");
					p2_150166 = y_150172;
					nimln(76, "babelcmd.nim");
					{
						NIM_BOOL LOC39;
						nimln(76, "babelcmd.nim");
						LOC39 = 0;
						LOC39 = hasnimfile_150139(p2_150166);
						if (!LOC39) goto LA40;
						nimln(76, "babelcmd.nim");
						addbabelpath_150128(p2_150166, info);					}					LA40: ;
				}				LA20: ;
			} LA11: ;
			nimln(1241, "os.nim");
			nimln(1241, "os.nim");
			LOC42 = 0;
			LOC42 = closedir(d_150168);
		}		LA9: ;
	}	LA1: ;
	popFrame();
}
예제 #20
0
N_NIMCALL(NIM_BOOL, hasnimfile_150139)(NimStringDesc* dir) {
	NIM_BOOL result;
	NU8 kind_150143;
	NimStringDesc* path_150144;
	DIR* d_150154;
	nimfr("hasNimFile", "babelcmd.nim")
	result = 0;
	kind_150143 = 0;
	path_150144 = 0;
	nimln(1227, "os.nim");
	d_150154 = opendir(dir->data);
	nimln(1228, "os.nim");
	{
		int LOC37;
		nimln(698, "system.nim");
		nimln(698, "system.nim");
		if (!!((d_150154 == NIM_NIL))) goto LA3;
		nimln(1229, "os.nim");
		while (1) {
			struct dirent* x_150156;
			NimStringDesc* y_150158;
			nimln(1230, "os.nim");
			x_150156 = readdir(d_150154);
			nimln(1231, "os.nim");
			{
				nimln(1231, "os.nim");
				if (!(x_150156 == NIM_NIL)) goto LA8;
				nimln(1231, "os.nim");
				goto LA5;
			}			LA8: ;
			nimln(1232, "os.nim");
			nimln(1232, "os.nim");
			y_150158 = cstrToNimstr(((NCSTRING) ((*x_150156).d_name)));
			nimln(1233, "os.nim");
			{
				NIM_BOOL LOC12;
				struct stat s_150160;
				NU8 k_150162;
				nimln(1233, "os.nim");
				LOC12 = 0;
				nimln(698, "system.nim");
				nimln(698, "system.nim");
				LOC12 = !(eqStrings(y_150158, ((NimStringDesc*) &TMP1396)));
				if (!(LOC12)) goto LA13;
				nimln(698, "system.nim");
				nimln(698, "system.nim");
				LOC12 = !(eqStrings(y_150158, ((NimStringDesc*) &TMP1397)));
				LA13: ;
				if (!LOC12) goto LA14;
				memset((void*)&s_150160, 0, sizeof(s_150160));
				nimln(1235, "os.nim");
				y_150158 = HEX2F_102067(dir, y_150158);
				nimln(1236, "os.nim");
				{
					int LOC18;
					nimln(1236, "os.nim");
					nimln(1236, "os.nim");
					LOC18 = 0;
					LOC18 = lstat(y_150158->data, &s_150160);
					if (!(LOC18 < ((NI32) 0))) goto LA19;
					nimln(1236, "os.nim");
					goto LA5;
				}				LA19: ;
				nimln(1237, "os.nim");
				k_150162 = ((NU8) 0);
				nimln(1238, "os.nim");
				{
					NIM_BOOL LOC23;
					nimln(1238, "os.nim");
					LOC23 = 0;
					LOC23 = S_ISDIR(s_150160.st_mode);
					if (!LOC23) goto LA24;
					nimln(1238, "os.nim");
					k_150162 = ((NU8) 2);
				}				LA24: ;
				nimln(1239, "os.nim");
				{
					NIM_BOOL LOC28;
					nimln(1239, "os.nim");
					LOC28 = 0;
					LOC28 = S_ISLNK(s_150160.st_mode);
					if (!LOC28) goto LA29;
					nimln(1239, "os.nim");
					nimln(1239, "os.nim");
					k_150162 = addInt(k_150162, 1);
				}				LA29: ;
				nimln(1237, "os.nim");
				kind_150143 = k_150162;
				nimln(1232, "os.nim");
				path_150144 = y_150158;
				nimln(69, "babelcmd.nim");
				{
					NIM_BOOL LOC33;
					nimln(69, "babelcmd.nim");
					LOC33 = 0;
					nimln(69, "babelcmd.nim");
					LOC33 = (kind_150143 == ((NU8) 0));
					if (!(LOC33)) goto LA34;
					nimln(69, "babelcmd.nim");
					LOC33 = nsuEndsWith(path_150144, ((NimStringDesc*) &TMP1401));
					LA34: ;
					if (!LOC33) goto LA35;
					nimln(70, "babelcmd.nim");
					result = NIM_TRUE;
					nimln(71, "babelcmd.nim");
					goto LA5;
				}				LA35: ;
			}			LA14: ;
		} LA5: ;
		nimln(1241, "os.nim");
		nimln(1241, "os.nim");
		LOC37 = 0;
		LOC37 = closedir(d_150154);
	}	LA3: ;
	popFrame();
	return result;
}
예제 #21
0
N_NIMCALL(void, gettzname_114892_2726502234)(Keyvaluepair152604* Result) {
{	unsureAsgnRef((void**) (&(*Result).Field0), cstrToNimstr(tzname[(((NI) 0))- 0]));
	unsureAsgnRef((void**) (&(*Result).Field1), cstrToNimstr(tzname[(((NI) 1))- 0]));
	goto BeforeRet;
	}BeforeRet: ;
}
예제 #22
0
파일: osproc.c 프로젝트: ddlsmurf/Nimrod
N_NIMCALL(TY63202*, nospstartProcess)(NimStringDesc* Command_63239, NimStringDesc* Workingdir_63240, NimStringDesc** Args_63245, NI Args_63245Len0, TY61408* Env_63246, NU8 Options_63249) {
TY63202* Result_64352;
TY27434 Si_64353;
TY27436 Procinfo_64354;
NI Success_64355;
NI Hi_64356;
NI Ho_64357;
NI He_64358;
NCSTRING Cmdl_64402;
NCSTRING Wd_64601;
NCSTRING E_64602;
NimStringDesc* LOC16;
NI32 LOC17;
NI32 LOC30;
Result_64352 = 0;
memset((void*)&Si_64353, 0, sizeof(Si_64353));
memset((void*)&Procinfo_64354, 0, sizeof(Procinfo_64354));
Success_64355 = 0;
Hi_64356 = 0;
Ho_64357 = 0;
He_64358 = 0;
Result_64352 = (TY63202*) newObj(NTI63204, sizeof(TY63202));
(*Result_64352).Sup.m_type = NTI63202;
Si_64353.Cb = ((NI32) (((NI)sizeof(TY27434))));
if (!!(((Options_63249 &(1<<((((NU8) 3))&7)))!=0))) goto LA2;
Si_64353.Dwflags = ((NI32) 256);
Createpipehandles_64323(&Si_64353.Hstdinput, &Hi_64356);
Createpipehandles_64323(&Ho_64357, &Si_64353.Hstdoutput);
if (!((Options_63249 &(1<<((((NU8) 2))&7)))!=0)) goto LA5;
Si_64353.Hstderror = Si_64353.Hstdoutput;
He_64358 = Ho_64357;
goto LA4;
LA5: ;
Createpipehandles_64323(&He_64358, &Si_64353.Hstderror);
LA4: ;
(*Result_64352).Inputhandle = ((NI32) (Hi_64356));
(*Result_64352).Outputhandle = ((NI32) (Ho_64357));
(*Result_64352).Errorhandle = ((NI32) (He_64358));
goto LA1;
LA2: ;
Si_64353.Hstderror = Dl_27537(((NI32) -12));
Si_64353.Hstdinput = Dl_27537(((NI32) -10));
Si_64353.Hstdoutput = Dl_27537(((NI32) -11));
(*Result_64352).Inputhandle = ((NI32) (Si_64353.Hstdinput));
(*Result_64352).Outputhandle = ((NI32) (Si_64353.Hstdoutput));
(*Result_64352).Errorhandle = ((NI32) (Si_64353.Hstderror));
LA1: ;
Cmdl_64402 = 0;
Cmdl_64402 = Buildcommandline_64260(Command_63239, Args_63245, Args_63245Len0);
Wd_64601 = 0;
Wd_64601 = NIM_NIL;
E_64602 = 0;
E_64602 = NIM_NIL;
if (!(0 < Workingdir_63240->Sup.len)) goto LA8;
Wd_64601 = Workingdir_63240->data;
LA8: ;
if (!!((Env_63246 == NIM_NIL))) goto LA11;
E_64602 = Buildenv_64280(Env_63246);
LA11: ;
if (!((Options_63249 &(1<<((((NU8) 0))&7)))!=0)) goto LA14;
LOC16 = 0;
LOC16 = cstrToNimstr(Cmdl_64402);
rawEcho(LOC16);
rawEchoNL();
LA14: ;
LOC17 = Dl_27502(NIM_NIL, Cmdl_64402, NIM_NIL, NIM_NIL, ((NI32) 1), ((NI32) 32), ((void*) (E_64602)), Wd_64601, &Si_64353, &Procinfo_64354);
Success_64355 = ((NI) (LOC17));
if (!!(((Options_63249 &(1<<((((NU8) 3))&7)))!=0))) goto LA19;
Fileclose_64332(Si_64353.Hstdinput);
Fileclose_64332(Si_64353.Hstdoutput);
if (!!(((Options_63249 &(1<<((((NU8) 2))&7)))!=0))) goto LA22;
Fileclose_64332(Si_64353.Hstderror);
LA22: ;
LA19: ;
if (!!((E_64602 == NIM_NIL))) goto LA25;
Dealloc_2360(((void*) (E_64602)));
LA25: ;
Dealloc_2360(((void*) (Cmdl_64402)));
if (!(Success_64355 == 0)) goto LA28;
nosOSError(((NimStringDesc*) &TMP192867));
LA28: ;
LOC30 = Dl_27475(Procinfo_64354.Hthread);
(*Result_64352).Fprocesshandle = Procinfo_64354.Hprocess;
(*Result_64352).Id = Procinfo_64354.Dwprocessid;
return Result_64352;
}
예제 #23
0
N_NIMCALL(NimStringDesc*, getpackagename_136811)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
	NimStringDesc* d_136835;
	NimStringDesc* current_136866;
	nimfr("getPackageName", "options.nim")
	result = 0;
	nimln(234, "options.nim");
	parents = 0;
	{
		NimStringDesc* d_136817;
		NimStringDesc* current_136864;
		d_136817 = 0;
		nimln(227, "options.nim");
		current_136864 = copyString(path);
		nimln(228, "options.nim");
		while (1) {
			NimStringDesc* file_136834;
			NimStringDesc* HEX3Atmp_136852;
			glob_t f_136854;
			NI res_136856;
			int LOC12;
			nimln(229, "options.nim");
			current_136864 = nosparentDir(current_136864);
			nimln(230, "options.nim");
			{
				nimln(230, "options.nim");
				nimln(230, "options.nim");
				if (!(current_136864->Sup.len == 0)) goto LA5;
				nimln(230, "options.nim");
				goto LA2;
			}
			LA5: ;
			nimln(227, "options.nim");
			d_136817 = current_136864;
			nimln(237, "options.nim");
			{
				NIM_BOOL LOC9;
				nimln(237, "options.nim");
				LOC9 = 0;
				LOC9 = nsthasKey(packagecache_136601, d_136817);
				if (!LOC9) goto LA10;
				nimln(239, "options.nim");
				nimln(239, "options.nim");
				result = nstGet(packagecache_136601, d_136817);
				goto BeforeRet;
			}
			LA10: ;
			nimln(240, "options.nim");
			parents = addInt(parents, 1);
			file_136834 = 0;
			HEX3Atmp_136852 = 0;
			nimln(241, "options.nim");
			HEX3Atmp_136852 = HEX2F_108477(d_136817, ((NimStringDesc*) &TMP425));
			memset((void*)&f_136854, 0, sizeof(f_136854));
			res_136856 = 0;
			nimln(1208, "os.nim");
			f_136854.gl_offs = 0;
			nimln(1209, "os.nim");
			f_136854.gl_pathc = 0;
			nimln(1210, "os.nim");
			f_136854.gl_pathv = NIM_NIL;
			nimln(1211, "os.nim");
			nimln(1211, "os.nim");
			LOC12 = 0;
			LOC12 = glob(HEX3Atmp_136852->data, ((int) 0), NIM_NIL, &f_136854);
			res_136856 = ((NI) (LOC12));
			nimln(1212, "os.nim");
			{
				NI i_136858;
				NI HEX3Atmp_136860;
				NI TMP426;
				NI res_136862;
				nimln(1212, "os.nim");
				if (!(res_136856 == 0)) goto LA15;
				i_136858 = 0;
				HEX3Atmp_136860 = 0;
				nimln(1213, "os.nim");
				nimln(1213, "os.nim");
				TMP426 = subInt(f_136854.gl_pathc, 1);
				HEX3Atmp_136860 = (NI32)(TMP426);
				nimln(1457, "system.nim");
				res_136862 = 0;
				nimln(1458, "system.nim");
				while (1) {
					TY108700 LOC22;
					nimln(1458, "system.nim");
					if (!(res_136862 <= HEX3Atmp_136860)) goto LA17;
					nimln(1457, "system.nim");
					i_136858 = res_136862;
					nimln(1214, "os.nim");
					{
						nimln(1214, "os.nim");
						nimln(1214, "os.nim");
						nimln(1214, "os.nim");
						if ((NU)(i_136858) > (NU)(50000)) raiseIndexError();
						if (!!(!((f_136854.gl_pathv[(i_136858)- 0] == NIM_NIL)))) goto LA20;
						nimln(1214, "os.nim");
						failedassertimpl_79821(((NimStringDesc*) &TMP427));
					}
					LA20: ;
					nimln(1215, "os.nim");
					nimln(1215, "os.nim");
					if ((NU)(i_136858) > (NU)(50000)) raiseIndexError();
					file_136834 = cstrToNimstr(f_136854.gl_pathv[(i_136858)- 0]);
					nimln(242, "options.nim");
					nimln(242, "options.nim");
					memset((void*)&LOC22, 0, sizeof(LOC22));
					nossplitFile(file_136834, &LOC22);
					result = copyString(LOC22.Field1);
					nimln(243, "options.nim");
					goto LA1;
					nimln(1460, "system.nim");
					res_136862 = addInt(res_136862, 1);
				} LA17: ;
			}
			LA15: ;
			nimln(1216, "os.nim");
			globfree(&f_136854);
		} LA2: ;
	} LA1: ;
	nimln(245, "options.nim");
	{
		nimln(245, "options.nim");
		if (!result == 0) goto LA25;
		nimln(245, "options.nim");
		result = copyString(((NimStringDesc*) &TMP404));
	}
	LA25: ;
	d_136835 = 0;
	nimln(227, "options.nim");
	current_136866 = copyString(path);
	nimln(228, "options.nim");
	while (1) {
		nimln(229, "options.nim");
		current_136866 = nosparentDir(current_136866);
		nimln(230, "options.nim");
		{
			nimln(230, "options.nim");
			nimln(230, "options.nim");
			if (!(current_136866->Sup.len == 0)) goto LA30;
			nimln(230, "options.nim");
			goto LA27;
		}
		LA30: ;
		nimln(227, "options.nim");
		d_136835 = current_136866;
		nimln(248, "options.nim");
		nstPut(packagecache_136601, d_136835, result);
		nimln(249, "options.nim");
		parents = subInt(parents, 1);
		nimln(250, "options.nim");
		{
			nimln(250, "options.nim");
			if (!(parents <= 0)) goto LA34;
			nimln(250, "options.nim");
			goto LA27;
		}
		LA34: ;
	} LA27: ;
	BeforeRet: ;
	popFrame();
	return result;
}
예제 #24
0
N_NIMCALL(NimStringDesc*, getpackagename_153825)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
{	result = 0;
	parents = ((NI) 0);
	{
		{
			NimStringDesc* d_153831;
			NimStringDesc* current_153888;
			d_153831 = 0;
			current_153888 = copyString(path);
			{
				while (1) {
					current_153888 = nosparentDir(current_153888);
					{
						if (!((current_153888 ? current_153888->Sup.len : 0) == ((NI) 0))) goto LA7;
						goto LA3;
					}
					LA7: ;
					d_153831 = current_153888;
					{
						NIM_BOOL LOC11;
						LOC11 = 0;
						LOC11 = nsthasKey(packagecache_153601, d_153831);
						if (!LOC11) goto LA12;
						result = nstGet(packagecache_153601, d_153831);
						goto BeforeRet;
					}
					LA12: ;
					parents += ((NI) 1);
					{
						NimStringDesc* file_153841;
						NimStringDesc* HEX3Atmp_153855;
						glob_t f_153859;
						NI res_153861;
						int LOC15;
						file_153841 = 0;
						HEX3Atmp_153855 = 0;
						HEX3Atmp_153855 = HEX2F_118292(d_153831, ((NimStringDesc*) &TMP1433));
						memset((void*)(&f_153859), 0, sizeof(f_153859));
						res_153861 = 0;
						f_153859.gl_offs = ((NI) 0);
						f_153859.gl_pathc = ((NI) 0);
						f_153859.gl_pathv = NIM_NIL;
						LOC15 = 0;
						LOC15 = glob(HEX3Atmp_153855->data, ((int) 0), NIM_NIL, (&f_153859));
						res_153861 = ((NI) (LOC15));
						{
							if (!(res_153861 == ((NI) 0))) goto LA18;
							{
								NI i_153863;
								NI HEX3Atmp_153865;
								NI res_153867;
								i_153863 = 0;
								HEX3Atmp_153865 = 0;
								HEX3Atmp_153865 = (NI)(f_153859.gl_pathc - ((NI) 1));
								res_153867 = ((NI) 0);
								{
									while (1) {
										TY118589 LOC23;
										if (!(res_153867 <= HEX3Atmp_153865)) goto LA22;
										i_153863 = res_153867;
										file_153841 = cstrToNimstr(f_153859.gl_pathv[(i_153863)- 0]);
										memset((void*)(&LOC23), 0, sizeof(LOC23));
										nossplitFile(file_153841, (&LOC23));
										result = copyString(LOC23.Field1);
										goto LA1;
										res_153867 += ((NI) 1);
									} LA22: ;
								}
							}
						}
						LA18: ;
						globfree((&f_153859));
					}
					{
						NimStringDesc* file_153842;
						NimStringDesc* HEX3Atmp_153871;
						glob_t f_153875;
						NI res_153877;
						int LOC25;
						file_153842 = 0;
						HEX3Atmp_153871 = 0;
						HEX3Atmp_153871 = HEX2F_118292(d_153831, ((NimStringDesc*) &TMP1434));
						memset((void*)(&f_153875), 0, sizeof(f_153875));
						res_153877 = 0;
						f_153875.gl_offs = ((NI) 0);
						f_153875.gl_pathc = ((NI) 0);
						f_153875.gl_pathv = NIM_NIL;
						LOC25 = 0;
						LOC25 = glob(HEX3Atmp_153871->data, ((int) 0), NIM_NIL, (&f_153875));
						res_153877 = ((NI) (LOC25));
						{
							if (!(res_153877 == ((NI) 0))) goto LA28;
							{
								NI i_153879;
								NI HEX3Atmp_153881;
								NI res_153883;
								i_153879 = 0;
								HEX3Atmp_153881 = 0;
								HEX3Atmp_153881 = (NI)(f_153875.gl_pathc - ((NI) 1));
								res_153883 = ((NI) 0);
								{
									while (1) {
										TY118589 LOC33;
										if (!(res_153883 <= HEX3Atmp_153881)) goto LA32;
										i_153879 = res_153883;
										file_153842 = cstrToNimstr(f_153875.gl_pathv[(i_153879)- 0]);
										memset((void*)(&LOC33), 0, sizeof(LOC33));
										nossplitFile(file_153842, (&LOC33));
										result = copyString(LOC33.Field1);
										goto LA1;
										res_153883 += ((NI) 1);
									} LA32: ;
								}
							}
						}
						LA28: ;
						globfree((&f_153875));
					}
				}
			} LA3: ;
		}
	} LA1: ;
	{
		if (!result == 0) goto LA36;
		result = copyString(((NimStringDesc*) &TMP39));
	}
	LA36: ;
	{
		NimStringDesc* d_153843;
		NimStringDesc* current_153892;
		d_153843 = 0;
		current_153892 = copyString(path);
		{
			while (1) {
				current_153892 = nosparentDir(current_153892);
				{
					if (!((current_153892 ? current_153892->Sup.len : 0) == ((NI) 0))) goto LA43;
					goto LA39;
				}
				LA43: ;
				d_153843 = current_153892;
				nstPut(packagecache_153601, d_153843, result);
				parents -= ((NI) 1);
				{
					if (!(parents <= ((NI) 0))) goto LA47;
					goto LA38;
				}
				LA47: ;
			}
		} LA39: ;
	} LA38: ;
	}BeforeRet: ;
	return result;
}
예제 #25
0
N_NIMCALL(pid_t, startprocessauxspawn_145001)(Tstartprocessdata144948* data) {
	pid_t result;
	posix_spawnattr_t attr;
	posix_spawn_file_actions_t fops;
	sigset_t mask;
	int res;
	pid_t pid;
	int LOC98;
	int LOC99;
{	result = 0;
	memset((void*)(&attr), 0, sizeof(attr));
	memset((void*)(&fops), 0, sizeof(fops));
	{
		int LOC3;
		NI32 LOC6;
		LOC3 = 0;
		LOC3 = posix_spawn_file_actions_init((&fops));
		if (!!((LOC3 == ((NI32) 0)))) goto LA4;
		LOC6 = 0;
		LOC6 = oslasterror_117033();
		raiseoserror_117009(LOC6);
	}
	LA4: ;
	{
		int LOC9;
		NI32 LOC12;
		LOC9 = 0;
		LOC9 = posix_spawnattr_init((&attr));
		if (!!((LOC9 == ((NI32) 0)))) goto LA10;
		LOC12 = 0;
		LOC12 = oslasterror_117033();
		raiseoserror_117009(LOC12);
	}
	LA10: ;
	memset((void*)(&mask), 0, sizeof(mask));
	{
		int LOC15;
		NI32 LOC18;
		LOC15 = 0;
		LOC15 = sigemptyset((&mask));
		if (!!((LOC15 == ((NI32) 0)))) goto LA16;
		LOC18 = 0;
		LOC18 = oslasterror_117033();
		raiseoserror_117009(LOC18);
	}
	LA16: ;
	{
		int LOC21;
		NI32 LOC24;
		LOC21 = 0;
		LOC21 = posix_spawnattr_setsigmask((&attr), (&mask));
		if (!!((LOC21 == ((NI32) 0)))) goto LA22;
		LOC24 = 0;
		LOC24 = oslasterror_117033();
		raiseoserror_117009(LOC24);
	}
	LA22: ;
	{
		int LOC27;
		NI32 LOC30;
		LOC27 = 0;
		LOC27 = posix_spawnattr_setpgroup((&attr), ((pid_t) 0));
		if (!!((LOC27 == ((NI32) 0)))) goto LA28;
		LOC30 = 0;
		LOC30 = oslasterror_117033();
		raiseoserror_117009(LOC30);
	}
	LA28: ;
	{
		int LOC33;
		NI32 LOC36;
		LOC33 = 0;
		LOC33 = posix_spawnattr_setflags((&attr), (NI32)((NI32)(((int) 0) | POSIX_SPAWN_SETSIGMASK) | POSIX_SPAWN_SETPGROUP));
		if (!!((LOC33 == ((NI32) 0)))) goto LA34;
		LOC36 = 0;
		LOC36 = oslasterror_117033();
		raiseoserror_117009(LOC36);
	}
	LA34: ;
	{
		if (!!((*data).optionpoparentstreams)) goto LA39;
		{
			int LOC43;
			NI32 LOC46;
			LOC43 = 0;
			LOC43 = posix_spawn_file_actions_addclose((&fops), (*data).pstdin[(((NI) 1))- 0]);
			if (!!((LOC43 == ((NI32) 0)))) goto LA44;
			LOC46 = 0;
			LOC46 = oslasterror_117033();
			raiseoserror_117009(LOC46);
		}
		LA44: ;
		{
			int LOC49;
			NI32 LOC52;
			LOC49 = 0;
			LOC49 = posix_spawn_file_actions_adddup2((&fops), (*data).pstdin[(((NI) 0))- 0], ((int) 0));
			if (!!((LOC49 == ((NI32) 0)))) goto LA50;
			LOC52 = 0;
			LOC52 = oslasterror_117033();
			raiseoserror_117009(LOC52);
		}
		LA50: ;
		{
			int LOC55;
			NI32 LOC58;
			LOC55 = 0;
			LOC55 = posix_spawn_file_actions_addclose((&fops), (*data).pstdout[(((NI) 0))- 0]);
			if (!!((LOC55 == ((NI32) 0)))) goto LA56;
			LOC58 = 0;
			LOC58 = oslasterror_117033();
			raiseoserror_117009(LOC58);
		}
		LA56: ;
		{
			int LOC61;
			NI32 LOC64;
			LOC61 = 0;
			LOC61 = posix_spawn_file_actions_adddup2((&fops), (*data).pstdout[(((NI) 1))- 0], ((int) 1));
			if (!!((LOC61 == ((NI32) 0)))) goto LA62;
			LOC64 = 0;
			LOC64 = oslasterror_117033();
			raiseoserror_117009(LOC64);
		}
		LA62: ;
		{
			int LOC67;
			NI32 LOC70;
			LOC67 = 0;
			LOC67 = posix_spawn_file_actions_addclose((&fops), (*data).pstderr[(((NI) 0))- 0]);
			if (!!((LOC67 == ((NI32) 0)))) goto LA68;
			LOC70 = 0;
			LOC70 = oslasterror_117033();
			raiseoserror_117009(LOC70);
		}
		LA68: ;
		{
			if (!(*data).optionpostderrtostdout) goto LA73;
			{
				int LOC77;
				NI32 LOC80;
				LOC77 = 0;
				LOC77 = posix_spawn_file_actions_adddup2((&fops), (*data).pstdout[(((NI) 1))- 0], ((int) 2));
				if (!!((LOC77 == ((NI32) 0)))) goto LA78;
				LOC80 = 0;
				LOC80 = oslasterror_117033();
				raiseoserror_117009(LOC80);
			}
			LA78: ;
		}
		goto LA71;
		LA73: ;
		{
			{
				int LOC84;
				NI32 LOC87;
				LOC84 = 0;
				LOC84 = posix_spawn_file_actions_adddup2((&fops), (*data).pstderr[(((NI) 1))- 0], ((int) 2));
				if (!!((LOC84 == ((NI32) 0)))) goto LA85;
				LOC87 = 0;
				LOC87 = oslasterror_117033();
				raiseoserror_117009(LOC87);
			}
			LA85: ;
		}
		LA71: ;
	}
	LA39: ;
	res = 0;
	{
		NimStringDesc* LOC92;
		if (!(((NI) 0) < ((*data).workingdir ? strlen((*data).workingdir) : 0))) goto LA90;
		LOC92 = 0;
		LOC92 = cstrToNimstr((*data).workingdir);
		setcurrentdir_119207(LOC92);
	}
	LA90: ;
	pid = 0;
	{
		if (!(*data).optionpousepath) goto LA95;
		res = posix_spawnp((&pid), (*data).syscommand, (&fops), (&attr), (*data).sysargs, (*data).sysenv);
	}
	goto LA93;
	LA95: ;
	{
		res = posix_spawn((&pid), (*data).syscommand, (&fops), (&attr), (*data).sysargs, (*data).sysenv);
	}
	LA93: ;
	LOC98 = 0;
	LOC98 = posix_spawn_file_actions_destroy((&fops));
	LOC99 = 0;
	LOC99 = posix_spawnattr_destroy((&attr));
	{
		NI32 LOC104;
		if (!!((res == ((NI32) 0)))) goto LA102;
		LOC104 = 0;
		LOC104 = oslasterror_117033();
		raiseoserror_117009(LOC104);
	}
	LA102: ;
	result = pid;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}
예제 #26
0
N_NIMCALL(void, addpathrec_196184)(NimStringDesc* dir, Tlineinfo181337 info) {
	Stringtableobj140209* packages;
	NI pos;
	packages = nstnewStringTable(((NU8) 2));
	pos = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
		pos += ((NI) 1);
	}
	LA3: ;
	{
		NU8 k_196210;
		NimStringDesc* p_196211;
		DIR* d_196238;
		k_196210 = 0;
		p_196211 = 0;
		d_196238 = opendir(dir->data);
		{
			int LOC72;
			if (!!((d_196238 == NIM_NIL))) goto LA8;
			{
				while (1) {
					{
						struct dirent* x_196240;
						NimStringDesc* y_196242;
						x_196240 = readdir(d_196238);
						{
							if (!(x_196240 == NIM_NIL)) goto LA15;
							goto LA10;
						}
						LA15: ;
						y_196242 = cstrToNimstr(((NCSTRING) ((*x_196240).d_name)));
						{
							NIM_BOOL LOC19;
							struct stat s_196244;
							NU8 k_196246;
							LOC19 = 0;
							LOC19 = !(eqStrings(y_196242, ((NimStringDesc*) &TMP1792)));
							if (!(LOC19)) goto LA20;
							LOC19 = !(eqStrings(y_196242, ((NimStringDesc*) &TMP1793)));
							LA20: ;
							if (!LOC19) goto LA21;
							memset((void*)(&s_196244), 0, sizeof(s_196244));
							{
								if (!NIM_TRUE) goto LA25;
								y_196242 = HEX2F_118665(dir, y_196242);
							}
							LA25: ;
							k_196246 = ((NU8) 0);
							{
								if (!!(((*x_196240).d_type == ((NI8) 0)))) goto LA29;
								{
									if (!((*x_196240).d_type == ((NI8) 4))) goto LA33;
									k_196246 = ((NU8) 2);
								}
								LA33: ;
								{
									if (!((*x_196240).d_type == ((NI8) 10))) goto LA37;
									{
										NIM_BOOL LOC41;
										LOC41 = 0;
										LOC41 = direxists_122008(y_196242);
										if (!LOC41) goto LA42;
										k_196246 = ((NU8) 3);
									}
									goto LA39;
									LA42: ;
									{
										k_196246 = (NU8)(k_196246 + ((NI) 1));
									}
									LA39: ;
								}
								LA37: ;
								k_196210 = k_196246;
								p_196211 = y_196242;
								{
									NIM_BOOL LOC47;
									LOC47 = 0;
									LOC47 = (k_196210 == ((NU8) 2));
									if (!(LOC47)) goto LA48;
									LOC47 = !(((NU8)(p_196211->data[pos]) == (NU8)(46)));
									LA48: ;
									if (!LOC47) goto LA49;
									addpackage_196084(packages, p_196211);
								}
								LA49: ;
								goto LA12;
							}
							LA29: ;
							{
								int LOC53;
								LOC53 = 0;
								LOC53 = lstat(y_196242->data, (&s_196244));
								if (!(LOC53 < ((NI32) 0))) goto LA54;
								goto LA10;
							}
							LA54: ;
							{
								NIM_BOOL LOC58;
								LOC58 = 0;
								LOC58 = S_ISDIR(s_196244.st_mode);
								if (!LOC58) goto LA59;
								k_196246 = ((NU8) 2);
							}
							LA59: ;
							{
								NIM_BOOL LOC63;
								LOC63 = 0;
								LOC63 = S_ISLNK(s_196244.st_mode);
								if (!LOC63) goto LA64;
								k_196246 = (NU8)(k_196246 + ((NI) 1));
							}
							LA64: ;
							k_196210 = k_196246;
							p_196211 = y_196242;
							{
								NIM_BOOL LOC68;
								LOC68 = 0;
								LOC68 = (k_196210 == ((NU8) 2));
								if (!(LOC68)) goto LA69;
								LOC68 = !(((NU8)(p_196211->data[pos]) == (NU8)(46)));
								LA69: ;
								if (!LOC68) goto LA70;
								addpackage_196084(packages, p_196211);
							}
							LA70: ;
						}
						LA21: ;
					} LA12: ;
				}
			} LA10: ;
			LOC72 = 0;
			LOC72 = closedir(d_196238);
		}
		LA8: ;
	}
	{
		NimStringDesc* p_196221;
		p_196221 = 0;
		{
			NimStringDesc* key_196252;
			NimStringDesc* val_196254;
			key_196252 = 0;
			val_196254 = 0;
			{
				NI h_196256;
				NI HEX3Atmp_196258;
				NI res_196260;
				h_196256 = 0;
				HEX3Atmp_196258 = 0;
				HEX3Atmp_196258 = ((*packages).data ? ((*packages).data->Sup.len-1) : -1);
				res_196260 = ((NI) 0);
				{
					while (1) {
						if (!(res_196260 <= HEX3Atmp_196258)) goto LA77;
						h_196256 = res_196260;
						{
							NimStringDesc* res_196264;
							if (!!((*packages).data->data[h_196256].Field0 == 0)) goto LA80;
							key_196252 = (*packages).data->data[h_196256].Field0;
							val_196254 = (*packages).data->data[h_196256].Field1;
							{
								if (!eqStrings(val_196254, ((NimStringDesc*) &TMP1794))) goto LA84;
								res_196264 = key_196252;
							}
							goto LA82;
							LA84: ;
							{
								NimStringDesc* LOC87;
								LOC87 = 0;
								LOC87 = rawNewString(key_196252->Sup.len + val_196254->Sup.len + 1);
appendString(LOC87, key_196252);
appendChar(LOC87, 45);
appendString(LOC87, val_196254);
								res_196264 = LOC87;
							}
							LA82: ;
							p_196221 = res_196264;
							addnimblepath_196108(p_196221, info);
						}
						LA80: ;
						res_196260 += ((NI) 1);
					} LA77: ;
				}
			}
		}
	}
}
N_NIMCALL(void, addpathrec_277113)(NimStringDesc* dir, Tlineinfo192336 info) {
	Stringtableobj152608* packages;
	NI pos;
	packages = nstnewStringTable(((NU8) 2));
	pos = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
		pos += ((NI) 1);
	}
	LA3: ;
	{
		NU8 k_277139;
		NimStringDesc* p_277140;
		DIR* d_277167;
		k_277139 = 0;
		p_277140 = 0;
		d_277167 = opendir(dir->data);
		{
			TSafePoint TMP1827;
			if (!!((d_277167 == NIM_NIL))) goto LA8;
			pushSafePoint(&TMP1827);
			TMP1827.status = setjmp(TMP1827.context);
			if (TMP1827.status == 0) {
				{
					while (1) {
						{
							struct dirent* x_277169;
							NimStringDesc* volatile y_277171;
							x_277169 = readdir(d_277167);
							{
								if (!(x_277169 == NIM_NIL)) goto LA16;
								goto LA11;
							}
							LA16: ;
							y_277171 = cstrToNimstr(((NCSTRING) ((*x_277169).d_name)));
							{
								NIM_BOOL LOC20;
								struct stat s_277173;
								NU8 volatile k_277175;
								LOC20 = 0;
								LOC20 = !(eqStrings(y_277171, ((NimStringDesc*) &TMP1828)));
								if (!(LOC20)) goto LA21;
								LOC20 = !(eqStrings(y_277171, ((NimStringDesc*) &TMP1829)));
								LA21: ;
								if (!LOC20) goto LA22;
								memset((void*)(&s_277173), 0, sizeof(s_277173));
								{
									if (!NIM_TRUE) goto LA26;
									y_277171 = HEX2F_128265(dir, y_277171);
								}
								LA26: ;
								k_277175 = ((NU8) 0);
								{
									if (!!(((*x_277169).d_type == ((NI8) 0)))) goto LA30;
									{
										if (!((*x_277169).d_type == ((NI8) 4))) goto LA34;
										k_277175 = ((NU8) 2);
									}
									LA34: ;
									{
										if (!((*x_277169).d_type == ((NI8) 10))) goto LA38;
										{
											NIM_BOOL LOC42;
											LOC42 = 0;
											LOC42 = direxists_131608(y_277171);
											if (!LOC42) goto LA43;
											k_277175 = ((NU8) 3);
										}
										goto LA40;
										LA43: ;
										{
											k_277175 = ((NU8) 1);
										}
										LA40: ;
									}
									LA38: ;
									k_277139 = k_277175;
									p_277140 = y_277171;
									{
										NIM_BOOL LOC48;
										LOC48 = 0;
										LOC48 = (k_277139 == ((NU8) 2));
										if (!(LOC48)) goto LA49;
										LOC48 = !(((NU8)(p_277140->data[pos]) == (NU8)(46)));
										LA49: ;
										if (!LOC48) goto LA50;
										addpackage_277084(packages, p_277140);
									}
									LA50: ;
									goto LA13;
								}
								LA30: ;
								{
									int LOC54;
									LOC54 = 0;
									LOC54 = lstat(y_277171->data, (&s_277173));
									if (!(LOC54 < ((NI32) 0))) goto LA55;
									goto LA11;
								}
								LA55: ;
								{
									NIM_BOOL LOC59;
									LOC59 = 0;
									LOC59 = S_ISDIR(s_277173.st_mode);
									if (!LOC59) goto LA60;
									k_277175 = ((NU8) 2);
								}
								goto LA57;
								LA60: ;
								{
									NIM_BOOL LOC63;
									LOC63 = 0;
									LOC63 = S_ISLNK(s_277173.st_mode);
									if (!LOC63) goto LA64;
									k_277175 = getsymlinkfilekind_137218(y_277171);
								}
								goto LA57;
								LA64: ;
								LA57: ;
								k_277139 = k_277175;
								p_277140 = y_277171;
								{
									NIM_BOOL LOC68;
									LOC68 = 0;
									LOC68 = (k_277139 == ((NU8) 2));
									if (!(LOC68)) goto LA69;
									LOC68 = !(((NU8)(p_277140->data[pos]) == (NU8)(46)));
									LA69: ;
									if (!LOC68) goto LA70;
									addpackage_277084(packages, p_277140);
								}
								LA70: ;
							}
							LA22: ;
						} LA13: ;
					}
				} LA11: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int LOC74;
				LOC74 = 0;
				LOC74 = closedir(d_277167);
			}
			if (TMP1827.status != 0) reraiseException();
		}
		LA8: ;
	}
	{
		NimStringDesc* p_277150;
		p_277150 = 0;
		{
			NimStringDesc* key_277181;
			NimStringDesc* val_277183;
			key_277181 = 0;
			val_277183 = 0;
			{
				NI h_277185;
				NI HEX3Atmp_277187;
				NI res_277189;
				h_277185 = 0;
				HEX3Atmp_277187 = 0;
				HEX3Atmp_277187 = ((*packages).data ? ((*packages).data->Sup.len-1) : -1);
				res_277189 = ((NI) 0);
				{
					while (1) {
						if (!(res_277189 <= HEX3Atmp_277187)) goto LA79;
						h_277185 = res_277189;
						{
							NimStringDesc* res_277193;
							if (!!((*packages).data->data[h_277185].Field0 == 0)) goto LA82;
							key_277181 = (*packages).data->data[h_277185].Field0;
							val_277183 = (*packages).data->data[h_277185].Field1;
							{
								if (!eqStrings(val_277183, ((NimStringDesc*) &TMP1830))) goto LA86;
								res_277193 = key_277181;
							}
							goto LA84;
							LA86: ;
							{
								NimStringDesc* LOC89;
								LOC89 = 0;
								LOC89 = rawNewString(key_277181->Sup.len + val_277183->Sup.len + 1);
appendString(LOC89, key_277181);
appendChar(LOC89, 45);
appendString(LOC89, val_277183);
								res_277193 = LOC89;
							}
							LA84: ;
							p_277150 = res_277193;
							addnimblepath_277108(p_277150, info);
						}
						LA82: ;
						res_277189 += ((NI) 1);
					} LA79: ;
				}
			}
		}
	}
}
예제 #28
0
N_NIMCALL(void, addpathrec_172258)(NimStringDesc* dir, Tlineinfo162338 info) {
    Stringtableobj133012* packages;
    NI pos;
    packages = nstnewStringTable(((NU8) 2));
    pos = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
    {
        if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
        pos += ((NI) 1);
    }
LA3:
    ;
    {
        NU8 k_172284;
        NimStringDesc* p_172285;
        DIR* d_172299;
        k_172284 = 0;
        p_172285 = 0;
        d_172299 = opendir(dir->data);
        {
            int LOC43;
            if (!!((d_172299 == NIM_NIL))) goto LA8;
            {
                while (1) {
                    struct dirent* x_172301;
                    NimStringDesc* y_172303;
                    x_172301 = readdir(d_172299);
                    {
                        if (!(x_172301 == NIM_NIL)) goto LA14;
                        goto LA10;
                    }
LA14:
                    ;
                    y_172303 = cstrToNimstr(((NCSTRING) ((*x_172301).d_name)));
                    {
                        NIM_BOOL LOC18;
                        struct stat s_172305;
                        NU8 k_172307;
                        LOC18 = 0;
                        LOC18 = !(eqStrings(y_172303, ((NimStringDesc*) &TMP1658)));
                        if (!(LOC18)) goto LA19;
                        LOC18 = !(eqStrings(y_172303, ((NimStringDesc*) &TMP1659)));
LA19:
                        ;
                        if (!LOC18) goto LA20;
                        memset((void*)(&s_172305), 0, sizeof(s_172305));
                        y_172303 = HEX2F_118292(dir, y_172303);
                        k_172307 = ((NU8) 0);
                        {
                            int LOC24;
                            LOC24 = 0;
                            LOC24 = lstat(y_172303->data, (&s_172305));
                            if (!(LOC24 < ((NI32) 0))) goto LA25;
                            goto LA10;
                        }
LA25:
                        ;
                        {
                            NIM_BOOL LOC29;
                            LOC29 = 0;
                            LOC29 = S_ISDIR(s_172305.st_mode);
                            if (!LOC29) goto LA30;
                            k_172307 = ((NU8) 2);
                        }
LA30:
                        ;
                        {
                            NIM_BOOL LOC34;
                            LOC34 = 0;
                            LOC34 = S_ISLNK(s_172305.st_mode);
                            if (!LOC34) goto LA35;
                            k_172307 = (NU8)(k_172307 + ((NI) 1));
                        }
LA35:
                        ;
                        k_172284 = k_172307;
                        p_172285 = y_172303;
                        {
                            NIM_BOOL LOC39;
                            LOC39 = 0;
                            LOC39 = (k_172284 == ((NU8) 2));
                            if (!(LOC39)) goto LA40;
                            LOC39 = !(((NU8)(p_172285->data[pos]) == (NU8)(46)));
LA40:
                            ;
                            if (!LOC39) goto LA41;
                            addpackage_172126(packages, p_172285);
                        }
LA41:
                        ;
                    }
LA20:
                    ;
                }
            }
LA10:
            ;
            LOC43 = 0;
            LOC43 = closedir(d_172299);
        }
LA8:
        ;
    }
    {
        NimStringDesc* p_172295;
        p_172295 = 0;
        {
            NimStringDesc* key_172313;
            NimStringDesc* val_172315;
            key_172313 = 0;
            val_172315 = 0;
            {
                NI h_172317;
                NI HEX3Atmp_172319;
                NI res_172321;
                h_172317 = 0;
                HEX3Atmp_172319 = 0;
                HEX3Atmp_172319 = ((*packages).data ? ((*packages).data->Sup.len-1) : -1);
                res_172321 = ((NI) 0);
                {
                    while (1) {
                        if (!(res_172321 <= HEX3Atmp_172319)) goto LA48;
                        h_172317 = res_172321;
                        {
                            NimStringDesc* res_172325;
                            if (!!((*packages).data->data[h_172317].Field0 == 0)) goto LA51;
                            key_172313 = (*packages).data->data[h_172317].Field0;
                            val_172315 = (*packages).data->data[h_172317].Field1;
                            {
                                if (!eqStrings(val_172315, ((NimStringDesc*) &TMP1660))) goto LA55;
                                res_172325 = key_172313;
                            }
                            goto LA53;
LA55:
                            ;
                            {
                                NimStringDesc* LOC58;
                                LOC58 = 0;
                                LOC58 = rawNewString(key_172313->Sup.len + val_172315->Sup.len + 1);
                                appendString(LOC58, key_172313);
                                appendChar(LOC58, 45);
                                appendString(LOC58, val_172315);
                                res_172325 = LOC58;
                            }
LA53:
                            ;
                            p_172295 = res_172325;
                            addnimblepath_172175(p_172295, info);
                        }
LA51:
                        ;
                        res_172321 += ((NI) 1);
                    }
LA48:
                    ;
                }
            }
        }
    }
}
예제 #29
0
파일: highlite.c 프로젝트: ddlsmurf/Nimrod
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*) &TMP197262));
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 (!((TMP197263[((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 (!((TMP197263[((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*) &TMP197264));
appendString(LOC67, LOC68);
Internalerror_48163(LOC67);
LA65: ;
(*G_153514).Pos = Pos_153521;
}
예제 #30
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;
}