1804 lines
54 KiB
C
1804 lines
54 KiB
C
/* Generated by Nim Compiler v1.9.0 */
|
|
#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_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct NimStrPayload NimStrPayload;
|
|
typedef struct NimStringV2 NimStringV2;
|
|
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
|
|
typedef struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
|
|
typedef struct tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw;
|
|
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
|
|
typedef struct Exception Exception;
|
|
typedef struct RootObj RootObj;
|
|
typedef struct TNimTypeV2 TNimTypeV2;
|
|
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
|
|
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
|
|
typedef struct tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A;
|
|
typedef struct tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg;
|
|
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
|
|
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
|
|
struct NimStrPayload {
|
|
NI cap;
|
|
NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
struct NimStringV2 {
|
|
NI len;
|
|
NimStrPayload* p;
|
|
};
|
|
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
|
|
NimStringV2 Field0;
|
|
NimStringV2 Field1;
|
|
};
|
|
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
|
|
NimStringV2 Field0;
|
|
NimStringV2 Field1;
|
|
NimStringV2 Field2;
|
|
};
|
|
struct TNimTypeV2 {
|
|
void* destructor;
|
|
NI size;
|
|
NI16 align;
|
|
NI16 depth;
|
|
NU32* display;
|
|
void* traceImpl;
|
|
void* typeInfoV1;
|
|
NI flags;
|
|
};
|
|
struct RootObj {
|
|
TNimTypeV2* m_type;
|
|
};
|
|
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
|
|
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
|
|
};
|
|
struct Exception {
|
|
RootObj Sup;
|
|
Exception* parent;
|
|
NCSTRING name;
|
|
NimStringV2 message;
|
|
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
|
|
Exception* up;
|
|
};
|
|
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
|
|
Exception Sup;
|
|
};
|
|
struct tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw {
|
|
tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
|
|
};
|
|
struct tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A {
|
|
NI bytes;
|
|
NI16* data;
|
|
};
|
|
typedef N_STDCALL_PTR(NI32, tyProc__aMOow6Lp4fo8dW2ko9aU3pg) (NI32 nBufferLength, NI16* lpBuffer);
|
|
typedef NI16 tyUncheckedArray__Tyd4y3haUOOHTj71TPIRag[1];
|
|
struct tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg {
|
|
NI i;
|
|
NI prev;
|
|
NIM_BOOL notFirst;
|
|
};
|
|
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
|
|
NI Field0;
|
|
NI Field1;
|
|
};
|
|
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
|
|
NCSTRING procname;
|
|
NI line;
|
|
NCSTRING filename;
|
|
};
|
|
|
|
|
|
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
|
|
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
|
|
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
|
|
#endif
|
|
|
|
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src);
|
|
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space);
|
|
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s, NI addlen);
|
|
static N_INLINE(void, nimAddCharV1)(NimStringV2* s, NIM_CHAR c);
|
|
N_NIMCALL(NimStringV2, rawNewString)(NI cap);
|
|
N_LIB_PRIVATE N_NIMCALL(void, joinPathImpl__stdZprivateZospaths50_51)(NimStringV2* result, NI* state, NimStringV2 tail);
|
|
static N_INLINE(NIM_CHAR, X5BX5D___system_7090)(NimStringV2 s, NI i);
|
|
static N_INLINE(NIM_CHAR*, X5BX5D___system_7129)(NimStringV2* s, NI i);
|
|
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_2301)(NimStringV2* s);
|
|
N_LIB_PRIVATE N_NIMCALL(void, normalizePathEnd__stdZprivateZospaths50_22)(NimStringV2* path, NIM_BOOL trailingSep);
|
|
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s, NI newLen);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZassertions_19)(NimStringV2* dest, NimStringV2 src);
|
|
N_LIB_PRIVATE N_NIMCALL(void, addNormalizePath__pureZpathnorm_78)(NimStringV2 x, NimStringV2* result, NI* state, NIM_CHAR dirSep);
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, normalizePathEnd__stdZprivateZospaths50_44)(NimStringV2 path, NIM_BOOL trailingSep);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___stdZassertions_16)(NimStringV2* dest, NimStringV2 src);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosextractFilename)(NimStringV2 path);
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringV2 path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result);
|
|
N_LIB_PRIVATE N_NIMCALL(void, splitDrive__stdZprivateZntpath_2)(NimStringV2 p, tyTuple__UV3llMMYFckfui8YMBuUZA* Result);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_7601)(NimStringV2 s, NI first, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_7613)(NimStringV2 s, NI first);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZassertions_13)(NimStringV2* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZntpath_116)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, normalizePath__pureZpathnorm_158)(NimStringV2 path, NIM_CHAR dirSep);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, cmp__system_1543)(NimStringV2 x, NimStringV2 y);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringV2 a, NimStringV2 b);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosrelativePath)(NimStringV2 path, NimStringV2 base, NIM_CHAR sep);
|
|
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a, NimStringV2 b);
|
|
static N_INLINE(NIM_BOOL, equalMem__system_1727)(void* a, void* b, NI size);
|
|
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
|
|
static N_INLINE(void, normalizePathAux__stdZprivateZospaths50_17)(NimStringV2* path);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nosnormalizePath)(NimStringV2* path);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringV2 path);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, absolutePathInternal__stdZprivateZospaths50_20)(NimStringV2 path);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, absolutePath__stdZprivateZospaths50_378)(NimStringV2 path, NimStringV2 root);
|
|
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size, NI alignment);
|
|
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosjoinPath)(NimStringV2 head, NimStringV2 tail);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetCurrentDir)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A, newWideCString__stdZwidestrs_260)(NCSTRING source, NI L);
|
|
static N_INLINE(NI16*, toWideCString__stdZwidestrs_41)(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A x);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_86)(NI32 errorCode, NimStringV2 additionalInfo);
|
|
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_89)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZwidestrs_27)(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A* a, tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A b);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___stdZwidestrs_359)(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A s, NI estimate, NI replacement);
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZwidestrs_6)(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A* a);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, sameRoot__stdZprivateZospaths50_140)(NimStringV2 path1, NimStringV2 path2);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isAbsFromCurrentDrive__stdZprivateZospaths50_133)(NimStringV2 path);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasNext__pureZpathnorm_6)(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg it, NimStringV2 x);
|
|
N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, next__pureZpathnorm_10)(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg* it, NimStringV2 x);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuStartsWith)(NimStringV2 s, NimStringV2 prefix);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, parentDirPos__stdZprivateZospaths50_194)(NimStringV2 path);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__stdZprivateZospaths50_283)(NimStringV2 path);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, normExt__stdZprivateZospaths50_280)(NimStringV2 ext);
|
|
static N_INLINE(void, appendChar)(NimStringV2* dest, NIM_CHAR c);
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[0+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_2 = { 0 | NIM_STRLIT_FLAG, "" };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_3 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[2+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_4 = { 2 | NIM_STRLIT_FLAG, ":\\" };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_5 = {2, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_4};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[1+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_6 = { 1 | NIM_STRLIT_FLAG, "\\" };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_7 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_6};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[1+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_8 = { 1 | NIM_STRLIT_FLAG, "." };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_9 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_8};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_10 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[3+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_11 = { 3 | NIM_STRLIT_FLAG, "..\\" };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_12 = {3, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_11};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_13 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_6};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_14 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_15 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_16 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_8};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_17 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
extern TNimTypeV2 NTIv2__ke0esfQKJkTSUu9bpZ7VlFw_;
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[36+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_18 = { 36 | NIM_STRLIT_FLAG, "The specified root is not absolute: " };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_19 = {36, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_18};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_20 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const struct {
|
|
NI cap; NIM_CHAR data[2+1];
|
|
} TM__O1zDbSYyG8zQytyoZAh0dg_22 = { 2 | NIM_STRLIT_FLAG, ".." };
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_23 = {2, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_22};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_24 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_8};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_25 = {2, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_22};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_26 = {2, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_22};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_27 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_8};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_28 = {0, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_2};
|
|
static const NimStringV2 TM__O1zDbSYyG8zQytyoZAh0dg_29 = {1, (NimStrPayload*)&TM__O1zDbSYyG8zQytyoZAh0dg_8};
|
|
static NIM_CONST tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ TM__O1zDbSYyG8zQytyoZAh0dg_21 = {((NI)0),
|
|
((NI)-1)}
|
|
;
|
|
extern NIM_BOOL nimInErrorMode__system_3980;
|
|
extern tyProc__aMOow6Lp4fo8dW2ko9aU3pg Dl_1442840761_;
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memcpy(dest, source, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size) {
|
|
nimCopyMem(dest, source, size);
|
|
}
|
|
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {
|
|
{
|
|
if (!(((NI)0) < src.len)) goto LA3_;
|
|
copyMem__system_1719(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI)0)]))), ((NI) ((NI)(src.len + ((NI)1)))));
|
|
(*dest).len += src.len;
|
|
}
|
|
LA3_: ;
|
|
}
|
|
static N_INLINE(void, nimAddCharV1)(NimStringV2* s, NIM_CHAR c) {
|
|
prepareAdd(s, ((NI)1));
|
|
(*(*s).p).data[(*s).len] = c;
|
|
(*(*s).p).data[(NI)((*s).len + ((NI)1))] = 0;
|
|
(*s).len += ((NI)1);
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosunixToNativePath)(NimStringV2 path, NimStringV2 drive) {
|
|
NimStringV2 result;
|
|
NI start;
|
|
NI i;
|
|
{ result.len = 0; result.p = NIM_NIL;
|
|
{
|
|
if (!(path.len == ((NI)0))) goto LA3_;
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_3;
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
start = (NI)0;
|
|
{
|
|
if (!((NU8)(path.p->data[((NI)0)]) == (NU8)(47))) goto LA7_;
|
|
{
|
|
NimStringV2 T13_;
|
|
if (!!((drive.len == 0))) goto LA11_;
|
|
T13_.len = 0; T13_.p = NIM_NIL;
|
|
T13_ = rawNewString(drive.len + 2);
|
|
appendString((&T13_), drive);
|
|
appendString((&T13_), TM__O1zDbSYyG8zQytyoZAh0dg_5);
|
|
result = T13_;
|
|
}
|
|
goto LA9_;
|
|
LA11_: ;
|
|
{
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_7;
|
|
}
|
|
LA9_: ;
|
|
start = ((NI)1);
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
NIM_BOOL T16_;
|
|
NIM_BOOL T18_;
|
|
T16_ = (NIM_BOOL)0;
|
|
T16_ = ((NU8)(path.p->data[((NI)0)]) == (NU8)(46));
|
|
if (!(T16_)) goto LA17_;
|
|
T18_ = (NIM_BOOL)0;
|
|
T18_ = (path.len == ((NI)1));
|
|
if (T18_) goto LA19_;
|
|
T18_ = ((NU8)(path.p->data[((NI)1)]) == (NU8)(47));
|
|
LA19_: ;
|
|
T16_ = T18_;
|
|
LA17_: ;
|
|
if (!T16_) goto LA20_;
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_9;
|
|
start = ((NI)1);
|
|
}
|
|
goto LA5_;
|
|
LA20_: ;
|
|
{
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_10;
|
|
start = ((NI)0);
|
|
}
|
|
LA5_: ;
|
|
i = start;
|
|
{
|
|
while (1) {
|
|
if (!(i < path.len)) goto LA24 ;
|
|
{
|
|
NIM_BOOL T27_;
|
|
NIM_BOOL T28_;
|
|
NIM_BOOL T29_;
|
|
T27_ = (NIM_BOOL)0;
|
|
T28_ = (NIM_BOOL)0;
|
|
T29_ = (NIM_BOOL)0;
|
|
T29_ = ((NI)(i + ((NI)2)) < path.len);
|
|
if (!(T29_)) goto LA30_;
|
|
T29_ = ((NU8)(path.p->data[i]) == (NU8)(46));
|
|
LA30_: ;
|
|
T28_ = T29_;
|
|
if (!(T28_)) goto LA31_;
|
|
T28_ = ((NU8)(path.p->data[(NI)(i + ((NI)1))]) == (NU8)(46));
|
|
LA31_: ;
|
|
T27_ = T28_;
|
|
if (!(T27_)) goto LA32_;
|
|
T27_ = ((NU8)(path.p->data[(NI)(i + ((NI)2))]) == (NU8)(47));
|
|
LA32_: ;
|
|
if (!T27_) goto LA33_;
|
|
prepareAdd((&result), 3);
|
|
appendString((&result), TM__O1zDbSYyG8zQytyoZAh0dg_12);
|
|
i += ((NI)3);
|
|
}
|
|
goto LA25_;
|
|
LA33_: ;
|
|
{
|
|
if (!((NU8)(path.p->data[i]) == (NU8)(47))) goto LA36_;
|
|
nimAddCharV1((&result), 92);
|
|
i += ((NI)1);
|
|
}
|
|
goto LA25_;
|
|
LA36_: ;
|
|
{
|
|
nimAddCharV1((&result), path.p->data[i]);
|
|
i += ((NI)1);
|
|
}
|
|
LA25_: ;
|
|
} LA24: ;
|
|
}
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_CHAR, X5BX5D___system_7090)(NimStringV2 s, NI i) {
|
|
NIM_CHAR result;
|
|
result = (NIM_CHAR)0;
|
|
result = s.p->data[(NI)(s.len - i)];
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s) {
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = !(((*s).p == ((NimStrPayload*) NIM_NIL)));
|
|
if (!(T3_)) goto LA4_;
|
|
T3_ = ((NI)((*(*s).p).cap & ((NI)IL64(4611686018427387904))) == ((NI)IL64(4611686018427387904)));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
nimPrepareStrMutationImpl__system_2301(s);
|
|
}
|
|
LA5_: ;
|
|
}
|
|
static N_INLINE(NIM_CHAR*, X5BX5D___system_7129)(NimStringV2* s, NI i) {
|
|
NIM_CHAR* result;
|
|
result = (NIM_CHAR*)0;
|
|
nimPrepareStrMutationV2((&(*s)));
|
|
result = (&(*s).p->data[(NI)((*s).len - i)]);
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, normalizePathEnd__stdZprivateZospaths50_22)(NimStringV2* path, NIM_BOOL trailingSep) {
|
|
NI i;
|
|
{ {
|
|
if (!((*path).len == ((NI)0))) goto LA3_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
i = (*path).len;
|
|
{
|
|
while (1) {
|
|
if (!(((NI)1) <= i)) goto LA6 ;
|
|
{
|
|
if (!(((NU8)((*path).p->data[(NI)(i - ((NI)1))])) == ((NU8)(92)) || ((NU8)((*path).p->data[(NI)(i - ((NI)1))])) == ((NU8)(47)))) goto LA9_;
|
|
i -= ((NI)1);
|
|
}
|
|
goto LA7_;
|
|
LA9_: ;
|
|
{
|
|
NIM_BOOL T12_;
|
|
NIM_BOOL T13_;
|
|
T12_ = (NIM_BOOL)0;
|
|
T13_ = (NIM_BOOL)0;
|
|
T13_ = ((NU8)((*path).p->data[(NI)(i - ((NI)1))]) == (NU8)(46));
|
|
if (!(T13_)) goto LA14_;
|
|
T13_ = (((NI)2) <= i);
|
|
LA14_: ;
|
|
T12_ = T13_;
|
|
if (!(T12_)) goto LA15_;
|
|
T12_ = (((NU8)((*path).p->data[(NI)(i - ((NI)2))])) == ((NU8)(92)) || ((NU8)((*path).p->data[(NI)(i - ((NI)2))])) == ((NU8)(47)));
|
|
LA15_: ;
|
|
if (!T12_) goto LA16_;
|
|
i -= ((NI)1);
|
|
}
|
|
goto LA7_;
|
|
LA16_: ;
|
|
{
|
|
goto LA5;
|
|
}
|
|
LA7_: ;
|
|
} LA6: ;
|
|
} LA5: ;
|
|
{
|
|
if (!trailingSep) goto LA21_;
|
|
setLengthStrV2((&(*path)), ((NI) (i)));
|
|
nimAddCharV1((&(*path)), 92);
|
|
}
|
|
goto LA19_;
|
|
LA21_: ;
|
|
{
|
|
if (!(((NI)0) < i)) goto LA24_;
|
|
setLengthStrV2((&(*path)), ((NI) (i)));
|
|
}
|
|
goto LA19_;
|
|
LA24_: ;
|
|
{
|
|
eqsink___stdZassertions_19((&(*path)), TM__O1zDbSYyG8zQytyoZAh0dg_13);
|
|
}
|
|
LA19_: ;
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
|
|
NIM_BOOL* result;
|
|
result = (NIM_BOOL*)0;
|
|
result = (&nimInErrorMode__system_3980);
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, joinPathImpl__stdZprivateZospaths50_51)(NimStringV2* result, NI* state, NimStringV2 tail) {
|
|
NIM_BOOL trailingSep;
|
|
NIM_BOOL T1_;
|
|
NIM_BOOL T2_;
|
|
NIM_CHAR T4_;
|
|
NIM_BOOL T6_;
|
|
NIM_BOOL T8_;
|
|
NIM_CHAR* T10_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
T1_ = (NIM_BOOL)0;
|
|
T2_ = (NIM_BOOL)0;
|
|
T2_ = (((NI)0) < tail.len);
|
|
if (!(T2_)) goto LA3_;
|
|
T4_ = (NIM_CHAR)0;
|
|
T4_ = X5BX5D___system_7090(tail, ((NI)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T2_ = (((NU8)(T4_)) == ((NU8)(92)) || ((NU8)(T4_)) == ((NU8)(47)));
|
|
LA3_: ;
|
|
T1_ = T2_;
|
|
if (T1_) goto LA5_;
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (tail.len == ((NI)0));
|
|
if (!(T6_)) goto LA7_;
|
|
T8_ = (NIM_BOOL)0;
|
|
T8_ = (((NI)0) < (*result).len);
|
|
if (!(T8_)) goto LA9_;
|
|
T10_ = (NIM_CHAR*)0;
|
|
T10_ = X5BX5D___system_7129(result, ((NI)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T8_ = (((NU8)((*T10_))) == ((NU8)(92)) || ((NU8)((*T10_))) == ((NU8)(47)));
|
|
LA9_: ;
|
|
T6_ = T8_;
|
|
LA7_: ;
|
|
T1_ = T6_;
|
|
LA5_: ;
|
|
trailingSep = T1_;
|
|
normalizePathEnd__stdZprivateZospaths50_22(result, NIM_FALSE);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
addNormalizePath__pureZpathnorm_78(tail, result, state, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
normalizePathEnd__stdZprivateZospaths50_22(result, trailingSep);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosjoinPath)(NimStringV2 head, NimStringV2 tail) {
|
|
NimStringV2 result;
|
|
NI state;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
result = rawNewString(((NI) ((NI)(head.len + tail.len))));
|
|
state = ((NI)0);
|
|
joinPathImpl__stdZprivateZospaths50_51((&result), (&state), head);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
joinPathImpl__stdZprivateZospaths50_51((&result), (&state), tail);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, normalizePathEnd__stdZprivateZospaths50_44)(NimStringV2 path, NIM_BOOL trailingSep) {
|
|
NimStringV2 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&result), path);
|
|
normalizePathEnd__stdZprivateZospaths50_22((&result), trailingSep);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
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) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimSetMem__systemZmemory_7(p, ((int)0), size);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringV2 path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result) {
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmp_;
|
|
NimStringV2 colontmpD_;
|
|
NimStringV2 drive;
|
|
NimStringV2 splitpath;
|
|
NI stop;
|
|
NI sepPos;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)Result, sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
nimZeroMem((void*)(&colontmp_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
drive.len = 0; drive.p = NIM_NIL;
|
|
splitpath.len = 0; splitpath.p = NIM_NIL;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), path);
|
|
splitDrive__stdZprivateZntpath_2(colontmpD_, (&colontmp_));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
drive = colontmp_.Field0;
|
|
splitpath = colontmp_.Field1;
|
|
stop = drive.len;
|
|
sepPos = ((NI)-1);
|
|
{
|
|
NI i;
|
|
NI colontmp__2;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp__2 = (NI)0;
|
|
colontmp__2 = (NI)(path.len - ((NI)1));
|
|
res = colontmp__2;
|
|
{
|
|
while (1) {
|
|
if (!(stop <= res)) goto LA4 ;
|
|
i = res;
|
|
{
|
|
if (!(((NU8)(path.p->data[i])) == ((NU8)(92)) || ((NU8)(path.p->data[i])) == ((NU8)(47)))) goto LA7_;
|
|
sepPos = i;
|
|
goto LA2;
|
|
}
|
|
LA7_: ;
|
|
res -= ((NI)1);
|
|
} LA4: ;
|
|
}
|
|
} LA2: ;
|
|
{
|
|
NI colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI T13_;
|
|
NimStringV2 T20_;
|
|
NimStringV2 T21_;
|
|
if (!(((NI)0) <= sepPos)) goto LA11_;
|
|
colontmpD__2 = (NI)0;
|
|
colontmpD__3 = (NI)0;
|
|
T13_ = (NI)0;
|
|
{
|
|
NIM_BOOL T16_;
|
|
T16_ = (NIM_BOOL)0;
|
|
T16_ = NIM_LIKELY((((NI)1) <= sepPos));
|
|
if (!T16_) goto LA17_;
|
|
colontmpD__2 = (NI)(sepPos - ((NI)1));
|
|
T13_ = colontmpD__2;
|
|
}
|
|
goto LA14_;
|
|
LA17_: ;
|
|
{
|
|
colontmpD__3 = ((NI)0);
|
|
T13_ = colontmpD__3;
|
|
}
|
|
LA14_: ;
|
|
T20_.len = 0; T20_.p = NIM_NIL;
|
|
T20_ = substr__system_7601(path, ((NI)0), T13_);
|
|
eqsink___stdZassertions_19((&(*Result).Field0), T20_);
|
|
T21_.len = 0; T21_.p = NIM_NIL;
|
|
T21_ = substr__system_7613(path, (NI)(sepPos + ((NI)1)));
|
|
eqsink___stdZassertions_19((&(*Result).Field1), T21_);
|
|
}
|
|
goto LA9_;
|
|
LA11_: ;
|
|
{
|
|
eqsink___stdZassertions_19((&(*Result).Field0), drive);
|
|
drive.len = 0; drive.p = NIM_NIL;
|
|
eqsink___stdZassertions_19((&(*Result).Field1), splitpath);
|
|
splitpath.len = 0; splitpath.p = NIM_NIL;
|
|
}
|
|
LA9_: ;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&path));
|
|
eqdestroy___stdZassertions_13((&splitpath));
|
|
eqdestroy___stdZassertions_13((&drive));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosextractFilename)(NimStringV2 path) {
|
|
NimStringV2 result;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = (path.len == ((NI)0));
|
|
if (T3_) goto LA4_;
|
|
T3_ = (((NU8)(path.p->data[(NI)(path.len - ((NI)1))])) == ((NU8)(92)) || ((NU8)(path.p->data[(NI)(path.len - ((NI)1))])) == ((NU8)(47)));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_14;
|
|
}
|
|
goto LA1_;
|
|
LA5_: ;
|
|
{
|
|
NimStringV2 colontmpD_;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmpD__2;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmpD__2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), path);
|
|
nossplitPath(colontmpD_, (&colontmpD__2));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
eqcopy___stdZassertions_16((&result), colontmpD__2.Field1);
|
|
eqdestroy___stdZprivateZntpath_116((&colontmpD__2));
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, noslastPathPart)(NimStringV2 path) {
|
|
NimStringV2 result;
|
|
NimStringV2 path_2;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
path_2.len = 0; path_2.p = NIM_NIL;
|
|
path_2 = normalizePathEnd__stdZprivateZospaths50_44(path, NIM_FALSE);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
result = nosextractFilename(path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
eqdestroy___stdZassertions_13((&path_2));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, noscmpPaths)(NimStringV2 pathA, NimStringV2 pathB) {
|
|
NI result;
|
|
NimStringV2 a;
|
|
NimStringV2 b;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NI)0;
|
|
a.len = 0; a.p = NIM_NIL;
|
|
b.len = 0; b.p = NIM_NIL;
|
|
a = normalizePath__pureZpathnorm_158(pathA, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
b = normalizePath__pureZpathnorm_158(pathB, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
if (!NIM_FALSE) goto LA3_;
|
|
result = cmp__system_1543(a, b);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
result = nsuCmpIgnoreCase(a, b);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA1_: ;
|
|
eqdestroy___stdZassertions_13((&b));
|
|
eqdestroy___stdZassertions_13((&a));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nossplitFile)(NimStringV2 path, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result) {
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmp_;
|
|
NimStringV2 colontmpD_;
|
|
NimStringV2 drive;
|
|
NimStringV2 _;
|
|
NI namePos;
|
|
NI dotPos;
|
|
NI stop;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nimZeroMem((void*)Result, sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
|
|
nimZeroMem((void*)(&colontmp_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
drive.len = 0; drive.p = NIM_NIL;
|
|
_.len = 0; _.p = NIM_NIL;
|
|
namePos = ((NI)0);
|
|
dotPos = ((NI)0);
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), path);
|
|
splitDrive__stdZprivateZntpath_2(colontmpD_, (&colontmp_));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
drive = colontmp_.Field0;
|
|
_ = colontmp_.Field1;
|
|
stop = drive.len;
|
|
eqsink___stdZassertions_19((&(*Result).Field0), drive);
|
|
{
|
|
NI i;
|
|
NI colontmp__2;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp__2 = (NI)0;
|
|
colontmp__2 = (NI)(path.len - ((NI)1));
|
|
res = colontmp__2;
|
|
{
|
|
while (1) {
|
|
if (!(stop <= res)) goto LA4 ;
|
|
i = res;
|
|
{
|
|
NIM_BOOL T7_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T7_ = (((NU8)(path.p->data[i])) == ((NU8)(92)) || ((NU8)(path.p->data[i])) == ((NU8)(47)));
|
|
if (T7_) goto LA8_;
|
|
T7_ = (i == ((NI)0));
|
|
LA8_: ;
|
|
if (!T7_) goto LA9_;
|
|
{
|
|
NI colontmpD__2;
|
|
NI colontmpD__3;
|
|
NI T15_;
|
|
NimStringV2 T22_;
|
|
if (!(((NU8)(path.p->data[i])) == ((NU8)(92)) || ((NU8)(path.p->data[i])) == ((NU8)(47)))) goto LA13_;
|
|
colontmpD__2 = (NI)0;
|
|
colontmpD__3 = (NI)0;
|
|
T15_ = (NI)0;
|
|
{
|
|
NIM_BOOL T18_;
|
|
T18_ = (NIM_BOOL)0;
|
|
T18_ = NIM_LIKELY((((NI)1) <= i));
|
|
if (!T18_) goto LA19_;
|
|
colontmpD__2 = (NI)(i - ((NI)1));
|
|
T15_ = colontmpD__2;
|
|
}
|
|
goto LA16_;
|
|
LA19_: ;
|
|
{
|
|
colontmpD__3 = ((NI)0);
|
|
T15_ = colontmpD__3;
|
|
}
|
|
LA16_: ;
|
|
T22_.len = 0; T22_.p = NIM_NIL;
|
|
T22_ = substr__system_7601(path, ((NI)0), T15_);
|
|
eqsink___stdZassertions_19((&(*Result).Field0), T22_);
|
|
namePos = (NI)(i + ((NI)1));
|
|
}
|
|
LA13_: ;
|
|
{
|
|
NimStringV2 T27_;
|
|
NimStringV2 T28_;
|
|
if (!(i < dotPos)) goto LA25_;
|
|
T27_.len = 0; T27_.p = NIM_NIL;
|
|
T27_ = substr__system_7601(path, namePos, (NI)(dotPos - ((NI)1)));
|
|
eqsink___stdZassertions_19((&(*Result).Field1), T27_);
|
|
T28_.len = 0; T28_.p = NIM_NIL;
|
|
T28_ = substr__system_7613(path, dotPos);
|
|
eqsink___stdZassertions_19((&(*Result).Field2), T28_);
|
|
}
|
|
goto LA23_;
|
|
LA25_: ;
|
|
{
|
|
NimStringV2 T30_;
|
|
T30_.len = 0; T30_.p = NIM_NIL;
|
|
T30_ = substr__system_7613(path, namePos);
|
|
eqsink___stdZassertions_19((&(*Result).Field1), T30_);
|
|
}
|
|
LA23_: ;
|
|
goto LA2;
|
|
}
|
|
goto LA5_;
|
|
LA9_: ;
|
|
{
|
|
NIM_BOOL T32_;
|
|
NIM_BOOL T33_;
|
|
NIM_BOOL T34_;
|
|
NIM_BOOL T35_;
|
|
NIM_BOOL T36_;
|
|
T32_ = (NIM_BOOL)0;
|
|
T33_ = (NIM_BOOL)0;
|
|
T34_ = (NIM_BOOL)0;
|
|
T35_ = (NIM_BOOL)0;
|
|
T36_ = (NIM_BOOL)0;
|
|
T36_ = ((NU8)(path.p->data[i]) == (NU8)(46));
|
|
if (!(T36_)) goto LA37_;
|
|
T36_ = (((NI)0) < i);
|
|
LA37_: ;
|
|
T35_ = T36_;
|
|
if (!(T35_)) goto LA38_;
|
|
T35_ = (i < (NI)(path.len - ((NI)1)));
|
|
LA38_: ;
|
|
T34_ = T35_;
|
|
if (!(T34_)) goto LA39_;
|
|
T34_ = !((((NU8)(path.p->data[(NI)(i - ((NI)1))])) == ((NU8)(92)) || ((NU8)(path.p->data[(NI)(i - ((NI)1))])) == ((NU8)(47))));
|
|
LA39_: ;
|
|
T33_ = T34_;
|
|
if (!(T33_)) goto LA40_;
|
|
T33_ = !(((NU8)(path.p->data[(NI)(i + ((NI)1))]) == (NU8)(46)));
|
|
LA40_: ;
|
|
T32_ = T33_;
|
|
if (!(T32_)) goto LA41_;
|
|
T32_ = (dotPos == ((NI)0));
|
|
LA41_: ;
|
|
if (!T32_) goto LA42_;
|
|
dotPos = i;
|
|
}
|
|
goto LA5_;
|
|
LA42_: ;
|
|
LA5_: ;
|
|
res -= ((NI)1);
|
|
} LA4: ;
|
|
}
|
|
} LA2: ;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&path));
|
|
eqdestroy___stdZassertions_13((&_));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZosdirs_65)(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* dest) {
|
|
eqdestroy___stdZassertions_13((&(*dest).Field0));
|
|
eqdestroy___stdZassertions_13((&(*dest).Field1));
|
|
eqdestroy___stdZassertions_13((&(*dest).Field2));
|
|
}
|
|
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
|
|
int result;
|
|
result = (int)0;
|
|
result = memcmp(a, b, ((size_t) (size)));
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, equalMem__system_1727)(void* a, void* b, NI size) {
|
|
NIM_BOOL result;
|
|
int T1_;
|
|
result = (NIM_BOOL)0;
|
|
T1_ = (int)0;
|
|
T1_ = nimCmpMem(a, b, size);
|
|
result = (T1_ == ((NI32)0));
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a, NimStringV2 b) {
|
|
NIM_BOOL result;
|
|
NI alen;
|
|
NI blen;
|
|
{ result = (NIM_BOOL)0;
|
|
alen = a.len;
|
|
blen = b.len;
|
|
{
|
|
if (!(alen == blen)) goto LA3_;
|
|
{
|
|
if (!(alen == ((NI)0))) goto LA7_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
result = equalMem__system_1727(((void*) ((&a.p->data[((NI)0)]))), ((void*) ((&b.p->data[((NI)0)]))), ((NI) (alen)));
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nosnormalizePath)(NimStringV2* path) {
|
|
NimStringV2 T1_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
T1_.len = 0; T1_.p = NIM_NIL;
|
|
T1_ = normalizePath__pureZpathnorm_158((*path), 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
eqsink___stdZassertions_19((&(*path)), T1_);
|
|
}BeforeRet_: ;
|
|
}
|
|
static N_INLINE(void, normalizePathAux__stdZprivateZospaths50_17)(NimStringV2* path) {
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
nosnormalizePath(path);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringV2 path) {
|
|
NIM_BOOL result;
|
|
NI len;
|
|
NIM_BOOL T5_;
|
|
NIM_BOOL T7_;
|
|
NIM_BOOL T8_;
|
|
{ result = (NIM_BOOL)0;
|
|
{
|
|
if (!(path.len == ((NI)0))) goto LA3_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
len = path.len;
|
|
T5_ = (NIM_BOOL)0;
|
|
T5_ = (((NU8)(path.p->data[((NI)0)])) == ((NU8)(47)) || ((NU8)(path.p->data[((NI)0)])) == ((NU8)(92)));
|
|
if (T5_) goto LA6_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T8_ = (NIM_BOOL)0;
|
|
T8_ = (((NI)1) < len);
|
|
if (!(T8_)) goto LA9_;
|
|
T8_ = (((NU8)(path.p->data[((NI)0)])) >= ((NU8)(97)) && ((NU8)(path.p->data[((NI)0)])) <= ((NU8)(122)) || ((NU8)(path.p->data[((NI)0)])) >= ((NU8)(65)) && ((NU8)(path.p->data[((NI)0)])) <= ((NU8)(90)));
|
|
LA9_: ;
|
|
T7_ = T8_;
|
|
if (!(T7_)) goto LA10_;
|
|
T7_ = ((NU8)(path.p->data[((NI)1)]) == (NU8)(58));
|
|
LA10_: ;
|
|
T5_ = T7_;
|
|
LA6_: ;
|
|
result = T5_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, absolutePath__stdZprivateZospaths50_378)(NimStringV2 path, NimStringV2 root) {
|
|
NimStringV2 result;
|
|
NimStringV2 T1_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
T1_.len = 0; T1_.p = NIM_NIL;
|
|
{
|
|
NIM_BOOL T4_;
|
|
T4_ = (NIM_BOOL)0;
|
|
T4_ = nosisAbsolute(path);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!T4_) goto LA5_;
|
|
eqcopy___stdZassertions_16((&result), path);
|
|
}
|
|
goto LA2_;
|
|
LA5_: ;
|
|
{
|
|
{
|
|
NIM_BOOL T10_;
|
|
tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw* T13_;
|
|
NimStringV2 T14_;
|
|
T10_ = (NIM_BOOL)0;
|
|
T10_ = nosisAbsolute(root);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!!(T10_)) goto LA11_;
|
|
T13_ = NIM_NIL;
|
|
T13_ = (tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw*) nimNewObj(sizeof(tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw), NIM_ALIGNOF(tyObject_ValueError__ke0esfQKJkTSUu9bpZ7VlFw));
|
|
(*T13_).Sup.Sup.Sup.m_type = (&NTIv2__ke0esfQKJkTSUu9bpZ7VlFw_);
|
|
(*T13_).Sup.Sup.name = "ValueError";
|
|
T14_.len = 0; T14_.p = NIM_NIL;
|
|
T14_ = rawNewString(root.len + 36);
|
|
appendString((&T14_), TM__O1zDbSYyG8zQytyoZAh0dg_19);
|
|
appendString((&T14_), root);
|
|
(*T13_).Sup.Sup.message = T14_;
|
|
(*T13_).Sup.Sup.parent = ((Exception*) NIM_NIL);
|
|
raiseExceptionEx((Exception*)T13_, "ValueError", "absolutePath", "ospaths2.nim", 904);
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
result = nosjoinPath(root, path);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
LA2_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(NI16*, toWideCString__stdZwidestrs_41)(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A x) {
|
|
NI16* result;
|
|
result = (NI16*)0;
|
|
result = x.data;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetCurrentDir)(void) {
|
|
NimStringV2 result;
|
|
tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A res;
|
|
NI32 bufsize;
|
|
NIM_BOOL oldNimErrFin1_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
nimZeroMem((void*)(&res), sizeof(tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A));
|
|
bufsize = ((NI32)260);
|
|
res = newWideCString__stdZwidestrs_260("", ((NI) (bufsize)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
while (1) {
|
|
NI32 L;
|
|
NI16* T4_;
|
|
T4_ = (NI16*)0;
|
|
T4_ = toWideCString__stdZwidestrs_41(res);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
L = Dl_1442840761_(bufsize, T4_);
|
|
{
|
|
NI32 T9_;
|
|
if (!(L == ((NI32)0))) goto LA7_;
|
|
T9_ = (NI32)0;
|
|
T9_ = osLastError__stdZoserrors_89();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
raiseOSError__stdZoserrors_86(T9_, TM__O1zDbSYyG8zQytyoZAh0dg_20);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
}
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{
|
|
tyObject_WideCStringObj__BwbUsAz4qeNPsD7q6SJ32A T13_;
|
|
if (!(bufsize < L)) goto LA11_;
|
|
T13_ = newWideCString__stdZwidestrs_260("", ((NI) (L)));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
eqsink___stdZwidestrs_27((&res), T13_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
bufsize = L;
|
|
}
|
|
goto LA5_;
|
|
LA11_: ;
|
|
{
|
|
NimStringV2 T15_;
|
|
T15_.len = 0; T15_.p = NIM_NIL;
|
|
T15_ = dollar___stdZwidestrs_359(res, ((NI) (L)), ((NI)65533));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
eqsink___stdZassertions_19((&result), T15_);
|
|
goto LA2;
|
|
}
|
|
LA5_: ;
|
|
}
|
|
} LA2: ;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
|
|
eqdestroy___stdZwidestrs_6((&res));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
*nimErr_ = oldNimErrFin1_;
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, absolutePathInternal__stdZprivateZospaths50_20)(NimStringV2 path) {
|
|
NimStringV2 result;
|
|
NimStringV2 colontmpD_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
colontmpD_ = nosgetCurrentDir();
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
result = absolutePath__stdZprivateZospaths50_378(path, colontmpD_);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&colontmpD_));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isAbsFromCurrentDrive__stdZprivateZospaths50_133)(NimStringV2 path) {
|
|
NIM_BOOL result;
|
|
NIM_BOOL T1_;
|
|
NIM_BOOL T3_;
|
|
NIM_BOOL T5_;
|
|
NIM_BOOL T7_;
|
|
result = (NIM_BOOL)0;
|
|
T1_ = (NIM_BOOL)0;
|
|
T1_ = (((NI)0) < path.len);
|
|
if (!(T1_)) goto LA2_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = ((NU8)(path.p->data[((NI)0)]) == (NU8)(47));
|
|
if (T3_) goto LA4_;
|
|
T5_ = (NIM_BOOL)0;
|
|
T5_ = ((NU8)(path.p->data[((NI)0)]) == (NU8)(92));
|
|
if (!(T5_)) goto LA6_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T7_ = (path.len == ((NI)1));
|
|
if (T7_) goto LA8_;
|
|
T7_ = !((((NU8)(path.p->data[((NI)1)])) == ((NU8)(92)) || ((NU8)(path.p->data[((NI)1)])) == ((NU8)(47)) || ((NU8)(path.p->data[((NI)1)])) == ((NU8)(58))));
|
|
LA8_: ;
|
|
T5_ = T7_;
|
|
LA6_: ;
|
|
T3_ = T5_;
|
|
LA4_: ;
|
|
T1_ = T3_;
|
|
LA2_: ;
|
|
result = T1_;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, sameRoot__stdZprivateZospaths50_140)(NimStringV2 path1, NimStringV2 path2) {
|
|
NIM_BOOL result;
|
|
NimStringV2 colontmpD_;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmpD__2;
|
|
NimStringV2 colontmpD__3;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmpD__4;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmpD__2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmpD__4), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = isAbsFromCurrentDrive__stdZprivateZospaths50_133(path1);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!(T3_)) goto LA4_;
|
|
T3_ = isAbsFromCurrentDrive__stdZprivateZospaths50_133(path2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
result = NIM_TRUE;
|
|
}
|
|
goto LA1_;
|
|
LA5_: ;
|
|
{
|
|
NI T8_;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), path1);
|
|
splitDrive__stdZprivateZntpath_2(colontmpD_, (&colontmpD__2));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD__3), path2);
|
|
splitDrive__stdZprivateZntpath_2(colontmpD__3, (&colontmpD__4));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T8_ = (NI)0;
|
|
T8_ = nsuCmpIgnoreCase(colontmpD__2.Field0, colontmpD__4.Field0);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
if (!(T8_ == ((NI)0))) goto LA9_;
|
|
result = NIM_TRUE;
|
|
}
|
|
goto LA1_;
|
|
LA9_: ;
|
|
{
|
|
result = NIM_FALSE;
|
|
}
|
|
LA1_: ;
|
|
eqdestroy___stdZprivateZntpath_116((&colontmpD__4));
|
|
eqdestroy___stdZprivateZntpath_116((&colontmpD__2));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosrelativePath)(NimStringV2 path, NimStringV2 base, NIM_CHAR sep) {
|
|
NimStringV2 result;
|
|
NimStringV2 base_2;
|
|
NimStringV2 path_2;
|
|
NimStringV2 T6_;
|
|
NIM_BOOL a1;
|
|
NIM_BOOL a2;
|
|
tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg f;
|
|
tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg b;
|
|
tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ ff;
|
|
tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ bb;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
base_2.len = 0; base_2.p = NIM_NIL;
|
|
path_2.len = 0; path_2.p = NIM_NIL;
|
|
{
|
|
if (!(path.len == ((NI)0))) goto LA4_;
|
|
result = TM__O1zDbSYyG8zQytyoZAh0dg_15;
|
|
eqdestroy___stdZassertions_13((&path_2));
|
|
eqdestroy___stdZassertions_13((&base_2));
|
|
goto BeforeRet_;
|
|
}
|
|
LA4_: ;
|
|
T6_.len = 0; T6_.p = NIM_NIL;
|
|
{
|
|
if (!eqStrings(base, TM__O1zDbSYyG8zQytyoZAh0dg_16)) goto LA9_;
|
|
base_2 = TM__O1zDbSYyG8zQytyoZAh0dg_17;
|
|
}
|
|
goto LA7_;
|
|
LA9_: ;
|
|
{
|
|
eqcopy___stdZassertions_16((&base_2), base);
|
|
}
|
|
LA7_: ;
|
|
eqcopy___stdZassertions_16((&path_2), path);
|
|
normalizePathAux__stdZprivateZospaths50_17((&path_2));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
normalizePathAux__stdZprivateZospaths50_17((&base_2));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
a1 = nosisAbsolute(path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
a2 = nosisAbsolute(base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
{
|
|
NIM_BOOL T14_;
|
|
NimStringV2 T18_;
|
|
T14_ = (NIM_BOOL)0;
|
|
T14_ = a1;
|
|
if (!(T14_)) goto LA15_;
|
|
T14_ = !(a2);
|
|
LA15_: ;
|
|
if (!T14_) goto LA16_;
|
|
T18_.len = 0; T18_.p = NIM_NIL;
|
|
T18_ = absolutePathInternal__stdZprivateZospaths50_20(base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
eqsink___stdZassertions_19((&base_2), T18_);
|
|
}
|
|
goto LA12_;
|
|
LA16_: ;
|
|
{
|
|
NIM_BOOL T20_;
|
|
NimStringV2 T24_;
|
|
T20_ = (NIM_BOOL)0;
|
|
T20_ = a2;
|
|
if (!(T20_)) goto LA21_;
|
|
T20_ = !(a1);
|
|
LA21_: ;
|
|
if (!T20_) goto LA22_;
|
|
T24_.len = 0; T24_.p = NIM_NIL;
|
|
T24_ = absolutePathInternal__stdZprivateZospaths50_20(path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
eqsink___stdZassertions_19((&path_2), T24_);
|
|
}
|
|
goto LA12_;
|
|
LA22_: ;
|
|
LA12_: ;
|
|
{
|
|
NIM_BOOL T27_;
|
|
T27_ = (NIM_BOOL)0;
|
|
T27_ = nosisAbsolute(path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!(T27_)) goto LA28_;
|
|
T27_ = nosisAbsolute(base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
LA28_: ;
|
|
if (!T27_) goto LA29_;
|
|
{
|
|
NIM_BOOL T33_;
|
|
T33_ = (NIM_BOOL)0;
|
|
T33_ = sameRoot__stdZprivateZospaths50_140(path_2, base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!!(T33_)) goto LA34_;
|
|
result = path_2;
|
|
path_2.len = 0; path_2.p = NIM_NIL;
|
|
eqdestroy___stdZassertions_13((&path_2));
|
|
eqdestroy___stdZassertions_13((&base_2));
|
|
goto BeforeRet_;
|
|
}
|
|
LA34_: ;
|
|
}
|
|
LA29_: ;
|
|
nimZeroMem((void*)(&f), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
|
|
nimZeroMem((void*)(&b), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
|
|
ff = TM__O1zDbSYyG8zQytyoZAh0dg_21;
|
|
bb = TM__O1zDbSYyG8zQytyoZAh0dg_21;
|
|
result = rawNewString(((NI) (path_2.len)));
|
|
{
|
|
while (1) {
|
|
NIM_BOOL T38_;
|
|
NI diff;
|
|
NIM_BOOL same;
|
|
NI colontmp_;
|
|
NI colontmp__2;
|
|
NI colontmp__3;
|
|
NI colontmp__4;
|
|
T38_ = (NIM_BOOL)0;
|
|
T38_ = hasNext__pureZpathnorm_6(f, path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!(T38_)) goto LA39_;
|
|
T38_ = hasNext__pureZpathnorm_6(b, base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
LA39_: ;
|
|
if (!T38_) goto LA37 ;
|
|
ff = next__pureZpathnorm_10((&f), path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
bb = next__pureZpathnorm_10((&b), base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
diff = (NI)(ff.Field1 - ff.Field0);
|
|
{
|
|
if (!!((diff == (NI)(bb.Field1 - bb.Field0)))) goto LA42_;
|
|
goto LA36;
|
|
}
|
|
LA42_: ;
|
|
same = NIM_TRUE;
|
|
{
|
|
NI i;
|
|
NI res;
|
|
i = (NI)0;
|
|
res = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res <= diff)) goto LA46 ;
|
|
i = res;
|
|
{
|
|
NIM_CHAR T49_;
|
|
NIM_CHAR T50_;
|
|
T49_ = (NIM_CHAR)0;
|
|
T49_ = nsuToLowerAsciiChar(path_2.p->data[(NI)(i + ff.Field0)]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
T50_ = (NIM_CHAR)0;
|
|
T50_ = nsuToLowerAsciiChar(base_2.p->data[(NI)(i + bb.Field0)]);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!!(((NU8)(T49_) == (NU8)(T50_)))) goto LA51_;
|
|
same = NIM_FALSE;
|
|
goto LA44;
|
|
}
|
|
LA51_: ;
|
|
res += ((NI)1);
|
|
} LA46: ;
|
|
}
|
|
} LA44: ;
|
|
{
|
|
if (!!(same)) goto LA55_;
|
|
goto LA36;
|
|
}
|
|
LA55_: ;
|
|
colontmp_ = ((NI)0);
|
|
colontmp__2 = ((NI)-1);
|
|
ff.Field0 = colontmp_;
|
|
ff.Field1 = colontmp__2;
|
|
colontmp__3 = ((NI)0);
|
|
colontmp__4 = ((NI)-1);
|
|
bb.Field0 = colontmp__3;
|
|
bb.Field1 = colontmp__4;
|
|
} LA37: ;
|
|
} LA36: ;
|
|
{
|
|
while (1) {
|
|
{
|
|
if (!(bb.Field0 <= bb.Field1)) goto LA61_;
|
|
{
|
|
NIM_BOOL T65_;
|
|
NIM_CHAR* T67_;
|
|
T65_ = (NIM_BOOL)0;
|
|
T65_ = (((NI)0) < result.len);
|
|
if (!(T65_)) goto LA66_;
|
|
T67_ = (NIM_CHAR*)0;
|
|
T67_ = X5BX5D___system_7129((&result), ((NI)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
T65_ = !(((NU8)((*T67_)) == (NU8)(sep)));
|
|
LA66_: ;
|
|
if (!T65_) goto LA68_;
|
|
nimAddCharV1((&result), sep);
|
|
}
|
|
LA68_: ;
|
|
prepareAdd((&result), 2);
|
|
appendString((&result), TM__O1zDbSYyG8zQytyoZAh0dg_23);
|
|
}
|
|
LA61_: ;
|
|
{
|
|
NIM_BOOL T72_;
|
|
T72_ = (NIM_BOOL)0;
|
|
T72_ = hasNext__pureZpathnorm_6(b, base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!!(T72_)) goto LA73_;
|
|
goto LA57;
|
|
}
|
|
LA73_: ;
|
|
bb = next__pureZpathnorm_10((&b), base_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
}
|
|
} LA57: ;
|
|
{
|
|
while (1) {
|
|
{
|
|
if (!(ff.Field0 <= ff.Field1)) goto LA79_;
|
|
{
|
|
NIM_BOOL T83_;
|
|
NIM_CHAR* T85_;
|
|
T83_ = (NIM_BOOL)0;
|
|
T83_ = (((NI)0) < result.len);
|
|
if (!(T83_)) goto LA84_;
|
|
T85_ = (NIM_CHAR*)0;
|
|
T85_ = X5BX5D___system_7129((&result), ((NI)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
T83_ = !(((NU8)((*T85_)) == (NU8)(sep)));
|
|
LA84_: ;
|
|
if (!T83_) goto LA86_;
|
|
nimAddCharV1((&result), sep);
|
|
}
|
|
LA86_: ;
|
|
{
|
|
NI i_2;
|
|
NI colontmp__5;
|
|
NI res_2;
|
|
i_2 = (NI)0;
|
|
colontmp__5 = (NI)0;
|
|
colontmp__5 = (NI)(ff.Field1 - ff.Field0);
|
|
res_2 = ((NI)0);
|
|
{
|
|
while (1) {
|
|
if (!(res_2 <= colontmp__5)) goto LA90 ;
|
|
i_2 = res_2;
|
|
nimAddCharV1((&result), path_2.p->data[(NI)(i_2 + ff.Field0)]);
|
|
res_2 += ((NI)1);
|
|
} LA90: ;
|
|
}
|
|
}
|
|
}
|
|
LA79_: ;
|
|
{
|
|
NIM_BOOL T93_;
|
|
T93_ = (NIM_BOOL)0;
|
|
T93_ = hasNext__pureZpathnorm_6(f, path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!!(T93_)) goto LA94_;
|
|
goto LA75;
|
|
}
|
|
LA94_: ;
|
|
ff = next__pureZpathnorm_10((&f), path_2);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
}
|
|
} LA75: ;
|
|
{
|
|
if (!(result.len == ((NI)0))) goto LA98_;
|
|
prepareAdd((&result), 1);
|
|
appendString((&result), TM__O1zDbSYyG8zQytyoZAh0dg_24);
|
|
}
|
|
LA98_: ;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&path_2));
|
|
eqdestroy___stdZassertions_13((&base_2));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isRelativeTo__stdZprivateZospaths50_187)(NimStringV2 path, NimStringV2 base) {
|
|
NIM_BOOL result;
|
|
NimStringV2 path_2;
|
|
NimStringV2 base_2;
|
|
NimStringV2 ret;
|
|
NIM_BOOL T2_;
|
|
NIM_BOOL T4_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
path_2.len = 0; path_2.p = NIM_NIL;
|
|
base_2.len = 0; base_2.p = NIM_NIL;
|
|
ret.len = 0; ret.p = NIM_NIL;
|
|
path_2 = normalizePath__pureZpathnorm_158(path, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
base_2 = normalizePath__pureZpathnorm_158(base, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
ret = nosrelativePath(path_2, base_2, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
T2_ = (NIM_BOOL)0;
|
|
T2_ = (((NI)0) < path_2.len);
|
|
if (!(T2_)) goto LA3_;
|
|
T4_ = (NIM_BOOL)0;
|
|
T4_ = nsuStartsWith(ret, TM__O1zDbSYyG8zQytyoZAh0dg_25);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
T2_ = !(T4_);
|
|
LA3_: ;
|
|
result = T2_;
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&ret));
|
|
eqdestroy___stdZassertions_13((&base_2));
|
|
eqdestroy___stdZassertions_13((&path_2));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, parentDirPos__stdZprivateZospaths50_194)(NimStringV2 path) {
|
|
NI result;
|
|
NI q;
|
|
{ result = (NI)0;
|
|
q = ((NI)1);
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = (((NI)1) <= path.len);
|
|
if (!(T3_)) goto LA4_;
|
|
T3_ = (((NU8)(path.p->data[(NI)(path.len - ((NI)1))])) == ((NU8)(92)) || ((NU8)(path.p->data[(NI)(path.len - ((NI)1))])) == ((NU8)(47)));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
q = ((NI)2);
|
|
}
|
|
LA5_: ;
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
colontmp_ = (NI)(path.len - q);
|
|
res = colontmp_;
|
|
{
|
|
while (1) {
|
|
if (!(((NI)0) <= res)) goto LA9 ;
|
|
i = res;
|
|
{
|
|
if (!(((NU8)(path.p->data[i])) == ((NU8)(92)) || ((NU8)(path.p->data[i])) == ((NU8)(47)))) goto LA12_;
|
|
result = i;
|
|
goto BeforeRet_;
|
|
}
|
|
LA12_: ;
|
|
res -= ((NI)1);
|
|
} LA9: ;
|
|
}
|
|
}
|
|
result = ((NI)-1);
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosparentDir)(NimStringV2 path) {
|
|
NimStringV2 result;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmp_;
|
|
NimStringV2 drive;
|
|
NimStringV2 splitpath;
|
|
NimStringV2 blitTmp;
|
|
NI sepPos;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmp_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
drive.len = 0; drive.p = NIM_NIL;
|
|
splitpath.len = 0; splitpath.p = NIM_NIL;
|
|
result = normalizePath__pureZpathnorm_158(path, 92);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
blitTmp = result;
|
|
result.len = 0; result.p = NIM_NIL;
|
|
splitDrive__stdZprivateZntpath_2(blitTmp, (&colontmp_));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
drive = colontmp_.Field0;
|
|
splitpath = colontmp_.Field1;
|
|
eqsink___stdZassertions_19((&result), splitpath);
|
|
sepPos = parentDirPos__stdZprivateZospaths50_194(result);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NimStringV2 T5_;
|
|
if (!(((NI)0) <= sepPos)) goto LA3_;
|
|
T5_.len = 0; T5_.p = NIM_NIL;
|
|
T5_ = substr__system_7601(result, ((NI)0), sepPos);
|
|
eqsink___stdZassertions_19((&result), T5_);
|
|
normalizePathEnd__stdZprivateZospaths50_22((&result), NIM_FALSE);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
NIM_BOOL T7_;
|
|
NIM_BOOL T8_;
|
|
NIM_BOOL T9_;
|
|
NIM_CHAR* T13_;
|
|
T7_ = (NIM_BOOL)0;
|
|
T8_ = (NIM_BOOL)0;
|
|
T9_ = (NIM_BOOL)0;
|
|
T9_ = eqStrings(result, TM__O1zDbSYyG8zQytyoZAh0dg_26);
|
|
if (T9_) goto LA10_;
|
|
T9_ = eqStrings(result, TM__O1zDbSYyG8zQytyoZAh0dg_27);
|
|
LA10_: ;
|
|
T8_ = T9_;
|
|
if (T8_) goto LA11_;
|
|
T8_ = (result.len == ((NI)0));
|
|
LA11_: ;
|
|
T7_ = T8_;
|
|
if (T7_) goto LA12_;
|
|
T13_ = (NIM_CHAR*)0;
|
|
T13_ = X5BX5D___system_7129((&result), ((NI)1));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T7_ = (((NU8)((*T13_))) == ((NU8)(92)) || ((NU8)((*T13_))) == ((NU8)(47)));
|
|
LA12_: ;
|
|
if (!T7_) goto LA14_;
|
|
eqsink___stdZassertions_19((&result), TM__O1zDbSYyG8zQytyoZAh0dg_28);
|
|
}
|
|
goto LA1_;
|
|
LA14_: ;
|
|
{
|
|
eqsink___stdZassertions_19((&result), TM__O1zDbSYyG8zQytyoZAh0dg_29);
|
|
}
|
|
LA1_: ;
|
|
{
|
|
if (!(result.len == ((NI)0))) goto LA19_;
|
|
}
|
|
goto LA17_;
|
|
LA19_: ;
|
|
{
|
|
NIM_BOOL T22_;
|
|
NIM_BOOL T23_;
|
|
T22_ = (NIM_BOOL)0;
|
|
T23_ = (NIM_BOOL)0;
|
|
T23_ = (((NI)0) < drive.len);
|
|
if (!(T23_)) goto LA24_;
|
|
T23_ = (result.len == ((NI)1));
|
|
LA24_: ;
|
|
T22_ = T23_;
|
|
if (!(T22_)) goto LA25_;
|
|
T22_ = (((NU8)(result.p->data[((NI)0)])) == ((NU8)(92)) || ((NU8)(result.p->data[((NI)0)])) == ((NU8)(47)));
|
|
LA25_: ;
|
|
if (!T22_) goto LA26_;
|
|
eqsink___stdZassertions_19((&result), drive);
|
|
drive.len = 0; drive.p = NIM_NIL;
|
|
}
|
|
goto LA17_;
|
|
LA26_: ;
|
|
{
|
|
NimStringV2 T29_;
|
|
T29_.len = 0; T29_.p = NIM_NIL;
|
|
T29_ = rawNewString(drive.len + result.len + 0);
|
|
appendString((&T29_), drive);
|
|
appendString((&T29_), result);
|
|
eqsink___stdZassertions_19((&result), T29_);
|
|
}
|
|
LA17_: ;
|
|
eqdestroy___stdZassertions_13((&drive));
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__stdZprivateZospaths50_283)(NimStringV2 path) {
|
|
NI result;
|
|
result = (NI)0;
|
|
result = ((NI)-1);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
colontmp_ = (NI)(path.len - ((NI)1));
|
|
res = colontmp_;
|
|
{
|
|
while (1) {
|
|
if (!(((NI)1) <= res)) goto LA3 ;
|
|
i = res;
|
|
{
|
|
if (!((NU8)(path.p->data[i]) == (NU8)(46))) goto LA6_;
|
|
result = i;
|
|
goto LA1;
|
|
}
|
|
goto LA4_;
|
|
LA6_: ;
|
|
{
|
|
if (!(((NU8)(path.p->data[i])) == ((NU8)(92)) || ((NU8)(path.p->data[i])) == ((NU8)(47)))) goto LA9_;
|
|
goto LA1;
|
|
}
|
|
goto LA4_;
|
|
LA9_: ;
|
|
LA4_: ;
|
|
res -= ((NI)1);
|
|
} LA3: ;
|
|
}
|
|
} LA1: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisRootDir)(NimStringV2 path) {
|
|
NIM_BOOL result;
|
|
NimStringV2 colontmpD_;
|
|
tyTuple__UV3llMMYFckfui8YMBuUZA colontmpD__2;
|
|
NI T6_;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result = (NIM_BOOL)0;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
nimZeroMem((void*)(&colontmpD__2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
|
|
{
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
eqcopy___stdZassertions_16((&colontmpD_), path);
|
|
splitDrive__stdZprivateZntpath_2(colontmpD_, (&colontmpD__2));
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
if (!(colontmpD__2.Field1.len == 0)) goto LA4_;
|
|
result = NIM_TRUE;
|
|
eqdestroy___stdZassertions_13((&path));
|
|
eqdestroy___stdZprivateZntpath_116((&colontmpD__2));
|
|
goto BeforeRet_;
|
|
}
|
|
LA4_: ;
|
|
T6_ = (NI)0;
|
|
T6_ = parentDirPos__stdZprivateZospaths50_194(path);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
|
|
result = (T6_ < ((NI)0));
|
|
{
|
|
LA1_:;
|
|
}
|
|
{
|
|
eqdestroy___stdZassertions_13((&path));
|
|
eqdestroy___stdZprivateZntpath_116((&colontmpD__2));
|
|
}
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
static N_INLINE(void, appendChar)(NimStringV2* dest, NIM_CHAR c) {
|
|
(*(*dest).p).data[(*dest).len] = c;
|
|
(*(*dest).p).data[(NI)((*dest).len + ((NI)1))] = 0;
|
|
(*dest).len += ((NI)1);
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, normExt__stdZprivateZospaths50_280)(NimStringV2 ext) {
|
|
NimStringV2 result;
|
|
result.len = 0; result.p = NIM_NIL;
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = (ext.len == 0);
|
|
if (T3_) goto LA4_;
|
|
T3_ = ((NU8)(ext.p->data[((NI)0)]) == (NU8)(46));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
eqcopy___stdZassertions_16((&result), ext);
|
|
}
|
|
goto LA1_;
|
|
LA5_: ;
|
|
{
|
|
NimStringV2 T8_;
|
|
T8_.len = 0; T8_.p = NIM_NIL;
|
|
T8_ = rawNewString(ext.len + 1);
|
|
appendChar((&T8_), 46);
|
|
appendString((&T8_), ext);
|
|
result = T8_;
|
|
}
|
|
LA1_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, noschangeFileExt)(NimStringV2 filename, NimStringV2 ext) {
|
|
NimStringV2 result;
|
|
NI extPos;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
extPos = searchExtPos__stdZprivateZospaths50_283(filename);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NimStringV2 colontmpD_;
|
|
NimStringV2 T5_;
|
|
if (!(extPos < ((NI)0))) goto LA3_;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
T5_.len = 0; T5_.p = NIM_NIL;
|
|
colontmpD_ = normExt__stdZprivateZospaths50_280(ext);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T5_ = rawNewString(filename.len + colontmpD_.len + 0);
|
|
appendString((&T5_), filename);
|
|
appendString((&T5_), colontmpD_);
|
|
result = T5_;
|
|
eqdestroy___stdZassertions_13((&colontmpD_));
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
NimStringV2 colontmpD__2;
|
|
NimStringV2 colontmpD__3;
|
|
NimStringV2 T7_;
|
|
colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
|
|
colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
|
|
T7_.len = 0; T7_.p = NIM_NIL;
|
|
colontmpD__2 = substr__system_7601(filename, ((NI)0), (NI)(extPos - ((NI)1)));
|
|
colontmpD__3 = normExt__stdZprivateZospaths50_280(ext);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T7_ = rawNewString(colontmpD__2.len + colontmpD__3.len + 0);
|
|
appendString((&T7_), colontmpD__2);
|
|
appendString((&T7_), colontmpD__3);
|
|
result = T7_;
|
|
eqdestroy___stdZassertions_13((&colontmpD__3));
|
|
eqdestroy___stdZassertions_13((&colontmpD__2));
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosaddFileExt)(NimStringV2 filename, NimStringV2 ext) {
|
|
NimStringV2 result;
|
|
NI extPos;
|
|
NIM_BOOL* nimErr_;
|
|
{nimErr_ = nimErrorFlag();
|
|
result.len = 0; result.p = NIM_NIL;
|
|
extPos = searchExtPos__stdZprivateZospaths50_283(filename);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
{
|
|
NimStringV2 colontmpD_;
|
|
NimStringV2 T5_;
|
|
if (!(extPos < ((NI)0))) goto LA3_;
|
|
colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
|
|
T5_.len = 0; T5_.p = NIM_NIL;
|
|
colontmpD_ = normExt__stdZprivateZospaths50_280(ext);
|
|
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
|
|
T5_ = rawNewString(filename.len + colontmpD_.len + 0);
|
|
appendString((&T5_), filename);
|
|
appendString((&T5_), colontmpD_);
|
|
result = T5_;
|
|
eqdestroy___stdZassertions_13((&colontmpD_));
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
eqcopy___stdZassertions_16((&result), filename);
|
|
}
|
|
LA1_: ;
|
|
}BeforeRet_: ;
|
|
return result;
|
|
}
|