nwaku/nimcache/release/start_network/stdlib_terminal.nim.c

504 lines
30 KiB
C

/* Generated by Nim Compiler v1.2.6 */
/* (c) 2020 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -pthread -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace/install/usr/include -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1/src -DHAVE_CONFIG_H -DHAVE_BUILTIN_EXPECT -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/src -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/inc -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/tools -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1 -DBR_amd64=1 -DBR_INT128=1 -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident -I/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib -I/home/runner/work/nim-waku/nim-waku/waku/v1/node -o nimcache/release/start_network/stdlib_terminal.nim.c.o nimcache/release/start_network/stdlib_terminal.nim.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.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 tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_IOctl_WinSize__pb6i9aLcdojBXEMqdEzDkSA tyObject_IOctl_WinSize__pb6i9aLcdojBXEMqdEzDkSA;
struct tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og {NIM_BOOL trueColorIsSupported;
NIM_BOOL trueColorIsEnabled;
NIM_BOOL fgSetColor;
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {NI size;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
NCSTRING name;
TNimType* nextType;
NI instances;
NI sizes;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct TGenericSeq {NI len;
NI reserved;
};
struct NimStringDesc { TGenericSeq Sup;NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyObject_IOctl_WinSize__pb6i9aLcdojBXEMqdEzDkSA {unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
typedef NI tyArray__Bd4h7Ocx9bGTvrKzPIWNlHw[3];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
typedef NU8 tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg;
typedef NU16 tySet_tyEnum_Style__NXKayqTLMsAibFwNceBlpA;
typedef NU8 tyEnum_Style__NXKayqTLMsAibFwNceBlpA;
static N_NIMCALL(void, Marker_tyRef__flNJLrANZti6Wiy5LTlGGA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__CN3raB9atujkEiPpxYAdlgQ_3)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(void, write__PArlm09bKklm2BLsCg6YtaA)(FILE* f, NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NI, terminalWidthIoctl__02eNnusezgFhii6e0rp7SQ)(NI* fds, NI fdsLen_0);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getEnv__hhED57tMl0Iaa5bOg9cJaig)(NimStringDesc* key_0, NimStringDesc* default_0);
N_LIB_PRIVATE N_NIMCALL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, ansiStyleCode__9cVIfUEE6Zf6B3dSUGw8cLQ)(NI style);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_LIB_PRIVATE N_NIMCALL(void, formatValue__3zjq9csYPBcIN7AqvyU5ZLA)(NimStringDesc** result, NimStringDesc* value_0, NimStringDesc* specifier);
N_LIB_PRIVATE N_NIMCALL(void, formatValue__ACNJL1q6Oxfvi53i9bkeK6Q)(NimStringDesc** result, NI value_0, NimStringDesc* specifier);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE TNimType NTI__EcU8GhMNGo9bGDXbfqZ82og_;
extern TNimType NTI__VaVACK0bpYmqIQ0mKcHfQQ_;
N_LIB_PRIVATE TNimType NTI__flNJLrANZti6Wiy5LTlGGA_;
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_4, "\033[0m", 4);
static NIM_CONST tyArray__Bd4h7Ocx9bGTvrKzPIWNlHw TM__CN3raB9atujkEiPpxYAdlgQ_6 = {((NI) 0),
((NI) 1),
((NI) 2)}
;
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_7, "COLUMNS", 7);
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_9, "\033[", 2);
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_10, "m", 1);
N_LIB_PRIVATE NIM_THREADVAR tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* gTerm__wkpx9csKte2r1l45yvskIcA;
extern TNimType* nimTypeRoot;
N_LIB_PRIVATE NIM_THREADVAR NI gFG__g7w4T3anr20OMlWloNx2tQ;
N_LIB_PRIVATE NIM_THREADVAR NI gBG__dgmeknpHWrtwqMJGQAp9atA;
static N_NIMCALL(void, Marker_tyRef__flNJLrANZti6Wiy5LTlGGA)(void* p, NI op) {
tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* a;
a = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*)p;
}
static N_NIMCALL(void, TM__CN3raB9atujkEiPpxYAdlgQ_3)(void) {
nimGCvisit((void*)gTerm__wkpx9csKte2r1l45yvskIcA, 0);}
#line 466 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(void, resetAttributes__6J8xlU57R8cS9bLzTS89aM5g)(FILE* f) {
#line 475 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 475 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
write__PArlm09bKklm2BLsCg6YtaA(f, ((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_4));
#line 476 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
gFG__g7w4T3anr20OMlWloNx2tQ = ((NI) 0);
#line 477 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
gBG__dgmeknpHWrtwqMJGQAp9atA = ((NI) 0);}
#line 22 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_;
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size)));}
#line 33 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
#line 220 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(NI, terminalWidthIoctl__02eNnusezgFhii6e0rp7SQ)(NI* fds, NI fdsLen_0) { NI result; tyObject_IOctl_WinSize__pb6i9aLcdojBXEMqdEzDkSA win;{ result = (NI)0; nimZeroMem((void*)(&win), sizeof(tyObject_IOctl_WinSize__pb6i9aLcdojBXEMqdEzDkSA)); { NI fd; NI i; fd = (NI)0;
#line 3 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
i = ((NI) 0); {
#line 4 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
while (1) { NI TM__CN3raB9atujkEiPpxYAdlgQ_5;
#line 4 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
#line 4 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
if (!(i < fdsLen_0)) goto LA3;
#line 224 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if ((NU)(i) >= (NU)(fdsLen_0)){ raiseIndexError2(i,fdsLen_0-1); } fd = fds[i];
#line 225 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{ NI T6_;
#line 225 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 225 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 225 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if ((fd) < ((int) (-2147483647 -1)) || (fd) > ((int) 2147483647)){ raiseRangeErrorI(fd, ((int) (-2147483647 -1)), ((int) 2147483647)); }
#line 225 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T6_ = (NI)0; T6_ = ioctl(((int) (fd)), TIOCGWINSZ, (&win)); if (!!((T6_ == ((NI) -1)))) goto LA7_;
#line 226 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 226 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = ((NI) (win.ws_col)); goto BeforeRet_;
}
LA7_: ;
#line 6 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
if (nimAddInt(i, ((NI) 1), &TM__CN3raB9atujkEiPpxYAdlgQ_5)) { raiseOverflow(); }; i = (NI)(TM__CN3raB9atujkEiPpxYAdlgQ_5); } LA3: ;
}
}
#line 227 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 227 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = ((NI) 0); goto BeforeRet_;
}BeforeRet_: ;
return result;}
#line 85 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) { NCSTRING result; result = (NCSTRING)0;
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
{ NIM_BOOL T3_;
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
T3_ = (NIM_BOOL)0;
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
T3_ = (s == NIM_NIL); if (T3_) goto LA4_;
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
T3_ = ((*s).Sup.len == ((NI) 0)); LA4_: ;
if (!T3_) goto LA5_;
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
result = ""; }
goto LA1_;
LA5_: ;
{
#line 87 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
result = ((NCSTRING) ((*s).data)); }
LA1_: ;
return result;}
#line 240 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(NI, terminalWidth__s9bdJLFVciGfQ0i2sQaMF1g)(void) { NI result; NI w; NimStringDesc* cterm; int fd; NCSTRING T5_; int T11_; NimStringDesc* s;{ result = (NI)0;
#line 244 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 244 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
w = terminalWidthIoctl__02eNnusezgFhii6e0rp7SQ(TM__CN3raB9atujkEiPpxYAdlgQ_6, 3);
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if (!(((NI) 0) < w)) goto LA3_;
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = w; goto BeforeRet_;
}
LA3_: ;
#line 246 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 246 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if ((L_ctermid) < ((NI) 0) || (L_ctermid) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(L_ctermid, ((NI) 0), ((NI) IL64(9223372036854775807))); }
#line 246 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
cterm = mnewString(((NI) (L_ctermid)));
#line 247 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 247 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 247 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T5_ = (NCSTRING)0; T5_ = ctermid(nimToCStringConv(cterm));
#line 247 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
fd = open(T5_, ((int) 0));
#line 248 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{ tyArray__GAcaPw08Gj9cXYhAaMMr9cfw T10_;
#line 248 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 248 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if (!!((fd == ((NI32) -1)))) goto LA8_;
#line 249 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T10_[0] = ((NI) (fd));
#line 249 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
w = terminalWidthIoctl__02eNnusezgFhii6e0rp7SQ(T10_, 1); }
LA8_: ;
#line 250 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 250 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 250 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T11_ = (int)0; T11_ = close(fd); (void)(T11_);
#line 251 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{
#line 251 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if (!(((NI) 0) < w)) goto LA14_;
#line 251 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 251 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = w; goto BeforeRet_;
}
LA14_: ;
#line 252 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 252 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
s = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_7), ((NimStringDesc*) NIM_NIL));
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{ NIM_BOOL T18_; NIM_BOOL T19_; NI T21_;
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T18_ = (NIM_BOOL)0;
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T19_ = (NIM_BOOL)0;
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T19_ = (((NI) 0) < (s ? s->Sup.len : 0)); if (!(T19_)) goto LA20_;
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T21_ = (NI)0; T21_ = npuParseInt(s, (&w), ((NI) 0)); T19_ = (((NI) 0) < T21_); LA20_: ;
T18_ = T19_; if (!(T18_)) goto LA22_;
#line 253 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T18_ = (((NI) 0) < w); LA22_: ;
if (!T18_) goto LA23_;
#line 254 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 254 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = w; goto BeforeRet_;
}
LA23_: ;
#line 255 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 255 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = ((NI) 80); goto BeforeRet_;
}BeforeRet_: ;
return result;}
#line 11 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_;
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));}
#line 2112 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
nimCopyMem(dest, source, size);
}
#line 217 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
{
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
if (!!((src == NIM_NIL))) goto LA3_;
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
#line 220 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
(*dest).Sup.len += (*src).Sup.len; }
LA3_: ;
}
#line 491 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, ansiStyleCode__9cVIfUEE6Zf6B3dSUGw8cLQ)(NI style) { NimStringDesc* result; NimStringDesc* fmtRes; result = (NimStringDesc*)0;
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 533 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/strformat.nim"
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
fmtRes = rawNewString(((NI) 41));
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
formatValue__3zjq9csYPBcIN7AqvyU5ZLA((&fmtRes), ((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_9), ((NimStringDesc*) NIM_NIL));
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
formatValue__ACNJL1q6Oxfvi53i9bkeK6Q((&fmtRes), style, ((NimStringDesc*) NIM_NIL));
#line 492 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
fmtRes = resizeString(fmtRes, 1);appendString(fmtRes, ((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_10)); result = copyString(fmtRes); return result;}
#line 561 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(void, setForegroundColor__vJutklhcnQq9akCXxcuSHAg)(FILE* f, tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg fg, NIM_BOOL bright) { NimStringDesc* T5_;
#line 586 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 586 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
gFG__g7w4T3anr20OMlWloNx2tQ = fg;
#line 587 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{ NI TM__CN3raB9atujkEiPpxYAdlgQ_8; if (!bright) goto LA3_;
#line 587 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if (nimAddInt(gFG__g7w4T3anr20OMlWloNx2tQ, ((NI) 60), &TM__CN3raB9atujkEiPpxYAdlgQ_8)) { raiseOverflow(); }; gFG__g7w4T3anr20OMlWloNx2tQ = (NI)(TM__CN3raB9atujkEiPpxYAdlgQ_8); }
LA3_: ;
#line 588 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 588 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 588 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T5_ = (NimStringDesc*)0; T5_ = ansiStyleCode__9cVIfUEE6Zf6B3dSUGw8cLQ(gFG__g7w4T3anr20OMlWloNx2tQ);
#line 588 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
write__PArlm09bKklm2BLsCg6YtaA(f, T5_);
}
#line 501 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(void, setStyle__y8lW2LrW2n5ZHaxH9bAf4WA)(FILE* f, tySet_tyEnum_Style__NXKayqTLMsAibFwNceBlpA style) { { tyEnum_Style__NXKayqTLMsAibFwNceBlpA s; NI i; s = (tyEnum_Style__NXKayqTLMsAibFwNceBlpA)0;
#line 37 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
i = ((NI) 1); {
#line 38 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
while (1) { NI TM__CN3raB9atujkEiPpxYAdlgQ_11;
#line 38 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
if (!(i <= ((NI) 9))) goto LA3;
#line 39 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
{ NimStringDesc* T8_;
#line 39 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
if ((i) < ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 1) || (i) > ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 9)){ raiseRangeErrorI(i, ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 1), ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 9)); } if (!((style &(1U<<((NU)((((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) (i))- 1))&15U)))!=0)) goto LA6_;
#line 513 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if ((i) < ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 1) || (i) > ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 9)){ raiseRangeErrorI(i, ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 1), ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 9)); } s = ((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) (i));
#line 514 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 514 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 514 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
T8_ = (NimStringDesc*)0; T8_ = ansiStyleCode__9cVIfUEE6Zf6B3dSUGw8cLQ(((NI) (s)));
#line 514 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
write__PArlm09bKklm2BLsCg6YtaA(f, T8_);
}
LA6_: ;
#line 40 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/iterators.nim"
if (nimAddInt(i, ((NI) 1), &TM__CN3raB9atujkEiPpxYAdlgQ_11)) { raiseOverflow(); }; i = (NI)(TM__CN3raB9atujkEiPpxYAdlgQ_11); } LA3: ;
}
}
}
#line 619 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, ansiForegroundColorCode__aiWNvQSWqGNTUqhMXNZzrQ)(tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg fg, NIM_BOOL bright) { NimStringDesc* result; NI style;{ result = (NimStringDesc*)0;
#line 620 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 620 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
style = fg;
#line 621 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
{ NI TM__CN3raB9atujkEiPpxYAdlgQ_12; if (!bright) goto LA3_;
#line 621 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
if (nimAddInt(style, ((NI) 60), &TM__CN3raB9atujkEiPpxYAdlgQ_12)) { raiseOverflow(); }; style = (NI)(TM__CN3raB9atujkEiPpxYAdlgQ_12); }
LA3_: ;
#line 622 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 622 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
#line 622 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/terminal.nim"
result = ansiStyleCode__9cVIfUEE6Zf6B3dSUGw8cLQ(style); goto BeforeRet_;
}BeforeRet_: ;
return result;}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_terminalInit000)(void) {
#line 999999 "generated_not_to_break_here"
{
nimRegisterThreadLocalMarker(TM__CN3raB9atujkEiPpxYAdlgQ_3);}
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_terminalDatInit000)(void) {
#line 999999 "generated_not_to_break_here"
static TNimNode* TM__CN3raB9atujkEiPpxYAdlgQ_2_3[3];
static TNimNode TM__CN3raB9atujkEiPpxYAdlgQ_0[4];NTI__EcU8GhMNGo9bGDXbfqZ82og_.size = sizeof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og);
NTI__EcU8GhMNGo9bGDXbfqZ82og_.kind = 18;
NTI__EcU8GhMNGo9bGDXbfqZ82og_.base = 0;
NTI__EcU8GhMNGo9bGDXbfqZ82og_.flags = 3;
NTI__EcU8GhMNGo9bGDXbfqZ82og_.name = "PTerminal:ObjectType";
NTI__EcU8GhMNGo9bGDXbfqZ82og_.nextType = nimTypeRoot; nimTypeRoot=&NTI__EcU8GhMNGo9bGDXbfqZ82og_;
TM__CN3raB9atujkEiPpxYAdlgQ_2_3[0] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[1];
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, trueColorIsSupported);
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].name = "trueColorIsSupported";
TM__CN3raB9atujkEiPpxYAdlgQ_2_3[1] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[2];
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, trueColorIsEnabled);
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].name = "trueColorIsEnabled";
TM__CN3raB9atujkEiPpxYAdlgQ_2_3[2] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[3];
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, fgSetColor);
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].name = "fgSetColor";
TM__CN3raB9atujkEiPpxYAdlgQ_0[0].len = 3; TM__CN3raB9atujkEiPpxYAdlgQ_0[0].kind = 2; TM__CN3raB9atujkEiPpxYAdlgQ_0[0].sons = &TM__CN3raB9atujkEiPpxYAdlgQ_2_3[0];
NTI__EcU8GhMNGo9bGDXbfqZ82og_.node = &TM__CN3raB9atujkEiPpxYAdlgQ_0[0];
NTI__flNJLrANZti6Wiy5LTlGGA_.size = sizeof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*);
NTI__flNJLrANZti6Wiy5LTlGGA_.kind = 22;
NTI__flNJLrANZti6Wiy5LTlGGA_.base = (&NTI__EcU8GhMNGo9bGDXbfqZ82og_);
NTI__flNJLrANZti6Wiy5LTlGGA_.flags = 2;
NTI__flNJLrANZti6Wiy5LTlGGA_.name = "PTerminal";
NTI__flNJLrANZti6Wiy5LTlGGA_.nextType = nimTypeRoot; nimTypeRoot=&NTI__flNJLrANZti6Wiy5LTlGGA_;
NTI__flNJLrANZti6Wiy5LTlGGA_.marker = Marker_tyRef__flNJLrANZti6Wiy5LTlGGA;
}