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

166 lines
8.5 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_memfiles.nim.c.o nimcache/release/start_network/stdlib_memfiles.nim.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <sys/mman.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_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
struct tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ {void* mem;
NI size;
int handle;
int flags;
};
struct TGenericSeq {NI len;
NI reserved;
};
struct NimStringDesc { TGenericSeq Sup;NIM_CHAR data[SEQ_DECL_SIZE];
};
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;
};
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE TNimType NTI__j4SnXNrJDFBxAz4BlbM9aIQ_;
extern TNimType NTI__vr5DoT1jILTGdRlYv1OYpw_;
extern TNimType NTI__rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTI__nlCscttRCss70IBTyuBqnA_;
extern TNimType* nimTypeRoot;
#line 331 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
N_LIB_PRIVATE N_NIMCALL(void, close__gRakhE5v7JaOKQThVQTzkA)(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ* f) { NIM_BOOL error; NI32 lastErr; int T1_;
#line 335 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
error = NIM_FALSE; lastErr = (NI32)0;
#line 349 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 349 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 349 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 349 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 349 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
T1_ = (int)0; T1_ = munmap((*f).mem, (*f).size); error = !((T1_ == ((NI32) 0)));
#line 350 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 350 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
lastErr = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
#line 351 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
{ NIM_BOOL T6_; int T7_;
#line 351 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 351 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
if (!!(((*f).handle == ((NI32) -1)))) goto LA4_;
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
T6_ = (NIM_BOOL)0;
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 352 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
T7_ = (int)0; T7_ = close((*f).handle); T6_ = !((T7_ == ((NI32) 0))); if (T6_) goto LA8_;
T6_ = error; LA8_: ;
error = T6_; }
LA4_: ;
#line 354 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
(*f).size = ((NI) 0);
#line 355 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
(*f).mem = NIM_NIL;
#line 362 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
(*f).handle = ((int) -1);
#line 364 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
{ if (!error) goto LA11_;
#line 364 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
#line 364 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/pure/memfiles.nim"
raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(lastErr, ((NimStringDesc*) NIM_NIL));
}
LA11_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_memfilesDatInit000)(void) {
#line 999999 "generated_not_to_break_here"
static TNimNode* TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[4];
static TNimNode TM__mFfhe8Jm7Jqn2Znr3841fw_0[5];NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.size = sizeof(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ);
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.kind = 18;
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.base = 0;
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.flags = 3;
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.name = "MemFile";
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.nextType = nimTypeRoot; nimTypeRoot=&NTI__j4SnXNrJDFBxAz4BlbM9aIQ_;
TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[0] = &TM__mFfhe8Jm7Jqn2Znr3841fw_0[1];
TM__mFfhe8Jm7Jqn2Znr3841fw_0[1].kind = 1;
TM__mFfhe8Jm7Jqn2Znr3841fw_0[1].offset = offsetof(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ, mem);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[1].typ = (&NTI__vr5DoT1jILTGdRlYv1OYpw_);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[1].name = "mem";
TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[1] = &TM__mFfhe8Jm7Jqn2Znr3841fw_0[2];
TM__mFfhe8Jm7Jqn2Znr3841fw_0[2].kind = 1;
TM__mFfhe8Jm7Jqn2Znr3841fw_0[2].offset = offsetof(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ, size);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[2].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[2].name = "size";
TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[2] = &TM__mFfhe8Jm7Jqn2Znr3841fw_0[3];
TM__mFfhe8Jm7Jqn2Znr3841fw_0[3].kind = 1;
TM__mFfhe8Jm7Jqn2Znr3841fw_0[3].offset = offsetof(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ, handle);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[3].typ = (&NTI__nlCscttRCss70IBTyuBqnA_);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[3].name = "handle";
TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[3] = &TM__mFfhe8Jm7Jqn2Znr3841fw_0[4];
TM__mFfhe8Jm7Jqn2Znr3841fw_0[4].kind = 1;
TM__mFfhe8Jm7Jqn2Znr3841fw_0[4].offset = offsetof(tyObject_MemFile__j4SnXNrJDFBxAz4BlbM9aIQ, flags);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[4].typ = (&NTI__nlCscttRCss70IBTyuBqnA_);
TM__mFfhe8Jm7Jqn2Znr3841fw_0[4].name = "flags";
TM__mFfhe8Jm7Jqn2Znr3841fw_0[0].len = 4; TM__mFfhe8Jm7Jqn2Znr3841fw_0[0].kind = 2; TM__mFfhe8Jm7Jqn2Znr3841fw_0[0].sons = &TM__mFfhe8Jm7Jqn2Znr3841fw_2_4[0];
NTI__j4SnXNrJDFBxAz4BlbM9aIQ_.node = &TM__mFfhe8Jm7Jqn2Znr3841fw_0[0];
}