1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 64
3
4 #include "nimbase.h"
5 #include <string.h>
6 #undef LANGUAGE_C
7 #undef MIPSEB
8 #undef MIPSEL
9 #undef PPC
10 #undef R3000
11 #undef R4000
12 #undef i386
13 #undef linux
14 #undef mips
15 #undef near
16 #undef far
17 #undef powerpc
18 #undef unix
19 #define nimfr_(x, y)
20 #define nimln_(x, y)
21 typedef struct NimStringDesc NimStringDesc;
22 typedef struct TGenericSeq TGenericSeq;
23 struct TGenericSeq {
24 NI len;
25 NI reserved;
26 };
27 struct NimStringDesc {
28 TGenericSeq Sup;
29 NIM_CHAR data[SEQ_DECL_SIZE];
30 };
31 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
32 N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg);
33 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
34 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
35 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
36 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
37 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceChar)(NimStringDesc* s, NIM_CHAR sub, NIM_CHAR by);
38 STRING_LITERAL(TM__ZF8ppk9aofq5DcpfJb2DIsg_2, "globs.nim(59, 18) `false` paths like `C:foo` are currently unsupported, path: ", 78);
N_INLINE(void,nimCopyMem)39 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
40 void* T1_;
41 T1_ = (void*)0;
42 T1_ = memcpy(dest, source, ((size_t) (size)));
43 }
N_INLINE(void,copyMem__system_1727)44 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
45 nimCopyMem(dest, source, size);
46 }
N_INLINE(void,appendString)47 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
48 {
49 if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
50 copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
51 (*dest).Sup.len += (*src).Sup.len;
52 }
53 LA3_: ;
54 }
N_NIMCALL(NimStringDesc *,nativeToUnixPath__stdZprivateZglobs_51)55 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nativeToUnixPath__stdZprivateZglobs_51)(NimStringDesc* path) {
56 NimStringDesc* result;
57 result = NIM_NIL;
58 result = copyString(path);
59 {
60 NIM_BOOL T3_;
61 NIM_BOOL T4_;
62 T3_ = (NIM_BOOL)0;
63 T4_ = (NIM_BOOL)0;
64 T4_ = (((NI) 2) <= (path ? path->Sup.len : 0));
65 if (!(T4_)) goto LA5_;
66 T4_ = (((NU8)(path->data[((NI) 0)])) >= ((NU8)(97)) && ((NU8)(path->data[((NI) 0)])) <= ((NU8)(122)) || ((NU8)(path->data[((NI) 0)])) >= ((NU8)(65)) && ((NU8)(path->data[((NI) 0)])) <= ((NU8)(90)));
67 LA5_: ;
68 T3_ = T4_;
69 if (!(T3_)) goto LA6_;
70 T3_ = ((NU8)(path->data[((NI) 1)]) == (NU8)(58));
71 LA6_: ;
72 if (!T3_) goto LA7_;
73 result->data[((NI) 0)] = 47;
74 result->data[((NI) 1)] = path->data[((NI) 0)];
75 {
76 NIM_BOOL T11_;
77 T11_ = (NIM_BOOL)0;
78 T11_ = (((NI) 2) < (path ? path->Sup.len : 0));
79 if (!(T11_)) goto LA12_;
80 T11_ = !(((NU8)(path->data[((NI) 2)]) == (NU8)(92)));
81 LA12_: ;
82 if (!T11_) goto LA13_;
83 {
84 NimStringDesc* T19_;
85 if (!NIM_TRUE) goto LA17_;
86 T19_ = NIM_NIL;
87 T19_ = rawNewString((path ? path->Sup.len : 0) + 78);
88 appendString(T19_, ((NimStringDesc*) &TM__ZF8ppk9aofq5DcpfJb2DIsg_2));
89 appendString(T19_, path);
90 failedAssertImpl__systemZassertions_56(T19_);
91 }
92 LA17_: ;
93 }
94 LA13_: ;
95 }
96 LA7_: ;
97 result = nsuReplaceChar(result, 92, 47);
98 return result;
99 }
100