mirror of
https://github.com/status-im/csources-nimble.git
synced 2026-08-29 17:31:05 +00:00
253 lines
12 KiB
C
253 lines
12 KiB
C
/* Generated by Nim Compiler v1.6.11 */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
# define nimfr_(proc, file) \
|
|
TFrame FR_; \
|
|
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
|
|
|
|
# define nimfrs_(proc, file, slots, length) \
|
|
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
|
|
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
|
|
|
|
# define nimln_(n, file) \
|
|
FR_.line = n; FR_.filename = file;
|
|
typedef struct NimStringDesc NimStringDesc;
|
|
typedef struct TGenericSeq TGenericSeq;
|
|
typedef struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
|
|
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
|
|
struct TGenericSeq {
|
|
NI len;
|
|
NI reserved;
|
|
};
|
|
struct NimStringDesc {
|
|
TGenericSeq Sup;
|
|
NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
|
|
NimStringDesc* Field0;
|
|
NimStringDesc* Field1;
|
|
NimStringDesc* Field2;
|
|
};
|
|
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
|
|
NI a;
|
|
NI b;
|
|
};
|
|
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7802)(NimStringDesc* s, NI first);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isValidSha1Hash__stdZsha49_949)(NimStringDesc* s);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7790)(NimStringDesc* s, NI first, NI last);
|
|
static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_867)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
|
|
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
|
|
static N_INLINE(void, nimFrame)(TFrame* s);
|
|
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_2997)(void);
|
|
static N_INLINE(void, popFrame)(void);
|
|
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___pureZunicode_842)(NI a, NI b);
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
|
|
STRING_LITERAL(TM__asNQM9aynXXg9ccUABbReyew_3, "-#", 2);
|
|
extern TFrame* framePtr__system_2564;
|
|
extern TFrame* framePtr__system_2564;
|
|
extern TFrame* framePtr__system_2564;
|
|
extern TFrame* framePtr__system_2564;
|
|
extern TFrame* framePtr__system_2564;
|
|
extern TFrame* framePtr__system_2564;
|
|
static N_INLINE(void, nimFrame)(TFrame* s) {
|
|
{
|
|
if (!(framePtr__system_2564 == ((TFrame*) NIM_NIL))) goto LA3_;
|
|
(*s).calldepth = ((NI16) 0);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
(*s).calldepth = (NI16)((*framePtr__system_2564).calldepth + ((NI16) 1));
|
|
}
|
|
LA1_: ;
|
|
(*s).prev = framePtr__system_2564;
|
|
framePtr__system_2564 = s;
|
|
{
|
|
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
|
|
callDepthLimitReached__system_2997();
|
|
}
|
|
LA8_: ;
|
|
}
|
|
static N_INLINE(void, popFrame)(void) {
|
|
framePtr__system_2564 = (*framePtr__system_2564).prev;
|
|
}
|
|
static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_867)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x) {
|
|
NimStringDesc* result;
|
|
NI a;
|
|
NI L;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_10;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_11;
|
|
nimfr_("[]", "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2563, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
a = x.a;
|
|
nimln_(2564, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
if (nimSubInt(x.b, a, &TM__asNQM9aynXXg9ccUABbReyew_10)) { raiseOverflow(); };
|
|
if (nimAddInt((NI)(TM__asNQM9aynXXg9ccUABbReyew_10), ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_11)) { raiseOverflow(); };
|
|
L = (NI)(TM__asNQM9aynXXg9ccUABbReyew_11);
|
|
nimln_(2565, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
if ((L) < ((NI) 0) || (L) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(L, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) (L)));
|
|
{
|
|
NI i;
|
|
NI i_2;
|
|
i = (NI)0;
|
|
nimln_(119, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system/iterators_1.nim");
|
|
i_2 = ((NI) 0);
|
|
{
|
|
nimln_(120, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_12;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_13;
|
|
if (!(i_2 < L)) goto LA3;
|
|
nimln_(2566, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
i = i_2;
|
|
if (i < 0 || i >= (result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
|
|
if (nimAddInt(i, a, &TM__asNQM9aynXXg9ccUABbReyew_12)) { raiseOverflow(); };
|
|
if ((NI)(TM__asNQM9aynXXg9ccUABbReyew_12) < 0 || (NI)(TM__asNQM9aynXXg9ccUABbReyew_12) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__asNQM9aynXXg9ccUABbReyew_12),(s ? s->Sup.len : 0)-1); }
|
|
result->data[i] = s->data[(NI)(TM__asNQM9aynXXg9ccUABbReyew_12)];
|
|
nimln_(122, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system/iterators_1.nim");
|
|
if (nimAddInt(i_2, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_13)) { raiseOverflow(); };
|
|
i_2 = (NI)(TM__asNQM9aynXXg9ccUABbReyew_13);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memset(a, v, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
nimSetMem__systemZmemory_7(p, ((int) 0), size);
|
|
}
|
|
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___pureZunicode_842)(NI a, NI b) {
|
|
tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
|
|
nimfr_("..", "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
|
|
nimln_(512, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
|
|
result.a = a;
|
|
result.b = b;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, getPathVersionChecksum__OOZOOZOOZOOZOchoosenimZtoolchainsZnim4535version45494554ZcompilerZnimblecmd_171)(NimStringDesc* p, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result) {
|
|
NI checksumSeparatorIndex;
|
|
NI versionSeparatorIndex;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_4;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_14;
|
|
tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T21_;
|
|
nimfr_("getPathVersionChecksum", "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
unsureAsgnRef((void**)&(*Result).Field0, NIM_NIL);
|
|
unsureAsgnRef((void**)&(*Result).Field1, NIM_NIL);
|
|
unsureAsgnRef((void**)&(*Result).Field2, NIM_NIL);
|
|
nimln_(76, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
checksumSeparatorIndex = nsuRFindChar(p, 45, ((NI) 0), ((NI) -1));
|
|
nimln_(77, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
{
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_2;
|
|
if (!!((checksumSeparatorIndex == ((NI) -1)))) goto LA3_;
|
|
nimln_(78, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
if (nimAddInt(checksumSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_2)) { raiseOverflow(); };
|
|
unsureAsgnRef((void**) (&(*Result).Field2), substr__system_7802(p, (NI)(TM__asNQM9aynXXg9ccUABbReyew_2)));
|
|
nimln_(79, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
{
|
|
NIM_BOOL T7_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T7_ = isValidSha1Hash__stdZsha49_949((*Result).Field2);
|
|
if (!!(T7_)) goto LA8_;
|
|
nimln_(80, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
unsureAsgnRef((void**) (&(*Result).Field2), ((NimStringDesc*) NIM_NIL));
|
|
nimln_(81, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
checksumSeparatorIndex = (p ? p->Sup.len : 0);
|
|
}
|
|
LA8_: ;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(83, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
checksumSeparatorIndex = (p ? p->Sup.len : 0);
|
|
}
|
|
LA1_: ;
|
|
nimln_(85, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
nimln_(86, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
if (nimSubInt(checksumSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_4)) { raiseOverflow(); };
|
|
nimln_(85, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
versionSeparatorIndex = nsuRFindStr(p, ((NimStringDesc*) &TM__asNQM9aynXXg9ccUABbReyew_3), ((NI) 0), (NI)(TM__asNQM9aynXXg9ccUABbReyew_4));
|
|
nimln_(87, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
{
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_5;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_6;
|
|
if (!!((versionSeparatorIndex == ((NI) -1)))) goto LA13_;
|
|
nimln_(88, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
nimln_(89, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
if (nimAddInt(versionSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_5)) { raiseOverflow(); };
|
|
if (nimSubInt(checksumSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_6)) { raiseOverflow(); };
|
|
nimln_(88, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
unsureAsgnRef((void**) (&(*Result).Field1), substr__system_7790(p, (NI)(TM__asNQM9aynXXg9ccUABbReyew_5), (NI)(TM__asNQM9aynXXg9ccUABbReyew_6)));
|
|
}
|
|
goto LA11_;
|
|
LA13_: ;
|
|
{
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_7;
|
|
nimln_(91, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
nimln_(92, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
if (nimSubInt(checksumSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_7)) { raiseOverflow(); };
|
|
nimln_(91, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
versionSeparatorIndex = nsuRFindChar(p, 45, ((NI) 0), (NI)(TM__asNQM9aynXXg9ccUABbReyew_7));
|
|
nimln_(93, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
{
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_8;
|
|
NI TM__asNQM9aynXXg9ccUABbReyew_9;
|
|
if (!!((versionSeparatorIndex == ((NI) -1)))) goto LA18_;
|
|
nimln_(94, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
nimln_(95, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
if (nimAddInt(versionSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_8)) { raiseOverflow(); };
|
|
if (nimSubInt(checksumSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_9)) { raiseOverflow(); };
|
|
nimln_(94, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
unsureAsgnRef((void**) (&(*Result).Field1), substr__system_7790(p, (NI)(TM__asNQM9aynXXg9ccUABbReyew_8), (NI)(TM__asNQM9aynXXg9ccUABbReyew_9)));
|
|
}
|
|
goto LA16_;
|
|
LA18_: ;
|
|
{
|
|
nimln_(97, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
versionSeparatorIndex = checksumSeparatorIndex;
|
|
}
|
|
LA16_: ;
|
|
}
|
|
LA11_: ;
|
|
nimln_(99, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
nimln_(2533, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/lib/system.nim");
|
|
if (nimSubInt(versionSeparatorIndex, ((NI) 1), &TM__asNQM9aynXXg9ccUABbReyew_14)) { raiseOverflow(); };
|
|
nimln_(99, "/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/compiler/nimblecmd.nim");
|
|
T21_ = dotdot___pureZunicode_842(((NI) 0), (NI)(TM__asNQM9aynXXg9ccUABbReyew_14));
|
|
unsureAsgnRef((void**) (&(*Result).Field0), X5BX5D___pureZunicode_867(p, T21_));
|
|
popFrame();
|
|
}
|