vrt.vacuum.clazz

module vrt.vacuum.clazz;


fn vrt_handle_cast(obj: void*, tinfo: TypeInfo) void* { }

vrt.vacuum.aa

//! Platform independent AA implementation, see interface in core.rt.aa.
module vrt.vacuum.aa;


alias HashValue = void*;

struct SizeBehaviourPrime
{
public:
	fn setStarting(min: size_t) size_t { }
	fn getNextSize() size_t { }
	fn getIndex(hash: u64) size_t { }
}

struct ArrayHash
{
public:
	enum Factor;


public:
	alias KeyElement = KE;
	alias Key = scope (const(scope (KeyElement)[]);
	alias Value = V;
	alias Distance = u8;
	alias SizeBehaviour = SB;


public:
	fn dup(old: HashMapArray) { }
	fn setup(size: size_t) { }
	fn getOrInit(key: scope (Key)) Value { }
	fn ptrKeys(ti: TypeInfo) void[] { }
	fn keys(ti: TypeInfo) void[] { }
	fn values(aa: AA*) void[] { }
	fn findPtr(key: scope (Key)) Value* { }
	fn find(key: scope (Key), ret: Value) bool { }
	fn add(key: scope (Key), value: Value) { }
	fn remove(key: scope (Key)) bool { }
	fn grow() { }
	fn allocArrays(entries: size_t) { }
	fn removeAt(index: size_t) { }
	fn clearAt(index: size_t) { }
	fn wantsToGetRicher(index: size_t) bool { }


public:
	static fn makeHash(key: scope (Key)) u64 { }
}

struct ValueHash
{
public:
	enum Factor;


public:
	alias Key = K;
	alias Value = V;
	alias HashType = u64;
	alias Distance = u8;
	alias SizeBehaviour = SB;


public:
	fn dup(old: HashMapInteger) { }
	fn setup(size: size_t) { }
	fn getOrInit(key: Key) Value { }
	fn keys(ti: TypeInfo) void[] { }
	fn values(aa: AA*) void[] { }
	fn findPtr(key: Key) Value* { }
	fn find(key: Key, ret: Value) bool { }
	fn add(key: Key, value: Value) { }
	fn remove(key: Key) bool { }
	fn grow() { }
	fn allocArrays(entries: size_t) { }
	fn removeAt(index: size_t) { }
	fn clearAt(index: size_t) { }
	fn wantsToGetRicher(index: size_t) bool { }


public:
	static fn makeHash(key: Key) u64 { }
}

struct AA
{
public:
	keytid: TypeInfo;
	valuetid: TypeInfo;
	u: HashUnion;
	arrayKey: bool;
	ptrKey: bool;
}

union HashUnion
{
public:
	array: ArrayHash;
	value: ValueHash;
}

fn getPrimeSize(index: u32) u64 { }
fn fastPrimeHashToIndex(index: u8, hash: u64) u64 { }
//! Returns the log2 of the given u32, does not throw on 0.
fn log2(x: u32) u32 { }
fn hashFNV1A_64(arr: scope (const(scope (void)[])) u64 { }
fn writeToPtr(aa: AA*, ret: void*, value: HashValue) { }
fn fromHashValuePtr(aa: AA*, ptr: HashValue*) void* { }
fn toHashValue(aa: AA*, value: void*) HashValue { }
//! Creates a new associative array.
fn vrt_aa_new(value: TypeInfo, key: TypeInfo) void* { }
//! Copies an existing associative array.
fn vrt_aa_dup(rbtv: void*) void* { }
fn vrt_aa_in_primitive(rbtv: void*, key: K, ret: void*) bool { }
fn vrt_aa_in_array(rbtv: void*, key: K, ret: void*) bool { }
fn vrt_aa_in_ptr(rbtv: void*, key: K, ret: void*) bool { }
fn vrt_aa_insert_primitive(rbtv: void*, key: K, value: void*) { }
fn vrt_aa_insert_array(rbtv: void*, key: K, value: void*) { }
fn vrt_aa_insert_ptr(rbtv: void*, key: K, value: void*) { }
fn vrt_aa_delete_primitive(rbtv: void*, key: K) bool { }
fn vrt_aa_delete_array(rbtv: void*, key: K) bool { }
fn vrt_aa_delete_ptr(rbtv: void*, key: K) bool { }
//! Get the keys array for a given associative array.
fn vrt_aa_get_keys(rbtv: void*) void[] { }
//! Get the values array for a given associative array.
fn vrt_aa_get_values(rbtv: void*) void[] { }
//! Get the number of pairs in a given associative array.
fn vrt_aa_get_length(rbtv: void*) size_t { }
fn vrt_aa_in_binop_primitive(rbtv: void*, key: K) void* { }
fn vrt_aa_in_binop_array(rbtv: void*, key: K) void* { }
fn vrt_aa_in_binop_ptr(rbtv: void*, key: K) void* { }
//! Rehash an associative array to optimise performance.
fn vrt_aa_rehash(rbtv: void*) { }

vrt.vacuum.defines

module vrt.vacuum.defines;


//! Common sizes of bytes, makes code easier to read.
enum _4GB;
//! Common sizes of bytes, makes code easier to read.
enum _2GB;
//! Common sizes of bytes, makes code easier to read.
enum _1GB;
//! Common sizes of bytes, makes code easier to read.
enum _512MB;
//! Common sizes of bytes, makes code easier to read.
enum _256MB;
//! Common sizes of bytes, makes code easier to read.
enum _128MB;
//! Common sizes of bytes, makes code easier to read.
enum _64MB;
//! Common sizes of bytes, makes code easier to read.
enum _32MB;
//! Common sizes of bytes, makes code easier to read.
enum _16MB;
//! Common sizes of bytes, makes code easier to read.
enum _8MB;
//! Common sizes of bytes, makes code easier to read.
enum _4MB;
//! Common sizes of bytes, makes code easier to read.
enum _2MB;
//! Common sizes of bytes, makes code easier to read.
enum _1MB;
//! Common sizes of bytes, makes code easier to read.
enum _512KB;
//! Common sizes of bytes, makes code easier to read.
enum _256KB;
//! Common sizes of bytes, makes code easier to read.
enum _128KB;
//! Common sizes of bytes, makes code easier to read.
enum _64KB;
//! Common sizes of bytes, makes code easier to read.
enum _32KB;
//! Common sizes of bytes, makes code easier to read.
enum _16KB;
//! Common sizes of bytes, makes code easier to read.
enum _8KB;
//! Common sizes of bytes, makes code easier to read.
enum _4KB;
//! Common sizes of bytes, makes code easier to read.
enum _2KB;
//! Common sizes of bytes, makes code easier to read.
enum _1KB;

vrt.vacuum.format

module vrt.vacuum.format;


enum DBL_MANT_DIG;
enum DBL_MAX_EXP;
enum DBL_EPSILON;
enum INT_MAX;
enum ALT_FORM;
enum LONG_MAX;

struct SinkImpl
{
public:
	//! Add str to this sink.
	fn sink(str: scope (SinkArg)) { }
	//! Get the contents of this sink as a string.
	fn toString() string { }
	//! Get the contents of this sink as a mutable array of characters.
	fn toChar() char[] { }
	//! Safely get the backing storage from the sink without copying.
	fn toSink(sink: scope (Sink)) { }
	//! Clear this sink.
	fn reset() { }
}

global hexDigits: string;

//! Turns a size into a human readable output.
fn vrt_format_readable_size(sink: scope (Sink), size: u64) { }
fn vrt_format_u64(sink: scope (Sink), i: u64) { }
fn vrt_format_i64(sink: scope (Sink), i: i64) { }
fn vrt_format_hex(sink: scope (Sink), i: u64, padding: size_t) { }
fn vrt_format_f32(sink: scope (Sink), f: f32, width: i32) { }
fn vrt_format_f64(sink: scope (Sink), f: f64, width: i32) { }
fn vrt_format_dchar(sink: scope (Sink), c: dchar) { }
fn vrt_sink_init_1024(store: void[1024]) scope (Sink) { }
fn vrt_sink_getstr_1024(store: void[1024]) string { }

vrt.vacuum.vmain

module vrt.vacuum.vmain;


fn vrt_run_main(argc: i32, argv: char**, vmain: VMain) i32 { }
fn unsafeToString(str: const(char)*) string { }

vrt.vacuum.utf

//! Platform independent implementation of utf interface in core.rt.misc.
module vrt.vacuum.utf;


fn vrt_reverse_decode_u8_d(str: scope (const(scope (char)[]), index: size_t) dchar { }
fn vrt_decode_u8_d(str: scope (const(scope (char)[]), index: size_t) dchar { }
fn vrt_count_codepoints_u8(s: const(char)[]) size_t { }
fn vrt_validate_u8(s: const(char)[]) { }
fn vrt_encode_static_u8(buf: char[6], c: dchar) size_t { }

vrt.vacuum.hash

module vrt.vacuum.hash;


//! Generate a hash. djb2 algorithm stolen from
//! http://www.cse.yorku.ca/~oz/hash.html
fn vrt_hash(ptr: void*, length: size_t) u32 { }

vrt.gc.large

//! Holds the code for managing large blocks.
module vrt.gc.large;


struct Large
{
public:
	extent: Extent;


public:
	fn setup(ptr: void*, n: size_t, finalizer: bool, pointers: bool) { }
	fn hasPointers() bool { }
	fn hasFinalizer() bool { }
	fn isMarked() bool { }
	fn mark(val: bool) { }
}

vrt.gc.sbrk

module vrt.gc.sbrk;


struct SBrk
{
public:
	enum Max;
	enum Own;


public:
	cur: void*;
	left: size_t;
	used: size_t;


public:
	fn setup() { }
	fn shutdown() { }
	fn collect() { }
	fn getStats(stats: Stats) { }
	fn totalSize() size_t { }
	fn allocEntry(typeinfo: TypeInfo, count: size_t) void* { }
	fn alloc(size: size_t) void* { }
}

global inst: SBrk;

fn sbrk(increment: intptr_t) void*;

vrt.gc.design

//! Holds documentation and defines for the Volt garbage collector.
module vrt.gc.design;

public import vrt.vacuum.defines;


enum PageSizeLog;
enum PageSize;
enum PageMask;
//! Hardcoded to 2MB for now as we are always on x86.
enum HugePageSize;
//! Used to decide the GigaMan allocation size.
enum GigaSize;
//! Minimum allocation size by which all allocation around rounded up to.
enum MinAllocSize;
//! Safety check for maximum allocation size.
enum MaxAllocSize;

//! Internal stat struct, has a lot more statistics then regular but
//! changes more often.
struct InternalStats
{
public:
	base: Stats;
	numFreeSlots: u32[13];
	numUsedSlots: u32[13];
}

vrt.gc.arena

module vrt.gc.arena;


enum MULTIPLICATION_FACTOR_ORIGIN;
enum MULTIPLICATION_FACTOR_MAX;
enum MULTIPLICATION_FACTOR_INCREMENT;

//! An Arena is an instance of the GC.
struct Arena
{
public:
	freeSlabs: Slab*[13];
	freePtrSlabs: Slab*[13];
	freeFinSlabs: Slab*[13];
	freePtrFinSlabs: Slab*[13];
	usedSlabs: Slab*;
	stackBottom: void*;
	hits: HitStack;
	removes: HitStack;


public:
	fn setup() { }
	fn shutdown() { }
	fn getStats(stats: Stats) { }
	fn allocEntry(typeinfo: TypeInfo, count: size_t) void* { }
	fn collect() { }
	fn totalSize() size_t { }


public:
	static fn allocArena() Arena* { }


protected:
	mNextCollection: size_t;
	mMultiplicationFactor: f64;


protected:
	//! Prune the a free slab list, checking usedSlots and following
	//! slab->next.
	fn pruneFreeSlabs(s: Slab*) Slab* { }
	//! Prune the used slab list, checking usedSlots and freeSlots also
	//! following slab->next.
	fn pruneUsedSlabs(s: Slab*) Slab* { }
	fn free(ptr: void*) { }
	fn free(large: Large*) { }
	fn free(ptr: void*, s: Slab*) { }
	fn scanStack() bool { }
	fn scanSlab(s: Slab*, ptr: const(const(void)*)) bool { }
	fn scanLarge(l: Large*) bool { }
	fn scanRange(range: const(const(void)*)[]) bool { }
	fn scan(ptr: void*) bool { }
	fn scanHit(ptr: void*, slab: Slab*) bool { }
	fn scanHit(ptr: void*, large: Large*) bool { }
	fn alloc(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn maybeTriggerCollection() { }
	fn allocSmall(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn getFreeSlab(order: u8, kind: Extent.Kind) Slab* { }
	fn pushFreeSlab(slab: Slab*) { }
	fn popFreeSlab(slab: Slab*) { }
	fn allocLarge(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn allocSlab(order: u8, hasFinalizer: bool, hasPointer: bool) Slab* { }
}

fn __vrt_push_registers(bool delegate()) bool;

vrt.gc.rbtree

//! RBTree implementation for the GC.
module vrt.gc.rbtree;


enum Black;
enum Red;

alias Colour = bool;

//! Embeddable Node for the RBTree.
struct Node
{
public:
	children: Link[2];


public:
	fn left() Link* { }
	fn left(l: Link) { }
	fn right(l: Link) { }
	fn right() Link* { }
	fn visit(func: scope (RBTree.VisitDg)) { }
}

//! Wrapping a pointer and red black bit, link from one Node to another.
struct Link
{
public:
	fn getAs(c: Colour) Link { }
	fn getAsBlack() Link { }
	fn getAsRed() Link { }
	fn node() Node* { }
	fn colour() Colour { }
	fn isRed() bool { }
	fn isBlack() bool { }
	fn isLeaf() bool { }
	fn left() Link* { }
	fn right() Link* { }
	fn left(l: Link) { }
	fn right(l: Link) { }
	fn getChild(cmp: bool) Link* { }
	fn rotate(cmp: bool) Link { }


public:
	static fn build(n: Node*, c: Colour) Link { }
}

struct Path
{
public:
	fn colour() Colour { }
	fn isRed() bool { }
	fn isBlack() bool { }
	fn cmp() bool { }
	fn node() Node* { }
	fn link() Link { }
	fn getWithLink(l: Link) Path { }
	fn getWithCmp(c: bool) Path { }
	fn getChild(c: bool) Link* { }


public:
	static fn build(l: Link, c: bool) Path { }
}

//! The tree's root object. This doesn't allocate any nodes, that is
//! handled by the client code. Test and compare delegates are user
//! defined.
struct RBTree
{
public:
	alias TestDg = scope (i32 delegate(Node*));
	alias CompDg = scope (i32 delegate(Node*, Node*));
	alias VisitDg = scope (void delegate(Node*));
	alias FindDg = scope (bool delegate(Node*));


public:
	root: Node*;


public:
	fn get(test: scope (TestDg)) Node* { }
	fn find(test: scope (FindDg)) Node* { }
	fn find(n: Node*, test: scope (FindDg)) Node* { }
	fn visit(func: scope (VisitDg)) { }
	fn insert(n: Node*, compare: scope (CompDg)) { }
	fn remove(n: Node*, compare: scope (CompDg)) { }
	fn extractAny(compare: scope (CompDg)) Node* { }
	fn extract(n: Node*, compare: scope (CompDg)) Node* { }
}

vrt.gc.util.buddy

//! A simple buddy allocator, only does tracking of which blocks are free
module vrt.gc.util.buddy;


struct GigaBuddy
{
public:
	enum MinOrder;
	enum MaxOrder;
	enum NumLevels;
	enum MinNumBits;
	enum MaxNumBits;
	enum NumBitsPerElm;
	enum NumBits;
	enum NumElems;


public:
	fn setup() { }
	fn reserveStart(n: size_t) { }
	fn canAlloc(order: size_t) bool { }
	fn alloc(order: size_t) size_t { }
	fn free(order: size_t, n: size_t) { }
}

fn countLeadingZeros(bits: u8, isZeroUndef: bool) u8;

vrt.gc.util

module vrt.gc.util;


enum _SC_PAGESIZE;

//! assert(foo) -> if (!foo) { throw new ... } -> code explosion Avoid real
//! asserts, and use this function instead, in GC code.
fn gcAssert(b: bool, loc: const(char)[]) { }
fn isPowerOfTwo(n: size_t) bool { }
fn nextHighestPowerOfTwo(n: size_t) size_t { }
fn sysconf(i32) ptrdiff_t;
fn getPageSize() size_t { }
fn roundUpToPageSize(n: size_t) size_t { }
fn makeRange(range: const(const(void)[])) const(const(void)*)[] { }
fn makeRangeNoAlign(range: const(const(void)[])) const(const(void)*)[] { }

vrt.gc.extent

//! Holds the code for managing extents.
module vrt.gc.extent;


//! Metadata about a single region of user allocated memory.
struct Extent
{
public:
	enum SlabShift;
	enum SlabMask;
	enum KindShift;
	enum KindMask;
	enum MarkedShift;
	enum MarkedMask;
	enum InternalShift;
	enum InternalMask;
	enum DataMask;
	enum Alignment;


public:
	enum Kind
	{
		None,
		Ptr,
		Fin,
		PtrFin,
	}


public:
	node: UnionNode;


public:
	fn setupSlab(ptr: void*, n: size_t, finalizer: bool, pointers: bool, internal: bool) { }
	fn setupLarge(ptr: void*, n: size_t, finalizer: bool, pointers: bool, internal: bool) { }
	fn ptr() void* { }
	fn data() size_t { }
	fn data(d: size_t) { }
	fn size() size_t { }
	fn min() size_t { }
	fn max() size_t { }
	fn isInternal() bool { }
	fn isSlab() bool { }
	fn isLarge() bool { }
	fn kind() Kind { }
	fn hasFinalizer() bool { }
	fn hasPointers() bool { }


public:
	static fn makeKind(finalizer: bool, pointers: bool) Kind { }
}

vrt.gc.sections.linux

module vrt.gc.sections.linux;


global sections: const(const(void)*)[][2];

fn initSections() { }

vrt.gc.sections

//! Module for selecting section.
module vrt.gc.sections;

public import vrt.gc.sections.linux;

vrt.gc.sections.osx

module vrt.gc.sections.osx;

vrt.gc.sections.windows

module vrt.gc.sections.windows;

vrt.gc.manager.pagetable

//! Companion module to GigaMan, implements the pagetable.
module vrt.gc.manager.pagetable;


//! This struct implements a 1GB page table. It assumes that it has been
//! placed at the beginning of the memory area that it is managing.
struct PageTable
{
public:
	enum MaximumSize;
	enum TotalSize;
	enum FirstSize;
	enum PageSize;
	enum PageEntrySize;
	enum PageEntryBits;
	enum PageTableNum;
	enum PageTableSize;
	enum FirstEntrySize;
	enum FirstEntryBits;
	enum FirstNumBits;
	enum FirstNum;


public:
	alias PageEntryType = u32;
	alias FirstEntryType = u64;


public:
	fn setup(totalArenaSize: size_t) { }
	fn inBounds(ptr: void*) bool { }
	fn canAlloc(n: size_t) bool { }
	fn free(index: size_t, n: size_t) { }
	fn allocIndex(n: size_t) size_t { }
	fn getPageEntryPtrFromIndex(index: size_t) PageEntryType* { }
	fn getPageEntryPtr(ptr: void*) PageEntryType* { }
	fn checkFirst(index: size_t) bool { }
	fn setFirst(index: size_t) { }
	fn setPageEntry(index: size_t, data: PageEntryType) { }
	fn setPageEntry(ptr: void*, data: PageEntryType) { }
	fn globalToRelative(ptr: void*) size_t { }
	fn relativeToGlobal(rel: size_t) void* { }


public:
	static fn relativeToPageIndex(addr: size_t) size_t { }
	static fn relativeToFirstIndex(addr: size_t) size_t { }
	static fn pageIndexToRelative(index: size_t) size_t { }
	static fn pageIndexToFirstIndex(index: size_t) size_t { }
	static fn firstIndexToRelative(index: size_t) size_t { }
	static fn pageTableToBuddyIndex(order: size_t, index: size_t) size_t { }
	static fn buddyIndexToPageTable(order: size_t, index: size_t) size_t { }
	static fn sizeToBuddyOrder(n: size_t) size_t { }
}

vrt.gc.manager.rbman

//! This module holds code that mangages allocating memory for extents and
//! memory for the objects in the extents. This manager uses a RBTree to
//! search to search for extents.
module vrt.gc.manager.rbman;


//! Extent manager that uses a RBTree to enable searching of pointers.
struct RBMan
{
public:
	fn setup(size: size_t) { }
	fn treeVisit(dlg: scope (RBTree.VisitDg)) { }
	fn treeInsert(n: UnionNode*, compare: scope (RBTree.CompDg)) { }
	fn getExtentFromPtr(ptr: void*) Extent* { }
	fn totalSize() size_t { }
	fn prepareForCollect() { }
	fn shutdown() { }
	fn allocSlabStruct(associatedPtr: void*, associatedSz: size_t) Slab* { }
	fn allocLargeStruct(associatedPtr: void*, associatedSz: size_t) Large* { }
	fn freeSlabStructAndMem(slab: Slab*) { }
	fn freeLargeStructAndMem(large: Large*) { }
	fn freeInternalStruct(slab: Slab*) { }
	fn allocMemoryFromOS(n: size_t) void* { }
	fn freeMemoryToOS(ptr: void*, n: size_t) { }
	fn setLowestPointer() { }
	fn setHighestPointer() { }
	fn getExtentFromPtr(ptr: void*, _extents: RBTree) Extent* { }
	fn compareExtent(n1: Node*, n2: Node*) i32 { }
	fn alwaysHit(Node*, Node*) i32 { }
	fn emptySlab(n: Node*) bool { }


public:
	static fn allocGC(n: size_t) void* { }
}

vrt.gc.manager.gigaman

//! GigaMan reserves a gigabyte of memory and allocates slabs from that
//! using a buddy allocator.
module vrt.gc.manager.gigaman;


struct GigaMan
{
public:
	fn setup(totalArenaSize: size_t) { }
	fn treeVisit(dlg: scope (RBTree.VisitDg)) { }
	fn remove(ln: LinkedNode*) { }
	fn treeInsert(n: UnionNode*, compare: scope (RBTree.CompDg)) { }
	fn getExtentFromPtr(ptr: void*) Extent* { }
	fn totalSize() size_t { }
	fn prepareForCollect() { }
	fn shutdown() { }
	fn allocSlabStruct(associatedPtr: void*, associatedSz: size_t) Slab* { }
	fn allocLargeStruct(associatedPtr: void*, associatedSz: size_t) Large* { }
	fn freeSlabStructAndMem(slab: Slab*, shutdown: bool) { }
	fn freeLargeStructAndMem(large: Large*, shutdown: bool) { }
	fn freeInternalStruct(slab: Slab*) { }
	//! Allocates a chunk of memory from the OS.
	fn allocMemoryFromOS(n: size_t) void* { }
	fn freeMemoryToOS(ptr: void*, n: size_t) { }
	fn setLowestPointer() { }
	fn setHighestPointer() { }
	fn compareExtent(n1: Node*, n2: Node*) i32 { }
	fn alwaysHit(Node*, Node*) i32 { }
	//! Does n contain an empty Slab?
	fn emptySlab(n: Node*) bool { }


public:
	static fn allocGC(sz: size_t) void* { }
}

vrt.gc.manager

//! This module selects the appropriate Manager to use.
module vrt.gc.manager;


alias Manager = vrt.gc.manager.gigaman.GigaMan;

vrt.gc.hit

module vrt.gc.hit;


struct HitEntry
{
public:
	extent: Extent*;
	ptr: void*;
}

struct HitStack
{
public:
	fn hitInit() { }
	fn add() HitEntry* { }
	fn top() HitEntry* { }
	fn pop() { }
	fn reset() { }
	fn free() { }
}

vrt.gc.errors

module vrt.gc.errors;


fn panicFailedToAlloc(n: size_t, loc: string) { }
fn panicMmapFailed(n: size_t, ret: i32, loc: string) { }

vrt.gc.entry

module vrt.gc.entry;


struct GcHeap
{
public:
	arena: Arena*;
}

local heap: GcHeap;

fn vrt_gc_init() { }
fn vrt_gc_get_stats(stats: Stats) { }
fn vrt_gc_get_alloc_dg() AllocDg { }
fn vrt_gc_shutdown() { }
fn vrt_gc_collect() { }
fn vrt_gc_total_size() size_t { }
fn vrt_gc_print_stats() { }

vrt.gc.slab

//! Stuct and code for sub-allocating data from a memory extent.
module vrt.gc.slab;


//! Multiple smaller user memory allocations.
struct Slab
{
public:
	enum MaxSlots;


public:
	alias Alignment = Extent.Alignment;


public:
	extent: Extent;
	bitmap: u32[16];
	marked: u32[16];
	header: u16;
	freeSlots: u16;
	order: u8;
	next: Slab*;


public:
	fn setup(order: u8, memory: void*, finalizer: bool, pointer: bool, internal: bool) { }
	fn allocate() u32 { }
	fn freeAll() { }
	fn makeAllMoreSorted(root: Slab**) { }
	fn isFree(bit: u32) bool { }
	fn free(bit: u32) { }
	fn usedSlots() u16 { }
	fn isMarked(bit: u32) bool { }
	fn mark(bit: u32) { }
	fn isMarked(ptr: void*) bool { }
	fn markChild(ptr: void*) { }
	fn clearMarked() { }
	fn isChildPointer(ptr: void*) bool { }
	fn freePointer(ptr: void*) { }
	fn pointerToSlotStart(ptr: void*) void* { }
	fn slotToPointer(slot: u32) void* { }
	fn pointerToSlot(ptr: void*) i64 { }
	fn hasPointers() bool { }
	fn hasFinalizer() bool { }
}

fn sizeToOrder(n: size_t) u8 { }
fn orderToSize(order: u8) size_t { }
fn countTrailingZeros(bits: u32, isZeroUndef: bool) u32;

vrt.gc.mman.mmap

module vrt.gc.mman.mmap;


fn pages_map(addr: void*, size: size_t, loc: string) void* { }
fn pages_reserve(addr: void*, size: size_t, loc: string) void* { }
fn pages_commit(addr: void*, size: size_t) bool { }
fn pages_uncommit(addr: void*, size: size_t) bool { }
fn pages_unmap(addr: void*, size: size_t) { }

vrt.gc.mman

module vrt.gc.mman;

public import vrt.gc.mman.mmap;

vrt.gc.mman.windows

module vrt.gc.mman.windows;

vrt.gc.linkednode

//! Doubly linked list for GigaMan to track extents allocated without the
//! extent tree.
module vrt.gc.linkednode;


struct LinkedNode
{
public:
	prev: LinkedNode*;
	next: LinkedNode*;
}

//! A union of LinkedNode and Node. The code that deals with their extents
//! knows which one they want, so there's no need to distinguish between
//! them on the extent itself.
union UnionNode
{
public:
	linked: LinkedNode;
	tree: Node;
}

vrt.ext.stdc

//! Standard C lib functions used by the runtime.
module vrt.ext.stdc;

public import core.c.stdint;
public import core.c.stdlib;
public import core.c.stdio;

vrt.ext.unwind

module vrt.ext.unwind;


enum _Unwind_Reason_Code
{
	NO_REASON,
	FOREIGN_EXCEPTION_CAUGHT,
	FATAL_PHASE2_ERROR,
	FATAL_PHASE1_ERROR,
	NORMAL_STOP,
	END_OF_STACK,
	HANDLER_FOUND,
	INSTALL_CONTEXT,
	CONTINUE_UNWIND,
}

enum _Unwind_Action
{
	SEARCH_PHASE,
	CLEANUP_PHASE,
	HANDLER_FRAME,
	FORCE_UNWIND,
	END_OF_STACK,
}

alias _Unwind_Exception_Cleanup_Fn = fn (_Unwind_Reason_Code, _Unwind_Exception*) (void);

struct _Unwind_Exception
{
public:
	exception_class: u64;
	exception_cleanup: _Unwind_Exception_Cleanup_Fn;
	private_1: uintptr_t;
	private_2: uintptr_t;
}

struct _Unwind_Context
{
}

fn _Unwind_Resume(_Unwind_Exception*) i32;
fn _Unwind_RaiseException(_Unwind_Exception*) i32;
fn _Unwind_GetLanguageSpecificData(ctx: _Unwind_Context*) u8*;
fn _Unwind_GetRegionStart(ctx: _Unwind_Context*) size_t;
fn _Unwind_GetTextRelBase(ctx: _Unwind_Context*) size_t;
fn _Unwind_GetDataRelBase(ctx: _Unwind_Context*) size_t;
fn _Unwind_GetGR(ctx: _Unwind_Context*, i: i32) size_t;
fn _Unwind_GetIP(ctx: _Unwind_Context*) uintptr_t;
fn _Unwind_SetGR(ctx: _Unwind_Context*, i: i32, n: size_t);
fn _Unwind_SetIP(ctx: _Unwind_Context*, new_value: uintptr_t);

vrt.ext.dwarf

module vrt.ext.dwarf;


enum DW_EH_PE_omit;
enum DW_EH_PE_absptr;
enum DW_EH_PE_uleb128;
enum DW_EH_PE_udata2;
enum DW_EH_PE_udata4;
enum DW_EH_PE_udata8;
enum DW_EH_PE_sleb128;
enum DW_EH_PE_sdata2;
enum DW_EH_PE_sdata4;
enum DW_EH_PE_sdata8;
enum DW_EH_PE_pcrel;
enum DW_EH_PE_textrel;
enum DW_EH_PE_datarel;
enum DW_EH_PE_funcrel;
enum DW_EH_PE_aligned;
enum DW_EH_PE_indirect;

struct DW_Context
{
public:
	textrel: void*;
	datarel: void*;
	funcrel: void*;
}

fn dw_read_uleb128(data: const(u8)**) uintptr_t { }
fn dw_read_sleb128(data: const(u8)**) uintptr_t { }
fn dw_read_ubyte(data: const(u8)**) u8 { }
fn dw_encoded_size(encoding: u8) size_t { }
fn dw_read_encoded(data: const(u8)**, encoding: u8) uintptr_t { }

vrt.os.thread

//! Code to support spawning new threads.
module vrt.os.thread;


enum EPERM;
enum EAGAIN;
enum EINVAL;
enum EDEADLK;

struct vrt_thread
{
}

struct vrt_mutex
{
}

struct FunctionAdaptor
{
public:
	ptr: fn () (void);


public:
	fn dgt() { }
}

//! The bottom of the stack.
local __stack_bottom: void*;

fn vrt_mutex_new() vrt_mutex* { }
fn vrt_mutex_trylock(mutex: vrt_mutex*) bool { }
fn vrt_mutex_lock(mutex: vrt_mutex*) bool { }
fn vrt_mutex_unlock(mutex: vrt_mutex*) { }
fn vrt_mutex_delete(mutex: vrt_mutex*) { }
fn vrt_thread_start_fn(func: fn () (void)) vrt_thread* { }
fn vrt_thread_start_dg(dlgt: void delegate()) vrt_thread* { }
fn vrt_thread_error(t: vrt_thread*) bool { }
fn vrt_thread_error_message(t: vrt_thread*) string { }
fn vrt_thread_join(t: vrt_thread*) { }
fn vrt_sleep(ms: u32) { }
fn vrt_get_stack_bottom() void* { }

vrt.os.eh.common

module vrt.os.eh.common;


//! Exception class, used to identify for other handlers.
global VRT_EH_NAME: string;

vrt.os.eh.unwind

//! Exception handling using libunwind and DWARF.
module vrt.os.eh.unwind;


enum vrt_eh_return_0;
enum vrt_eh_return_1;

//! Our exception struct, we put the exception after, that seems to work,
//! everybody else puts it before.
struct vrt_eh_exception
{
public:
	e: _Unwind_Exception;
	t: Throwable;
}

//! Per thread callback for applications getting exceptions.
local lCallback: fn (Throwable, string) (void);

fn vrt_eh_set_callback(cb: fn (Throwable, string) (void)) { }
//! Throws an exception.
fn vrt_eh_throw(t: Throwable, location: string) { }
fn vrt_eh_rethrow(t: Throwable) { }
fn vrt_eh_throw_assert_error(location: string, msg: string) { }
fn vrt_eh_throw_slice_error(location: string) { }
fn vrt_eh_throw_key_not_found_error(location: string) { }
//! Mandated by the ABI, not needed for Volt.
fn vrt_eh_delete(reason: _Unwind_Reason_Code, exceptionObject: _Unwind_Exception*) { }
//! Big do everything function.
fn vrt_eh_personality_v0_real(ver: i32, actions: _Unwind_Action, exceptionClass: u64, exceptionObject: _Unwind_Exception*, ctx: _Unwind_Context*) _Unwind_Reason_Code { }
fn vrt_eh_install_action(ip: uintptr_t, actions: _Unwind_Action, switchVal: uintptr_t, t: Throwable, ctx: _Unwind_Context*) _Unwind_Reason_Code { }
fn vrt_eh_install_finally(ip: uintptr_t, actions: _Unwind_Action, exceptionObject: _Unwind_Exception*, ctx: _Unwind_Context*) _Unwind_Reason_Code { }

vrt.os.eh.stub

module vrt.os.eh.stub;

vrt.os.eh.windows

//! Exception handling using Windows' SEH.
module vrt.os.eh.windows;

vrt.os.gtors

module vrt.os.gtors;


global globalConstructors: fn () (void)[];
global globalDestructors: fn () (void)[];
global localConstructors: fn () (void)[];
global localDestructors: fn () (void)[];

fn vrt_run_global_ctors() { }
fn vrt_run_local_ctors() { }
fn vrt_run_global_dtors() { }
fn vrt_run_local_dtors() { }

vrt.os.monotonic

//! Implementation of monotic interface in core.rt.misc.
module vrt.os.monotonic;


global ticksAtInit: i64;
global ticksPerSecond: i64;

fn vrt_monotonic_ticks_per_second() i64 { }
fn vrt_monotonic_ticks_at_init() i64 { }
fn vrt_monotonic_init() { }
fn vrt_monotonic_ticks() i64 { }
fn posixTicksPerSecond(clock: i32) i64 { }
fn posixTicks(clock: i32) i64 { }
fn convClockFreq(ticks: i64, srcTicksPerSecond: i64, dstTicksPerSecond: i64) i64 { }

vrt.os.panic

module vrt.os.panic;


fn vrt_panic(msgs: const(char)[][], location: const(char)[]) { }

core.exception

module core.exception;


//! Base class of all objects that can be thrown.
class Throwable
{
public:
	msg: string;
	throwLocation: string;
	location: string;


public:
	//! Construct a Throwable object.
	this(msg: string, location: string) { }
}

//! An error that can be handled.
class Exception : Throwable
{
public:
	//! Construct an Exception object.
	this(msg: string, location: string) { }
}

//! An error that cannot be handled.
class Error : Throwable
{
public:
	//! Construct an Error object.
	this(msg: string, location: string) { }
}

//! Thrown if an assert fails.
class AssertError : Error
{
public:
	//! Construct an AssertError object.
	this(msg: string, location: string) { }
}

//! Thrown by the UTF code upon a malformed UTF-8 string.
class MalformedUTF8Exception : Exception
{
public:
	//! Construct a MalformedUTF8Exception object.
	this(msg: string, location: string) { }
}

//! Thrown on an AA lookup failure.
class KeyNotFoundException : Exception
{
public:
	//! Construct a KeyNotFoundException object.
	this(msg: string) { }
}

core.compiler.llvm

//! LLVM intrinsic function definitions.
module core.compiler.llvm;


alias __llvm_memset = __llvm_memset_p0i8_i64;
alias __llvm_memcpy = __llvm_memcpy_p0i8_p0i8_i64;
alias __llvm_memmove = __llvm_memmove_p0i8_p0i8_i64;

//! http://llvm.org/docs/LangRef.html#llvm-trap-intrinsic>
fn __llvm_trap();
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memset-element-unordered-atomic-intrinsic>
fn __llvm_memset_p0i8_i32(dest: void*, val: u8, len: u32, _align: i32, _volatile: bool);
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memset-element-unordered-atomic-intrinsic>
fn __llvm_memset_p0i8_i64(dest: void*, val: u8, len: u64, _align: i32, _volatile: bool);
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memcpy-intrinsic>
fn __llvm_memcpy_p0i8_p0i8_i32(dest: void*, src: void*, len: u32, _align: i32, _volatile: bool);
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memcpy-intrinsic>
fn __llvm_memcpy_p0i8_p0i8_i64(dest: void*, src: void*, len: u64, _align: i32, _volatile: bool);
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memmove-intrinsic>
fn __llvm_memmove_p0i8_p0i8_i32(dest: void*, src: void*, len: u32, _align: i32, _volatile: bool);
//! http://releases.llvm.org/6.0.0/docs/LangRef.html#llvm-memmove-intrinsic>
fn __llvm_memmove_p0i8_p0i8_i64(dest: void*, src: void*, len: u64, _align: i32, _volatile: bool);
//! http://llvm.org/docs/ExceptionHandling.html#llvm-eh-typeid-for>
fn __llvm_typeid_for(void*) i32;

core.compiler.defaultsymbols

//! This file is included all modules (excluding this module).
module core.compiler.defaultsymbols;


//! These are two types are aliases to integer types that are large enough
//! to offset the entire available address space.
alias size_t = u64;
//! These are two types are aliases to integer types that are large enough
//! to offset the entire available address space.
alias ptrdiff_t = i64;
//! The string type.
alias string = immutable(char)[];

core.typeinfo

module core.typeinfo;


//! The types of Volt, the type field of TypeInfo.
enum Type
{
	Struct,
	Class,
	Interface,
	Union,
	Enum,
	Attribute,
	Void,
	U8,
	I8,
	Char,
	Bool,
	U16,
	I16,
	Wchar,
	U32,
	I32,
	Dchar,
	F32,
	U64,
	I64,
	F64,
	Real,
	Pointer,
	Array,
	StaticArray,
	AA,
	Function,
	Delegate,
}

//! Information for a type that can be retrieved at runtime.
class TypeInfo
{
public:
	//! The size of the type, in bytes.
	size: size_t;
	//! The specific type. A member of the Type enum.
	type: i32;
	//! The Volt mangled name (if any)
	mangledName: char[];
	//! Can this type mutate memory?
	mutableIndirection: bool;
	//! The class init struct, if this points at a class.
	classInit: void*;
	//! The size of the class, if this points at a class.
	classSize: size_t;
	//! The base type for arrays (dynamic and static), and pointers.
	base: TypeInfo;
	//! If this points at a static array, how long is it?
	staticArrayLength: size_t;
	key: TypeInfo;
	//! The key and value types for AAs.
	value: TypeInfo;
	//! For functions and delegates, what's the return type?
	ret: TypeInfo;
	//! For functions and delegates, what are the parameter types?
	args: TypeInfo[];


public:
	this() { }
}

//! A TypeInfo used by classes.
class ClassInfo : TypeInfo
{
public:
	//! The interfaces the class this refers to implements.
	interfaces: InterfaceInfo[];


public:
	this() { }
}

//! Type information for interfaces.
class InterfaceInfo
{
public:
	//! The tinfo for the pointed at interface.
	info: TypeInfo;
	//! How many bytes after the vtable does the information for this
	//! interface lie?
	offset: size_t;


public:
	this() { }
}

core.varargs

module core.varargs;


//! Represents the list of arguments given to variadic functions.
alias va_list = void*;

//! Prepare a va_list for use.
fn va_start(vl: va_list);
//! Stop working with a va_list.
fn va_end(vl: va_list);

core.c.time

module core.c.time;


enum CLOCKS_PER_SEC;

alias time_t = c_long;
alias clock_t = c_long;

struct tm
{
public:
	tm_sec: i32;
	tm_min: i32;
	tm_hour: i32;
	tm_mday: i32;
	tm_mon: i32;
	tm_year: i32;
	tm_wday: i32;
	tm_yday: i32;
	tm_isdst: i32;
	tm_gmtoff: c_long;
	tm_zone: const(char)*;
}

fn clock() clock_t;
fn difftime(time1: time_t, time0: time_t) f64;
fn mktime(timeptr: tm*) time_t;
fn time(timer: time_t*) time_t;
fn asctime(timeptr: const(const(tm)*)) char*;
fn ctime(timer: const(const(time_t)*)) char*;
fn gmtime(timer: const(const(time_t)*)) tm*;
fn localtime(timer: const(const(time_t)*)) tm*;
fn strftime(s: char*, maxsize: size_t, format: const(const(char)*), timeptr: const(const(tm)*)) size_t;
fn tzset();

core.c.windows.winhttp

module core.c.windows.winhttp;

core.c.windows

//! Windows bindings module that imports all other windows modules.
module core.c.windows;

core.c.windows.wgl

module core.c.windows.wgl;

core.c.windows.vk

module core.c.windows.vk;

core.c.windows.winsock2

//! WinSock2 bindings module.
module core.c.windows.winsock2;

core.c.windows.windows

//! Windows bindings.
module core.c.windows.windows;

core.c.wchar_

module core.c.wchar_;

public import core.c.stddef;
public import core.c.time;
public import core.c.stdint;


enum WEOF;

alias mbstate_t = i32;
alias wint_t = u32;

fn fwprintf(stream: FILE*, format: const(const(wchar_t)*)) i32;
fn fwscanf(stream: FILE*, format: const(const(wchar_t)*)) i32;
fn swprintf(s: wchar_t*, n: size_t, format: const(const(wchar_t)*)) i32;
fn swscanf(s: const(const(wchar_t)*), format: const(const(wchar_t)*)) i32;
fn vfwprintf(stream: FILE*, format: const(const(wchar_t)*), arg: va_list) i32;
fn vfwscanf(stream: FILE*, format: const(const(wchar_t)*), arg: va_list) i32;
fn vswprintf(s: wchar_t*, n: size_t, format: const(const(wchar_t)*), arg: va_list) i32;
fn vswscanf(s: const(const(wchar_t)*), format: const(const(wchar_t)*), arg: va_list) i32;
fn vwprintf(format: const(const(wchar_t)*), arg: va_list) i32;
fn vwscanf(format: const(const(wchar_t)*), arg: va_list) i32;
fn wprintf(format: const(const(wchar_t)*)) i32;
fn wscanf(format: const(const(wchar_t)*)) i32;
fn fgetwc(stream: FILE*) wint_t;
fn fputwc(c: wchar_t, stream: FILE*) wint_t;
fn fgetws(s: wchar_t*, n: i32, stream: FILE*) wchar_t*;
fn fputws(s: const(const(wchar_t)*), stream: FILE*) i32;
fn ungetwc(c: wint_t, stream: FILE*) wint_t;
fn fwide(stream: FILE*, mode: i32) i32;
fn wcstod(const(const(wchar_t)*), wchar_t**) f64;
fn wcstof(const(const(wchar_t)*), wchar_t**) f32;
fn wcstol(const(const(wchar_t)*), wchar_t**, i32) c_long;
fn wcstoll(const(const(wchar_t)*), wchar_t**, i32) i64;
fn wcstoul(const(const(wchar_t)*), wchar_t**, i32) c_ulong;
fn wcstoull(const(const(wchar_t)*), wchar_t**, i32) u64;
fn wcscpy(s1: wchar_t*, s2: const(const(wchar_t)*)) wchar_t*;
fn wcsncpy(s1: wchar_t*, s2: const(const(wchar_t)*), n: size_t) wchar_t*;
fn wcscat(s1: wchar_t*, s2: const(const(wchar_t)*)) wchar_t*;
fn wcsncat(s1: wchar_t*, s2: const(const(wchar_t)*), n: size_t) wchar_t*;
fn wcscmp(const(const(wchar_t)*), const(const(wchar_t)*)) i32;
fn wcscoll(const(const(wchar_t)*), const(const(wchar_t)*)) i32;
fn wcsncmp(const(const(wchar_t)*), const(const(wchar_t)*), size_t) i32;
fn wcsxfrm(wchar_t*, const(const(wchar_t)*), size_t) size_t;
fn wcschr(const(const(wchar_t)*), wchar_t) wchar_t*;
fn wcscspn(const(const(wchar_t)*), const(const(wchar_t)*)) size_t;
fn wcspbrk(const(const(wchar_t)*), const(const(wchar_t)*)) wchar_t*;
fn wcsrchr(const(const(wchar_t)*), wchar_t) wchar_t*;
fn wcsspn(const(const(wchar_t)*), const(const(wchar_t)*)) size_t;
fn wcsstr(const(const(wchar_t)*), const(const(wchar_t)*)) wchar_t*;
fn wcstok(wchar_t*, const(const(wchar_t)*), wchar_t**) wchar_t*;
fn wcslen(const(const(wchar_t)*)) size_t;
fn wmemchr(const(const(wchar_t)*), wchar_t, size_t) wchar_t*;
fn wmemcmp(const(const(wchar_t)*), const(const(wchar_t)*), size_t) i32;
fn wmemcpy(wchar_t*, const(const(wchar_t)*), size_t) wchar_t*;
fn wmemmove(wchar_t*, const(const(wchar_t)*), size_t) wchar_t*;
fn wmemset(wchar_t*, wchar_t, size_t) wchar_t*;
fn wcsftime(wchar_t*, size_t, const(const(wchar_t)*), const(const(tm)*)) size_t;
fn btowc(i32) wint_t;
fn wctob(wint_t) i32;
fn mbsinit(const(const(mbstate_t)*)) i32;
fn mbrlen(const(const(char)*), size_t, mbstate_t*) size_t;
fn mbrtowc(wchar_t*, const(const(char)*), size_t, mbstate_t*) size_t;
fn wcrtomb(char*, wchar_t, mbstate_t*) size_t;
fn mbsrtowcs(wchar_t*, const(char)**, size_t, mbstate_t*) size_t;
fn wcsrtombs(char*, const(wchar_t)**, size_t, mbstate_t*) size_t;

core.c.errno

module core.c.errno;


fn vrt_set_errno(val: i32) i32;
fn vrt_get_errno() i32;
fn errno() i32 { }
fn errno(val: i32) i32 { }

core.c.osx

//! Assorted OSX function bindings.
module core.c.osx;

core.c.posix.time

module core.c.posix.time;

public import core.c.time;
public import core.c.posix.sys.types;


enum CLOCK_MONOTONIC;
enum CLOCK_MONOTONIC_RAW;
enum CLOCK_MONOTONIC_COARSE;
enum CLOCK_PROCESS_CPUTIME_ID;
enum CLOCK_THREAD_CPUTIME_ID;
enum CLOCK_REALTIME;
enum CLOCK_REALTIME_COARSE;
enum TIMER_ABSTIME;

alias clockid_t = i32;
alias timer_t = i32;

struct timespec
{
public:
	tv_sec: time_t;
	tv_nsec: c_long;
}

struct itimerspec
{
public:
	it_interval: timespec;
	it_value: timespec;
}

global daylight: i32;
global timezone: c_long;

fn timegm(tm*) time_t;
fn clock_getres(clockid_t, timespec*) i32;
fn clock_gettime(clockid_t, timespec*) i32;
fn clock_settime(clockid_t, const(const(timespec)*)) i32;
fn nanosleep(const(const(timespec)*), timespec*) i32;
fn timer_delete(timer_t) i32;
fn timer_gettime(timer_t, itimerspec*) i32;
fn timer_getoverrun(timer_t) i32;
fn timer_settime(timer_t, i32, const(const(itimerspec)*), itimerspec*) i32;
fn asctime_r(const(const(tm)*), char*) char*;
fn ctime_r(const(const(time_t)*), char*) char*;
fn gmtime_r(const(const(time_t)*), tm*) tm*;
fn localtime_r(const(const(time_t)*), tm*) tm*;
fn getdate(const(const(char)*)) tm*;
fn strptime(const(const(char)*), const(const(char)*), tm*) char*;

core.c.posix.dirent

module core.c.posix.dirent;

public import core.c.posix.sys.types;


enum DT_UNKNOWN;
enum DT_FIFO;
enum DT_CHR;
enum DT_DIR;
enum DT_BLK;
enum DT_REG;
enum DT_LNK;
enum DT_SOCK;
enum DT_WHT;

struct dirent
{
public:
	d_ino: ino_t;
	d_off: off_t;
	d_reclen: u16;
	d_type: u8;
	d_name: char[256];
}

struct DIR
{
}

fn readdir(DIR*) dirent*;
fn opendir(const(char)*) DIR*;
fn closedir(DIR*) i32;
fn readdir_r(DIR*, dirent*, dirent**) i32;
fn seekdir(DIR*, c_long);
fn telldir(DIR*) c_long;

core.c.posix.fcntl

module core.c.posix.fcntl;


enum F_DUPFD;
enum F_GETFD;
enum F_SETFD;
enum F_GETFL;
enum F_SETFL;
enum F_GETLK;
enum F_SETLK;
enum F_SETLKW;
enum F_GETOWN;
enum F_SETOWN;
enum FD_CLOEXEC;
enum F_RDLCK;
enum F_UNLCK;
enum F_WRLCK;
enum O_CREAT;
enum O_EXCL;
enum O_NOCTTY;
enum O_TRUNC;
enum O_APPEND;
enum O_NONBLOCK;
enum O_SYNC;
enum O_DSYNC;
enum O_RSYNC;
enum O_ACCMODE;
enum O_RDONLY;
enum O_WRONLY;
enum O_RDWR;
enum AT_SYMLINK_NOFOLLOW;
enum AT_FDCWD;

struct flock
{
public:
	l_type: i16;
	l_whence: i16;
	l_start: off_t;
	l_len: off_t;
	l_pid: pid_t;
}

fn creat(const(const(char)*), mode_t) i32;
fn open(const(const(char)*), i32) i32;
fn fcntl(i32, i32) i32;
fn posix_fallocate(i32, off_t, off_t) i32;

core.c.posix.spawn

module core.c.posix.spawn;


enum POSIX_SPAWN_RESETIDS;
enum POSIX_SPAWN_SETPGROUP;
enum POSIX_SPAWN_SETSIGDEF;
enum POSIX_SPAWN_SETSIGMASK;
enum POSIX_SPAWN_SETSCHEDPARAM;
enum POSIX_SPAWN_SETSCHEDULER;
enum POSIX_SPAWN_USEVFORK;

alias posix_spawn_file_actions_t = posix_spawn_file_actions;
alias posix_spawnattr_t = posix_spawnattr;

struct posix_spawn_file_actions
{
public:
	__data: void[80];
}

struct posix_spawnattr
{
public:
	__data: void[336];
}

fn posix_spawn(pid_t*, const(char)*, const(posix_spawn_file_actions_t)*, const(posix_spawnattr_t)*, const(const(char)*)*, const(const(char)*)*) i32;
fn posix_spawn(pid_t*, const(char)*, const(posix_spawn_file_actions_t)*, const(posix_spawnattr_t)*, const(const(char)*)*, const(const(char)*)*) i32;
fn posix_spawnattr_init(posix_spawnattr_t*) i32;
fn posix_spawnattr_destroy(posix_spawnattr_t*) i32;
fn posix_spawnattr_getflags(const(posix_spawnattr_t)*, i16*) i32;
fn posix_spawnattr_setflags(posix_spawnattr_t*, i16) i32;
fn posix_spawnattr_getpgroup(const(posix_spawnattr_t)*, pid_t*) i32;
fn posix_spawnattr_setpgroup(posix_spawnattr_t*, pid_t) i32;
fn posix_spawnattr_getschedpolicy(const(posix_spawnattr_t)*, i32*) i32;
fn posix_spawnattr_setschedpolicy(posix_spawnattr_t*, i32) i32;
fn posix_spawn_file_actions_init(posix_spawn_file_actions_t*) i32;
fn posix_spawn_file_actions_destroy(posix_spawn_file_actions_t*) i32;
fn posix_spawn_file_actions_addopen(posix_spawn_file_actions_t*, i32, const(char)*, i32, mode_t) i32;
fn posix_spawn_file_actions_addclose(posix_spawn_file_actions_t*, i32) i32;
fn posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t*, i32, i32) i32;

core.c.posix.arpa.inet

module core.c.posix.arpa.inet;

public import core.c.posix.sys.socket;


enum INET_ADDRSTRLEN;
enum INET6_ADDRSTRLEN;

alias in_port_t = u16;
alias in_addr_t = u32;

struct in_addr
{
public:
	s_addr: in_addr_t;
}

fn htonl(u32) u32;
fn htons(u16) u16;
fn ntohl(u32) u32;
fn ntohs(u16) u16;
fn inet_addr(const(const(char)*)) in_addr_t;
fn inet_ntoa(in_addr) char*;
fn inet_ntop(i32, const(const(void)*), char*, socklen_t) const(char)*;
fn inet_pton(i32, const(const(char)*), void*) i32;

core.c.posix.dlfcn

//! dlopen and friends.
module core.c.posix.dlfcn;


enum RTLD_NOW;
enum RTLD_GLOBAL;

fn dlopen(file: const(char)*, mode: i32) void*;
fn dlclose(handle: void*) i32;
fn dlsym(handle: void*, name: const(char)*) void*;
fn dlerror() char*;

core.c.posix.sys.time

module core.c.posix.sys.time;

public import core.c.posix.sys.types;


enum ITIMER_REAL;
enum ITIMER_VIRTUAL;
enum ITIMER_PROF;

alias tv_sec_t = time_t;
alias tv_usec_t = suseconds_t;

struct timeval
{
public:
	tv_sec: time_t;
	tv_usec: suseconds_t;
}

struct itimerval
{
public:
	it_interval: timeval;
	it_value: timeval;
}

fn getitimer(i32, itimerval*) i32;
fn gettimeofday(timeval*, void*) i32;
fn setitimer(i32, const(const(itimerval)*), itimerval*) i32;
fn utimes(const(const(char)*), const(timeval)[2]) i32;

core.c.posix.sys.select

module core.c.posix.sys.select;


alias fd_mask = c_long;

struct fd_set
{
public:
	fds_bits: fd_mask[16];
}

fn FD_ZERO(set: fd_set*) { }
fn FD_SET(fd: i32, set: fd_set*) { }
fn FD_CLR(fd: i32, set: fd_set*) { }
fn FD_ISSET(fd: i32, set: fd_set*) i32 { }
fn select(i32, fd_set*, fd_set*, fd_set*, timeval*) i32;

core.c.posix.sys.types

module core.c.posix.sys.types;

public import core.c.stddef;
public import core.c.time;


alias blkcnt_t = c_long;
alias ino_t = c_ulong;
alias off_t = c_long;
alias blksize_t = c_long;
alias dev_t = u64;
alias gid_t = u32;
alias mode_t = u32;
alias nlink_t = c_ulong;
alias pid_t = i32;
alias ssize_t = c_long;
alias uid_t = u32;
alias fsblkcnt_t = c_ulong;
alias fsfilcnt_t = c_ulong;
alias id_t = u32;
alias key_t = i32;
alias suseconds_t = c_long;
alias useconds_t = u32;
alias pthread_spinlock_t = i32;

core.c.posix.sys.uio

module core.c.posix.sys.uio;

public import core.c.posix.sys.types;


struct iovec
{
public:
	iov_base: void*;
	iov_len: size_t;
}

fn readv(i32, const(const(iovec)*), i32) ssize_t;
fn writev(i32, const(const(iovec)*), i32) ssize_t;

core.c.posix.sys.wait

module core.c.posix.sys.wait;


fn WEXITSTATUS(rv: i32) i32 { }

core.c.posix.sys.stat

module core.c.posix.sys.stat;

public import core.c.stddef;
public import core.c.posix.sys.types;


enum S_IRUSR;
enum S_IWUSR;
enum S_IXUSR;
enum S_IRWXU;
enum S_IRGRP;
enum S_IRWXG;
enum S_IRWXO;
enum S_ISUID;
enum S_ISGID;
enum S_ISVTX;
enum S_IFMT;
enum S_IFBLK;
enum S_IFCHR;
enum S_IFIFO;
enum S_IFREG;
enum S_IFDIR;
enum S_IFLNK;
enum S_IFSOCK;

alias ulong_t = u64;
alias slong_t = u64;

struct stat_t
{
public:
	st_dev: dev_t;
	st_ino: ino_t;
	st_nlink: nlink_t;
	st_mode: mode_t;
	st_uid: uid_t;
	st_gid: gid_t;
	__pad0: u32;
	st_rdev: dev_t;
	st_size: off_t;
	st_blksize: blksize_t;
	st_blocks: blkcnt_t;
	st_atime: time_t;
	st_atimensec: ulong_t;
	st_mtime: time_t;
	st_mtimensec: ulong_t;
	st_ctime: time_t;
	st_ctimensec: ulong_t;
	__unused: slong_t[3];
}

fn S_ISBLK(mode: mode_t) bool { }
fn S_ISCHR(mode: mode_t) bool { }
fn S_ISDIR(mode: mode_t) bool { }
fn S_ISFIFO(mode: mode_t) bool { }
fn S_ISREG(mode: mode_t) bool { }
fn S_ISLNK(mode: mode_t) bool { }
fn S_ISSOCK(mode: mode_t) bool { }
fn S_TYPEISMQ(buf: stat_t*) bool { }
fn S_TYPEISSEM(buf: stat_t*) bool { }
fn S_TYPEISSHM(buf: stat_t*) bool { }
fn chmod(const(const(char)*), mode_t) i32;
fn fchmod(i32, mode_t) i32;
fn mkdir(const(const(char)*), mode_t) i32;
fn mkfifo(const(const(char)*), mode_t) i32;
fn umask(mode_t) mode_t;
fn fstat(i32, stat_t*) i32;
fn lstat(const(const(char)*), stat_t*) i32;
fn stat(const(const(char)*), stat_t*) i32;
fn mknod(const(const(char)*), mode_t, dev_t) i32;

core.c.posix.sys.stdlib

module core.c.posix.sys.stdlib;


fn setenv(scope (const(scope (char)*), scope (const(scope (char)*), i32) i32;
fn unsetenv(scope (const(scope (char)*)) i32;

core.c.posix.sys.un

module core.c.posix.sys.un;


struct sockaddr_un
{
public:
	sun_family: sa_family_t;
	sun_path: i8[108];
}

core.c.posix.sys.socket

module core.c.posix.sys.socket;


enum _SS_SIZE;
enum _SS_PADSIZE;
enum SCM_RIGHTS;
enum SOCK_DGRAM;
enum SOCK_SEQPACKET;
enum SOCK_STREAM;
enum SOL_SOCKET;
enum SO_ACCEPTCONN;
enum SO_BROADCAST;
enum SO_DEBUG;
enum SO_DONTROUTE;
enum SO_ERROR;
enum SO_KEEPALIVE;
enum SO_LINGER;
enum SO_OOBINLINE;
enum SO_RCVBUF;
enum SO_RCVLOWAT;
enum SO_RCVTIMEO;
enum SO_REUSEADDR;
enum SO_SNDBUF;
enum SO_SNDLOWAT;
enum SO_SNDTIMEO;
enum SO_TYPE;
enum SOMAXCONN;
enum MSG_CTRUNC;
enum MSG_DONTROUTE;
enum MSG_EOR;
enum MSG_OOB;
enum MSG_PEEK;
enum MSG_TRUNC;
enum MSG_WAITALL;
enum MSG_NOSIGNAL;
enum AF_APPLETALK;
enum AF_INET;
enum AF_IPX;
enum AF_UNIX;
enum AF_UNSPEC;
enum PF_APPLETALK;
enum PF_IPX;
enum SOCK_RDM;
enum SHUT_RD;
enum SHUT_WR;
enum SHUT_RDWR;
enum AF_INET6;
enum SOCK_RAW;

alias socklen_t = u32;
alias sa_family_t = u16;

struct sockaddr
{
public:
	sa_family: sa_family_t;
	sa_data: i8[14];
}

struct sockaddr_storage
{
public:
	ss_family: sa_family_t;
	__ss_align: c_ulong;
	__ss_padding: i8[112];
}

struct msghdr
{
public:
	msg_name: void*;
	msg_namelen: socklen_t;
	msg_iov: iovec*;
	msg_iovlen: size_t;
	msg_control: void*;
	msg_controllen: size_t;
	msg_flags: i32;
}

struct cmsghdr
{
public:
	cmsg_len: size_t;
	cmsg_level: i32;
	cmsg_type: i32;
}

struct linger
{
public:
	l_onoff: i32;
	l_linger: i32;
}

fn accept(i32, sockaddr*, socklen_t*) i32;
fn bind(i32, const(const(sockaddr)*), socklen_t) i32;
fn connect(i32, const(const(sockaddr)*), socklen_t) i32;
fn getpeername(i32, sockaddr*, socklen_t*) i32;
fn getsockname(i32, sockaddr*, socklen_t*) i32;
fn getsockopt(i32, i32, i32, void*, socklen_t*) i32;
fn listen(i32, i32) i32;
fn recv(i32, void*, size_t, i32) ssize_t;
fn recvfrom(i32, void*, size_t, i32, sockaddr*, socklen_t*) ssize_t;
fn recvmsg(i32, msghdr*, i32) ssize_t;
fn send(i32, const(const(void)*), size_t, i32) ssize_t;
fn sendmsg(i32, const(const(msghdr)*), i32) ssize_t;
fn sendto(i32, const(const(void)*), size_t, i32, const(const(sockaddr)*), socklen_t) ssize_t;
fn setsockopt(i32, i32, i32, const(const(void)*), socklen_t) i32;
fn shutdown(i32, i32) i32;
fn socket(i32, i32, i32) i32;
fn sockatmark(i32) i32;
fn socketpair(i32, i32, i32, i32[2]) i32;

core.c.posix

//! Posix Bindings, this package does not export anything, here for
//! documentation.
module core.c.posix;

core.c.posix.netinet.in_

module core.c.posix.netinet.in_;

public import core.c.posix.arpa.inet;
public import core.c.posix.sys.socket;


enum IPPROTO_IP;
enum IPPROTO_ICMP;
enum IPPROTO_IGMP;
enum IPPROTO_GGP;
enum IPPROTO_TCP;
enum IPPROTO_PUP;
enum IPPROTO_UDP;
enum IPPROTO_IDP;
enum IPPROTO_ND;
enum IPPROTO_MAX;
enum INADDR_ANY;
enum INADDR_BROADCAST;
enum INADDR_LOOPBACK;
enum INADDR_NONE;
enum IPPROTO_IPV6;
enum IPV6_JOIN_GROUP;
enum IPV6_LEAVE_GROUP;
enum IPV6_MULTICAST_HOPS;
enum IPV6_MULTICAST_IF;
enum IPV6_MULTICAST_LOOP;
enum IPV6_UNICAST_HOPS;
enum IPV6_V6ONLY;
enum IPPROTO_RAW;

struct sockaddr_in
{
public:
	sin_family: sa_family_t;
	sin_port: in_port_t;
	sin_addr: in_addr;
	__pad: u8[8];
}

struct in6_addr
{
public:
	union _u
	{
	public:
		s6_addr: u8[16];
		s6_addr16: u16[8];
		s6_addr32: u32[4];
	}


public:
	u: _u;


public:
	fn s6_addr() u8[16] { }
	fn s6_addr(val: u8[16]) { }
}

struct sockaddr_in6
{
public:
	sin6_family: sa_family_t;
	sin6_port: in_port_t;
	sin6_flowinfo: u32;
	sin6_addr: in6_addr;
	sin6_scope_id: u32;
}

struct ipv6_mreq
{
public:
	ipv6mr_multiaddr: in6_addr;
	ipv6mr_interface: u32;
}

global in6addr_any: immutable(in6_addr);
global in6addr_loopback: immutable(in6_addr);

fn IN6_IS_ADDR_UNSPECIFIED(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_LOOPBACK(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MULTICAST(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_LINKLOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_SITELOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_V4MAPPED(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_V4COMPAT(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MC_NODELOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MC_LINKLOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MC_SITELOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MC_ORGLOCAL(addr: in6_addr*) i32 { }
fn IN6_IS_ADDR_MC_GLOBAL(addr: in6_addr*) i32 { }

core.c.posix.netinet.tcp

module core.c.posix.netinet.tcp;


enum TCP_NODELAY;

core.c.posix.config

module core.c.posix.config;

public import core.c.config;


enum _XOPEN_SOURCE;
enum _POSIX_C_SOURCE;
enum _GNU_SOURCE;
enum _BSD_SOURCE;
enum _SVID_SOURCE;
enum _FILE_OFFSET_BITS;
enum __REDIRECT;
enum __USE_FILE_OFFSET64;
enum __USE_LARGEFILE;
enum __USE_LARGEFILE64;
enum __USE_XOPEN2K;
enum __USE_XOPEN2KXSI;
enum __USE_XOPEN2K8;
enum __USE_XOPEN2K8XSI;
enum __USE_GNU;
enum __USE_MISC;
enum __WORDSIZE;

core.c.posix.netdb

module core.c.posix.netdb;

public import core.c.posix.netinet.in_;
public import core.c.posix.sys.socket;


enum IPPORT_RESERVED;
enum HOST_NOT_FOUND;
enum NO_DATA;
enum NO_RECOVERY;
enum TRY_AGAIN;
enum AI_PASSIVE;
enum AI_CANONNAME;
enum AI_NUMERICHOST;
enum AI_NUMERICSERV;
enum AI_V4MAPPED;
enum AI_ALL;
enum AI_ADDRCONFIG;
enum NI_NOFQDN;
enum NI_NUMERICHOST;
enum NI_NAMEREQD;
enum NI_NUMERICSERV;
enum NI_DGRAM;
enum NI_MAXHOST;
enum NI_MAXSERV;
enum EAI_AGAIN;
enum EAI_BADFLAGS;
enum EAI_FAIL;
enum EAI_FAMILY;
enum EAI_MEMORY;
enum EAI_NONAME;
enum EAI_SERVICE;
enum EAI_SOCKTYPE;
enum EAI_SYSTEM;
enum EAI_OVERFLOW;

struct hostent
{
public:
	h_name: char*;
	h_aliases: char**;
	h_addrtype: i32;
	h_length: i32;
	h_addr_list: char**;


public:
	fn h_addr() char* { }
}

struct netent
{
public:
	n_name: char*;
	n_aliases: char**;
	n_addrtype: i32;
	n_net: u32;
}

struct protoent
{
public:
	p_name: char*;
	p_aliases: char**;
	p_proto: i32;
}

struct servent
{
public:
	s_name: char*;
	s_aliases: char**;
	s_port: i32;
	s_proto: char*;
}

struct addrinfo
{
public:
	ai_flags: i32;
	ai_family: i32;
	ai_socktype: i32;
	ai_protocol: i32;
	ai_addrlen: socklen_t;
	ai_addr: sockaddr*;
	ai_canonname: char*;
	ai_next: addrinfo*;
}

fn endhostent();
fn endnetent();
fn endprotoent();
fn endservent();
fn freeaddrinfo(addrinfo*);
fn gai_strerror(i32) const(char)*;
fn getaddrinfo(const(char)*, const(char)*, const(addrinfo)*, addrinfo**) i32;
fn gethostbyaddr(const(void)*, socklen_t, i32) hostent*;
fn gethostbyname(const(char)*) hostent*;
fn gethostent() hostent*;
fn getnameinfo(const(sockaddr)*, socklen_t, char*, socklen_t, char*, socklen_t, i32) i32;
fn getnetbyaddr(u32, i32) netent*;
fn getnetbyname(const(char)*) netent*;
fn getnetent() netent*;
fn getprotobyname(const(char)*) protoent*;
fn getprotobynumber(i32) protoent*;
fn getprotoent() protoent*;
fn getservbyname(const(char)*, const(char)*) servent*;
fn getservbyport(i32, const(char)*) servent*;
fn getservent() servent*;
fn sethostent(i32);
fn setnetent(i32);
fn setprotoent(i32);
fn setservent(i32);

core.c.posix.unistd

module core.c.posix.unistd;

public import core.c.posix.sys.types;


enum STDIN_FILENO;
enum STDOUT_FILENO;
enum STDERR_FILENO;
enum F_OK;
enum R_OK;
enum W_OK;
enum X_OK;
enum F_ULOCK;
enum F_LOCK;
enum F_TLOCK;
enum F_TEST;
enum _CS_PATH;
enum _CS_V6_WIDTH_RESTRICTED_ENVS;
enum _CS_GNU_LIBC_VERSION;
enum _CS_GNU_LIBPTHREAD_VERSION;
enum _CS_LFS_CFLAGS;
enum _CS_LFS_LDFLAGS;
enum _CS_LFS_LIBS;
enum _CS_LFS_LINTFLAGS;
enum _CS_LFS64_CFLAGS;
enum _CS_LFS64_LDFLAGS;
enum _CS_LFS64_LIBS;
enum _CS_LFS64_LINTFLAGS;
enum _CS_XBS5_ILP32_OFF32_CFLAGS;
enum _CS_XBS5_ILP32_OFF32_LDFLAGS;
enum _CS_XBS5_ILP32_OFF32_LIBS;
enum _CS_XBS5_ILP32_OFF32_LINTFLAGS;
enum _CS_XBS5_ILP32_OFFBIG_CFLAGS;
enum _CS_XBS5_ILP32_OFFBIG_LDFLAGS;
enum _CS_XBS5_ILP32_OFFBIG_LIBS;
enum _CS_XBS5_ILP32_OFFBIG_LINTFLAGS;
enum _CS_XBS5_LP64_OFF64_CFLAGS;
enum _CS_XBS5_LP64_OFF64_LDFLAGS;
enum _CS_XBS5_LP64_OFF64_LIBS;
enum _CS_XBS5_LP64_OFF64_LINTFLAGS;
enum _CS_XBS5_LPBIG_OFFBIG_CFLAGS;
enum _CS_XBS5_LPBIG_OFFBIG_LDFLAGS;
enum _CS_XBS5_LPBIG_OFFBIG_LIBS;
enum _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS;
enum _CS_POSIX_V6_ILP32_OFF32_CFLAGS;
enum _CS_POSIX_V6_ILP32_OFF32_LDFLAGS;
enum _CS_POSIX_V6_ILP32_OFF32_LIBS;
enum _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS;
enum _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS;
enum _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS;
enum _CS_POSIX_V6_ILP32_OFFBIG_LIBS;
enum _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS;
enum _CS_POSIX_V6_LP64_OFF64_CFLAGS;
enum _CS_POSIX_V6_LP64_OFF64_LDFLAGS;
enum _CS_POSIX_V6_LP64_OFF64_LIBS;
enum _CS_POSIX_V6_LP64_OFF64_LINTFLAGS;
enum _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS;
enum _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS;
enum _CS_POSIX_V6_LPBIG_OFFBIG_LIBS;
enum _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS;
enum _PC_LINK_MAX;
enum _PC_MAX_CANON;
enum _PC_MAX_INPUT;
enum _PC_NAME_MAX;
enum _PC_PATH_MAX;
enum _PC_PIPE_BUF;
enum _PC_CHOWN_RESTRICTED;
enum _PC_NO_TRUNC;
enum _PC_VDISABLE;
enum _PC_SYNC_IO;
enum _PC_ASYNC_IO;
enum _PC_PRIO_IO;
enum _PC_SOCK_MAXBUF;
enum _PC_FILESIZEBITS;
enum _PC_REC_INCR_XFER_SIZE;
enum _PC_REC_MAX_XFER_SIZE;
enum _PC_REC_MIN_XFER_SIZE;
enum _PC_REC_XFER_ALIGN;
enum _PC_ALLOC_SIZE_MIN;
enum _PC_SYMLINK_MAX;
enum _PC_2_SYMLINKS;
enum _SC_ARG_MAX;
enum _SC_CHILD_MAX;
enum _SC_CLK_TCK;
enum _SC_NGROUPS_MAX;
enum _SC_OPEN_MAX;
enum _SC_STREAM_MAX;
enum _SC_TZNAME_MAX;
enum _SC_JOB_CONTROL;
enum _SC_SAVED_IDS;
enum _SC_REALTIME_SIGNALS;
enum _SC_PRIORITY_SCHEDULING;
enum _SC_TIMERS;
enum _SC_ASYNCHRONOUS_IO;
enum _SC_PRIORITIZED_IO;
enum _SC_SYNCHRONIZED_IO;
enum _SC_FSYNC;
enum _SC_MAPPED_FILES;
enum _SC_MEMLOCK;
enum _SC_MEMLOCK_RANGE;
enum _SC_MEMORY_PROTECTION;
enum _SC_MESSAGE_PASSING;
enum _SC_SEMAPHORES;
enum _SC_SHARED_MEMORY_OBJECTS;
enum _SC_AIO_LISTIO_MAX;
enum _SC_AIO_MAX;
enum _SC_AIO_PRIO_DELTA_MAX;
enum _SC_DELAYTIMER_MAX;
enum _SC_MQ_OPEN_MAX;
enum _SC_MQ_PRIO_MAX;
enum _SC_VERSION;
enum _SC_PAGESIZE;
enum _SC_PAGE_SIZE;
enum _SC_RTSIG_MAX;
enum _SC_SEM_NSEMS_MAX;
enum _SC_SEM_VALUE_MAX;
enum _SC_SIGQUEUE_MAX;
enum _SC_TIMER_MAX;
enum _SC_BC_BASE_MAX;
enum _SC_BC_DIM_MAX;
enum _SC_BC_SCALE_MAX;
enum _SC_BC_STRING_MAX;
enum _SC_COLL_WEIGHTS_MAX;
enum _SC_EQUIV_CLASS_MAX;
enum _SC_EXPR_NEST_MAX;
enum _SC_LINE_MAX;
enum _SC_RE_DUP_MAX;
enum _SC_CHARCLASS_NAME_MAX;
enum _SC_2_VERSION;
enum _SC_2_C_BIND;
enum _SC_2_C_DEV;
enum _SC_2_FORT_DEV;
enum _SC_2_FORT_RUN;
enum _SC_2_SW_DEV;
enum _SC_2_LOCALEDEF;
enum _SC_PII;
enum _SC_PII_XTI;
enum _SC_PII_SOCKET;
enum _SC_PII_INTERNET;
enum _SC_PII_OSI;
enum _SC_POLL;
enum _SC_SELECT;
enum _SC_UIO_MAXIOV;
enum _SC_IOV_MAX;
enum _SC_PII_INTERNET_STREAM;
enum _SC_PII_INTERNET_DGRAM;
enum _SC_PII_OSI_COTS;
enum _SC_PII_OSI_CLTS;
enum _SC_PII_OSI_M;
enum _SC_T_IOV_MAX;
enum _SC_THREADS;
enum _SC_THREAD_SAFE_FUNCTIONS;
enum _SC_GETGR_R_SIZE_MAX;
enum _SC_GETPW_R_SIZE_MAX;
enum _SC_LOGIN_NAME_MAX;
enum _SC_TTY_NAME_MAX;
enum _SC_THREAD_DESTRUCTOR_ITERATIONS;
enum _SC_THREAD_KEYS_MAX;
enum _SC_THREAD_STACK_MIN;
enum _SC_THREAD_THREADS_MAX;
enum _SC_THREAD_ATTR_STACKADDR;
enum _SC_THREAD_ATTR_STACKSIZE;
enum _SC_THREAD_PRIORITY_SCHEDULING;
enum _SC_THREAD_PRIO_INHERIT;
enum _SC_THREAD_PRIO_PROTECT;
enum _SC_THREAD_PROCESS_SHARED;
enum _SC_NPROCESSORS_CONF;
enum _SC_NPROCESSORS_ONLN;
enum _SC_PHYS_PAGES;
enum _SC_AVPHYS_PAGES;
enum _SC_ATEXIT_MAX;
enum _SC_PASS_MAX;
enum _SC_XOPEN_VERSION;
enum _SC_XOPEN_XCU_VERSION;
enum _SC_XOPEN_UNIX;
enum _SC_XOPEN_CRYPT;
enum _SC_XOPEN_ENH_I18N;
enum _SC_XOPEN_SHM;
enum _SC_2_CHAR_TERM;
enum _SC_2_C_VERSION;
enum _SC_2_UPE;
enum _SC_XOPEN_XPG2;
enum _SC_XOPEN_XPG3;
enum _SC_XOPEN_XPG4;
enum _SC_CHAR_BIT;
enum _SC_CHAR_MAX;
enum _SC_CHAR_MIN;
enum _SC_INT_MAX;
enum _SC_INT_MIN;
enum _SC_LONG_BIT;
enum _SC_WORD_BIT;
enum _SC_MB_LEN_MAX;
enum _SC_NZERO;
enum _SC_SSIZE_MAX;
enum _SC_SCHAR_MAX;
enum _SC_SCHAR_MIN;
enum _SC_SHRT_MAX;
enum _SC_SHRT_MIN;
enum _SC_UCHAR_MAX;
enum _SC_UINT_MAX;
enum _SC_ULONG_MAX;
enum _SC_USHRT_MAX;
enum _SC_NL_ARGMAX;
enum _SC_NL_LANGMAX;
enum _SC_NL_MSGMAX;
enum _SC_NL_NMAX;
enum _SC_NL_SETMAX;
enum _SC_NL_TEXTMAX;
enum _SC_XBS5_ILP32_OFF32;
enum _SC_XBS5_ILP32_OFFBIG;
enum _SC_XBS5_LP64_OFF64;
enum _SC_XBS5_LPBIG_OFFBIG;
enum _SC_XOPEN_LEGACY;
enum _SC_XOPEN_REALTIME;
enum _SC_XOPEN_REALTIME_THREADS;
enum _SC_ADVISORY_INFO;
enum _SC_BARRIERS;
enum _SC_BASE;
enum _SC_C_LANG_SUPPORT;
enum _SC_C_LANG_SUPPORT_R;
enum _SC_CLOCK_SELECTION;
enum _SC_CPUTIME;
enum _SC_THREAD_CPUTIME;
enum _SC_DEVICE_IO;
enum _SC_DEVICE_SPECIFIC;
enum _SC_DEVICE_SPECIFIC_R;
enum _SC_FD_MGMT;
enum _SC_FIFO;
enum _SC_PIPE;
enum _SC_FILE_ATTRIBUTES;
enum _SC_FILE_LOCKING;
enum _SC_FILE_SYSTEM;
enum _SC_MONOTONIC_CLOCK;
enum _SC_MULTI_PROCESS;
enum _SC_SINGLE_PROCESS;
enum _SC_NETWORKING;
enum _SC_READER_WRITER_LOCKS;
enum _SC_SPIN_LOCKS;
enum _SC_REGEXP;
enum _SC_REGEX_VERSION;
enum _SC_SHELL;
enum _SC_SIGNALS;
enum _SC_SPAWN;
enum _SC_SPORADIC_SERVER;
enum _SC_THREAD_SPORADIC_SERVER;
enum _SC_SYSTEM_DATABASE;
enum _SC_SYSTEM_DATABASE_R;
enum _SC_TIMEOUTS;
enum _SC_TYPED_MEMORY_OBJECTS;
enum _SC_USER_GROUPS;
enum _SC_USER_GROUPS_R;
enum _SC_2_PBS;
enum _SC_2_PBS_ACCOUNTING;
enum _SC_2_PBS_LOCATE;
enum _SC_2_PBS_MESSAGE;
enum _SC_2_PBS_TRACK;
enum _SC_SYMLOOP_MAX;
enum _SC_STREAMS;
enum _SC_2_PBS_CHECKPOINT;
enum _SC_V6_ILP32_OFF32;
enum _SC_V6_ILP32_OFFBIG;
enum _SC_V6_LP64_OFF64;
enum _SC_V6_LPBIG_OFFBIG;
enum _SC_HOST_NAME_MAX;
enum _SC_TRACE;
enum _SC_TRACE_EVENT_FILTER;
enum _SC_TRACE_INHERIT;
enum _SC_TRACE_LOG;
enum _SC_LEVEL1_ICACHE_SIZE;
enum _SC_LEVEL1_ICACHE_ASSOC;
enum _SC_LEVEL1_ICACHE_LINESIZE;
enum _SC_LEVEL1_DCACHE_SIZE;
enum _SC_LEVEL1_DCACHE_ASSOC;
enum _SC_LEVEL1_DCACHE_LINESIZE;
enum _SC_LEVEL2_CACHE_SIZE;
enum _SC_LEVEL2_CACHE_ASSOC;
enum _SC_LEVEL2_CACHE_LINESIZE;
enum _SC_LEVEL3_CACHE_SIZE;
enum _SC_LEVEL3_CACHE_ASSOC;
enum _SC_LEVEL3_CACHE_LINESIZE;
enum _SC_LEVEL4_CACHE_SIZE;
enum _SC_LEVEL4_CACHE_ASSOC;
enum _SC_LEVEL4_CACHE_LINESIZE;
enum _SC_IPV6;
enum _SC_RAW_SOCKETS;

global optarg: char*;
global optind: i32;
global opterr: i32;
global optopt: i32;

fn access(const(const(char)*), i32) i32;
fn alarm(u32) u32;
fn chdir(const(const(char)*)) i32;
fn chown(const(const(char)*), uid_t, gid_t) i32;
fn close(i32) i32;
fn confstr(i32, char*, size_t) size_t;
fn dup(i32) i32;
fn dup2(i32, i32) i32;
fn execl(const(const(char)*), const(const(char)*)) i32;
fn execle(const(const(char)*), const(const(char)*)) i32;
fn execlp(const(const(char)*), const(const(char)*)) i32;
fn execv(const(const(char)*), const(const(const(char)*)*)) i32;
fn execve(const(const(char)*), const(const(const(char)*)*), const(const(const(char)*)*)) i32;
fn execvp(const(const(char)*), const(const(const(char)*)*)) i32;
fn _exit(i32);
fn fchown(i32, uid_t, gid_t) i32;
fn fork() pid_t;
fn fpathconf(i32, i32) c_long;
fn getcwd(char*, size_t) char*;
fn getegid() gid_t;
fn geteuid() uid_t;
fn getgid() gid_t;
fn getgroups(i32, gid_t*) i32;
fn gethostname(char*, size_t) i32;
fn getlogin() char*;
fn getlogin_r(char*, size_t) i32;
fn getopt(i32, const(const(const(char)*)*), const(const(char)*)) i32;
fn getpgrp() pid_t;
fn getpid() pid_t;
fn getppid() pid_t;
fn getuid() uid_t;
fn isatty(i32) i32;
fn link(const(const(char)*), const(const(char)*)) i32;
fn pathconf(const(const(char)*), i32) c_long;
fn pause() i32;
fn pipe(i32[2]) i32;
fn read(i32, void*, size_t) ssize_t;
fn readlink(const(const(char)*), char*, size_t) ssize_t;
fn rmdir(const(const(char)*)) i32;
fn setegid(gid_t) i32;
fn seteuid(uid_t) i32;
fn setgid(gid_t) i32;
fn setpgid(pid_t, pid_t) i32;
fn setsid() pid_t;
fn setuid(uid_t) i32;
fn sleep(u32) u32;
fn symlink(const(const(char)*), const(const(char)*)) i32;
fn sysconf(i32) c_long;
fn tcgetpgrp(i32) pid_t;
fn tcsetpgrp(i32, pid_t) i32;
fn ttyname(i32) char*;
fn ttyname_r(i32, char*, size_t) i32;
fn unlink(const(const(char)*)) i32;
fn write(i32, const(const(void)*), size_t) ssize_t;
fn waitpid(pid_t, i32*, i32) pid_t;
fn lseek(i32, off_t, i32) off_t;
fn ftruncate(i32, off_t) i32;
fn fsync(i32) i32;
fn fdatasync(i32) i32;
fn crypt(const(const(char)*), const(const(char)*)) char*;
fn ctermid(char*) char*;
fn encrypt(char[64], i32);
fn fchdir(i32) i32;
fn gethostid() c_long;
fn getpgid(pid_t) pid_t;
fn getsid(pid_t) pid_t;
fn getwd(char*) char*;
fn lchown(const(const(char)*), uid_t, gid_t) i32;
fn nice(i32) i32;
fn setpgrp() pid_t;
fn setregid(gid_t, gid_t) i32;
fn setreuid(uid_t, uid_t) i32;
fn swab(const(const(void)*), void*, ssize_t);
fn sync();
fn ualarm(useconds_t, useconds_t) useconds_t;
fn usleep(useconds_t) i32;
fn vfork() pid_t;
fn lockf(i32, i32, off_t) i32;
fn pread(i32, void*, size_t, off_t) ssize_t;
fn pwrite(i32, const(const(void)*), size_t, off_t) ssize_t;
fn truncate(const(const(char)*), off_t) i32;

core.c.stdint

module core.c.stdint;


alias int8_t = i8;
alias int16_t = i16;
alias int32_t = i32;
alias int64_t = c_long;
alias uint8_t = u8;
alias uint16_t = u16;
alias uint32_t = u32;
alias uint64_t = c_ulong;
alias int_least8_t = i8;
alias int_least16_t = i16;
alias int_least32_t = i32;
alias int_least64_t = c_long;
alias uint_least8_t = u8;
alias uint_least16_t = u16;
alias uint_least32_t = u32;
alias uint_least64_t = c_ulong;
alias int_fast8_t = i8;
alias int_fast16_t = c_long;
alias int_fast32_t = c_long;
alias int_fast64_t = c_long;
alias uint_fast8_t = u8;
alias uint_fast16_t = c_ulong;
alias uint_fast32_t = c_ulong;
alias uint_fast64_t = c_ulong;
alias intptr_t = c_long;
alias uintptr_t = c_ulong;
alias intmax_t = c_long;
alias uintmax_t = c_ulong;

core.c.string

module core.c.string;


fn memcpy(dest: void*, src: const(void)*, n: size_t) void*;
fn memmove(dest: void*, src: const(void)*, n: size_t) void*;
fn strcpy(dest: char*, src: const(char)*) char*;
fn strncpy(dest: char*, src: const(char)*, n: size_t) char*;
fn strcat(dest: char*, src: const(char)*) char*;
fn strncat(dest: char*, src: const(char)*, n: size_t) char*;
fn memcmp(ptr1: const(void)*, ptr2: const(void)*, n: size_t) i32;
fn strcmp(str1: const(char)*, str2: const(char)*) i32;
fn strcoll(str1: const(char)*, str2: const(char)*) i32;
fn strncmp(str1: const(char)*, str2: const(char)*, n: size_t) i32;
fn memchr(ptr: const(void)*, val: i32, n: size_t) void*;
fn strchr(str: const(char)*, c: i32) char*;
fn strcspn(str1: const(char)*, str2: const(char)*) size_t;
fn strpbrk(str1: const(char)*, str2: const(char)*) char*;
fn strrchr(str1: const(char)*, c: i32) char*;
fn strspn(str1: const(char)*, str2: const(char)*) size_t;
fn strstr(str1: const(char)*, str2: const(char)*) char*;
fn strtok(str: char*, delim: const(char)*) char*;
fn memset(ptr: void*, v: i32, n: size_t) void*;
fn strerror(errnum: i32) char*;
fn strlen(str: const(char)*) size_t;

core.c.stdlib

module core.c.stdlib;

public import core.c.stddef;


enum EXIT_SUCCESS;
enum EXIT_FAILURE;
enum MB_CUR_MAX;
enum RAND_MAX;

struct div_t
{
public:
	quot: i32;
	rem: i32;
}

struct ldiv_t
{
public:
	quot: c_long;
	rem: c_long;
}

struct lldiv_t
{
public:
	quot: i64;
	rem: i64;
}

global environ: char**;

fn atof(nptr: const(const(char)*)) f64;
fn atoi(nptr: const(const(char)*)) i32;
fn atol(nptr: const(const(char)*)) c_long;
fn atoll(nptr: const(const(char)*)) i64;
fn strtod(nptr: const(const(char)*), endptr: char**) f64;
fn strtof(nptr: const(const(char)*), endptr: char**) f32;
fn strtol(nptr: const(const(char)*), endptr: char**, base: i32) c_long;
fn strtoll(nptr: const(const(char)*), endptr: char**, base: i32) i64;
fn strtoul(nptr: const(const(char)*), endptr: char**, base: i32) c_ulong;
fn strtoull(nptr: const(const(char)*), endptr: char**, base: i32) u64;
fn rand() i32;
fn srand(seed: u32);
fn malloc(size: size_t) void*;
fn calloc(nmemb: size_t, size: size_t) void*;
fn realloc(ptr: void*, size: size_t) void*;
fn free(ptr: void*);
fn abort();
fn exit(status: i32);
fn atexit(func: fn () (void)) i32;
fn _Exit(status: i32);
fn getenv(name: const(const(char)*)) char*;
fn system(str: const(const(char)*)) i32;
fn bsearch(key: const(const(void)*), base: const(const(void)*), nmemb: size_t, size: size_t, compar: fn (const(const(void)*), const(const(void)*)) (i32)) void*;
fn qsort(base: void*, nmemb: size_t, size: size_t, compar: fn (const(const(void)*), const(const(void)*)) (i32));
fn abs(j: i32) i32;
fn labs(j: c_long) c_long;
fn llabs(j: i64) i64;
fn div(numer: i32, denom: i32) div_t;
fn ldiv(numer: c_long, denom: c_long) ldiv_t;
fn lldiv(numer: i64, denom: i64) lldiv_t;
fn mblen(s: const(const(char)*), n: size_t) i32;
fn mbtowc(pwc: wchar_t*, s: const(const(char)*), n: size_t) i32;
fn wctomb(s: char*, wc: wchar_t) i32;
fn mbstowcs(pwcs: wchar_t*, s: const(const(char)*), n: size_t) size_t;
fn wcstombs(s: char*, pwcs: const(const(wchar_t)*), n: size_t) size_t;
fn realpath(const(char)*, char*) char*;

core.c.stdarg

module core.c.stdarg;


alias va_list = void*;
alias va_start = core.varargs.va_start;
alias va_end = core.varargs.va_end;

core.c

//! C Bindings, this package does not export anything, here for
//! documentation.
module core.c;

core.c.stddef

module core.c.stddef;


//! Windows wchar is different from *NIXs.
alias wchar_t = i32;

core.c.stdio

module core.c.stdio;


enum BUFSIZ;
enum EOF;
enum FOPEN_MAX;
enum FILENAME_MAX;
enum TMP_MAX;
enum L_tmpnam;
enum SEEK_SET;
enum SEEK_CUR;
enum SEEK_END;
enum _F_RDWR;
enum _F_READ;
enum _F_WRIT;
enum _F_BUF;
enum _F_LBUF;
enum _F_ERR;
enum _F_EOF;
enum _F_BIN;
enum _F_IN;
enum _F_OUT;
enum _F_TERM;
enum _IOFBF;
enum _IOLBF;
enum _IONBF;

alias FILE = _iobuf;
alias fpos_t = i32;

struct _iobuf
{
public:
	_flags: i32;
	_read_ptr: char*;
	_read_end: char*;
	_read_base: char*;
	_write_base: char*;
	_write_ptr: char*;
	_write_end: char*;
	_buf_base: char*;
	_buf_end: char*;
	_save_base: char*;
	_backup_base: char*;
	_save_end: char*;
	_markers: void*;
	_chain: _iobuf*;
	_fileno: i32;
	_blksize: i32;
	_old_offset: i32;
	_cur_column: i32;
	_vtable_offset: i8;
	_shortbuf: char[1];
	_lock: void*;
}

global stdin: FILE*;
global stdout: FILE*;
global stderr: FILE*;

fn remove(filename: const(const(char)*)) i32;
fn rename(from: const(const(char)*), to: const(const(char)*)) i32;
fn tmpfile() FILE*;
fn tmpnam(s: char*) char*;
fn fclose(stream: FILE*) i32;
fn fflush(stream: FILE*) i32;
fn fopen(filename: const(const(char)*), mode: const(const(char)*)) FILE*;
fn freopen(filename: const(const(char)*), mode: const(const(char)*), stream: FILE*) FILE*;
fn setbuf(stream: FILE*, buf: char*);
fn setvbuf(stream: FILE*, buf: char*, mode: i32, size: size_t) i32;
fn fprintf(stream: FILE*, format: const(const(char)*)) i32;
fn fscanf(stream: FILE*, format: const(const(char)*)) i32;
fn sprintf(s: char*, format: const(const(char)*)) i32;
fn sscanf(s: const(char)*, format: const(const(char)*)) i32;
fn vfprintf(stream: FILE*, format: const(char)*, arg: va_list) i32;
fn vfscanf(stream: FILE*, format: const(const(char)*), arg: va_list) i32;
fn vsprintf(s: char*, format: const(const(char)*), arg: va_list) i32;
fn vsscanf(s: const(const(char)*), format: const(const(char)*), arg: va_list) i32;
fn vprintf(format: const(const(char)*), arg: va_list) i32;
fn vscanf(format: const(const(char)*), arg: va_list) i32;
fn printf(format: const(const(char)*)) i32;
fn scanf(format: const(const(char)*)) i32;
fn fgetc(stream: FILE*) i32;
fn fputc(c: i32, stream: FILE*) i32;
fn fgets(s: char*, n: i32, stream: FILE*) char*;
fn fputs(s: const(const(char)*), stream: FILE*) i32;
fn gets(s: char*) char*;
fn puts(s: const(const(char)*)) i32;
fn getchar() i32 { }
fn putchar(c: i32) i32 { }
fn getc(stream: FILE*) i32 { }
fn putc(c: i32, stream: FILE*) i32 { }
fn ungetc(c: i32, stream: FILE*) i32;
fn fread(ptr: void*, size: size_t, nmemb: size_t, stream: FILE*) size_t;
fn fwrite(ptr: const(const(void)*), size: size_t, nmemb: size_t, stream: FILE*) size_t;
fn fgetpos(stream: FILE*, pos: fpos_t*) i32;
fn fsetpos(stream: FILE*, pos: const(const(fpos_t)*)) i32;
fn fseek(stream: FILE*, offset: c_long, whence: i32) i32;
fn ftell(stream: FILE*) c_long;
fn popen(const(char)*, const(char)*) FILE*;
fn pclose(FILE*) i32;
fn rewind(stream: FILE*);
fn clearerr(stream: FILE*);
fn feof(stream: FILE*) i32;
fn ferror(stream: FILE*) i32;
fn fileno(FILE*) i32;
fn snprintf(s: char*, n: size_t, format: const(const(char)*)) i32;
fn vsnprintf(s: char*, n: size_t, format: const(const(char)*), arg: va_list) i32;
fn perror(s: const(const(char)*));
fn unlink(s: const(const(char)*)) i32;

core.c.pthread

//! Pthread bindings.
module core.c.pthread;


alias pthread_t = c_ulong;

union pthread_mutex_t
{
}

fn pthread_create(pthread_t*, void*, fn (void*) (void*), void*) i32;
fn pthread_join(pthread_t, void*) i32;
fn pthread_mutex_init(pthread_mutex_t*, void*) i32;
fn pthread_mutex_destroy(pthread_mutex_t*) i32;
fn pthread_mutex_lock(pthread_mutex_t*) i32;
fn pthread_mutex_trylock(pthread_mutex_t*) i32;
fn pthread_mutex_unlock(pthread_mutex_t*) i32;

core.c.config

//! This file contains type aliases needed to interface with C code.
module core.c.config;


//! Volt doesn't have long and unsigned long in the same way that C does,
//! whos typesdefs changes size depending on bitness of the target and of
//! the target os.
alias c_long = i64;
//! Volt doesn't have long and unsigned long in the same way that C does,
//! whos typesdefs changes size depending on bitness of the target and of
//! the target os.
alias c_ulong = u64;

core.c.signal

module core.c.signal;


enum SIGABRT;
enum SIGFPE;
enum SIGILL;
enum SIGINT;
enum SIGSEGV;
enum SIGTERM;

alias sig_atomic_t = i32;

fn signal(sig: i32, func: fn (i32) (void)) fn (i32) (void);
fn raise(sig: i32) i32;
fn kill(pid: pid_t, sig: i32) i32;

core.rt.thread

//! Code to support spawning new threads.
module core.rt.thread;


//! An opaque data type representing a thread.
struct vrt_thread
{
}

//! An opaque data type representing a mutex.
struct vrt_mutex
{
}

//! Construct a new thread.
fn vrt_thread_start_fn(func: fn () (void)) vrt_thread*;
//! Construct a new thread.
fn vrt_thread_start_dg(dlgt: void delegate()) vrt_thread*;
//! Did the last operation signal an error?
fn vrt_thread_error(t: vrt_thread*) bool;
//! Get an error message for the last function that set the error on t.
fn vrt_thread_error_message(t: vrt_thread*) string;
//! Wait for this thread to complete.
fn vrt_thread_join(t: vrt_thread*);
//! Cause the calling thread to sleep for ms milliseconds.
fn vrt_sleep(ms: u32);
//! Create a new mutex.
fn vrt_mutex_new() vrt_mutex*;
//! Release any resources acquired by mutex creation.
fn vrt_mutex_delete(mutex: vrt_mutex*);
//! The calling thread tries to gain ownership of mutex.
fn vrt_mutex_trylock(mutex: vrt_mutex*) bool;
//! The calling thread tries to gain ownership of mutex.
fn vrt_mutex_lock(mutex: vrt_mutex*) bool;
//! Release the lock the calling thread has on mutex.
fn vrt_mutex_unlock(mutex: vrt_mutex*);

core.rt.gc

module core.rt.gc;


alias AllocDg = void* delegate(TypeInfo, size_t);

//! Stats structs for the GC, may change often so no API/ABI stability.
struct Stats
{
public:
	//! Counters, always available.
	struct Num
	{
	public:
		collections: u64;
		allocs: u64;
		allocBytes: u64;
		arrayAllocs: u64;
		arrayBytes: u64;
		classAllocs: u64;
		classBytes: u64;
		zeroAllocs: u64;
	}

	//! Slots stats, may not be set for all GCs.
	struct Slot
	{
	public:
		//! Memory in large extents.
		memLarge: u64;
		//! Memory cached in slabs.
		memCached: u64;
		//! Memory used in slabs.
		memUsed: u64;
		//! Total memory: used or cached.
		memTotal: u64;
		free: u32[16];
		used: u32[16];
	}


public:
	//! Counters.
	num: Num;
	//! Slots stats.
	slots: Slot;
}

local allocDg: AllocDg;

//! Initialise the GC.
fn vrt_gc_init();
//! Get an instance of the AllocDg delegate.
fn vrt_gc_get_alloc_dg() AllocDg;
//! Perform a collection.
fn vrt_gc_collect();
//! Shutdown the GC, call all destructors, free all memory.
fn vrt_gc_shutdown();
//! Fill out a given Stats struct.
fn vrt_gc_get_stats(stats: Stats) Stats*;
fn vrt_gc_print_stats();

core.rt.aa

module core.rt.aa;


//! Creates a new associative array.
fn vrt_aa_new(value: TypeInfo, key: TypeInfo) void*;
//! Copies an existing associative array.
fn vrt_aa_dup(rbtv: void*) void*;
//! Check if a primitive key is in an associative array.
fn vrt_aa_in_primitive(rbtv: void*, key: u64, ret: void*) bool;
//! Check if an array key is in an associative array.
fn vrt_aa_in_array(rbtv: void*, key: void[], ret: void*) bool;
//! Check if a pointer key is in an associative array.
fn vrt_aa_in_ptr(rbtv: void*, key: void*, ret: void*) bool;
//! Insert a value in a primitive keyed associative array.
fn vrt_aa_insert_primitive(rbtv: void*, key: u64, value: void*);
//! Insert a value in an array keyed associative array.
fn vrt_aa_insert_array(rbtv: void*, key: void[], value: void*);
//! Insert a value in a pointer keyed associative array.
fn vrt_aa_insert_ptr(rbtv: void*, key: void*, value: void*);
//! Delete a value associated with a primitive key.
fn vrt_aa_delete_primitive(rbtv: void*, key: u64) bool;
//! Delete a value associated with an array key.
fn vrt_aa_delete_array(rbtv: void*, key: void[]) bool;
//! Delete a value associate with a pointer key.
fn vrt_aa_delete_ptr(rbtv: void*, key: void*) bool;
//! Get the keys array for a given associative array.
fn vrt_aa_get_keys(rbtv: void*) void[];
//! Get the values array for a given associative array.
fn vrt_aa_get_values(rbtv: void*) void[];
//! Get the number of pairs in a given associative array.
fn vrt_aa_get_length(rbtv: void*) size_t;
//! The in operator for an array keyed associative array.
fn vrt_aa_in_binop_array(rbtv: void*, key: void[]) void*;
//! The in operator for a primitive keyed associative array.
fn vrt_aa_in_binop_primitive(rbtv: void*, key: u64) void*;
//! The in operator for a pointer keyed associative array.
fn vrt_aa_in_binop_ptr(rbtv: void*, key: void*) void*;
//! Rehash an associative array to optimise performance.
fn vrt_aa_rehash(rbtv: void*);
//! The get method for a pointer keyed associative array.
fn vrt_aa_get_ptr(rbtv: void*, key: void*, _default: void*) void*;

core.rt.eh

module core.rt.eh;


//! Set a callback that happens just before a exception is thrown.
fn vrt_eh_set_callback(cb: fn (Throwable, string) (void));
//! Perform a throw of the given Throwable object.
fn vrt_eh_throw(t: Throwable, location: string);
//! Throw a Throwable that has previously been thrown.
fn vrt_eh_rethrow(t: Throwable);
//! Throw an error for an invalid slice.
fn vrt_eh_throw_slice_error(location: string);
//! Throw an assert for an assert failure.
fn vrt_eh_throw_assert_error(location: string, msg: string);
//! Throw an AA key lookup failure error.
fn vrt_eh_throw_key_not_found_error(location: string);
fn vrt_eh_personality_v0() i32;

core.rt.misc

module core.rt.misc;


alias VMain = fn (string[]) (i32);

//! Initialise the monotonic code.
fn vrt_monotonic_init();
//! Get the ticks count.
fn vrt_monotonic_ticks() i64;
//! Get the runtime's initial ticks value.
fn vrt_monotonic_ticks_at_init() i64;
//! Get how many ticks make up a second.
fn vrt_monotonic_ticks_per_second() i64;
fn vrt_panic(msg: scope (scope (const(scope (char)[])[]), location: scope (const(scope (char)[]));
//! Perform a runtime cast.
fn vrt_handle_cast(obj: void*, ti: TypeInfo) void*;
//! Get the hash for size bytes of data.
fn vrt_hash(data: void*, size: size_t) u32;
//! Perform a memcmp between size bytes of d1 and d2.
fn vrt_memcmp(d1: void*, d2: void*, size: size_t) i32;
//! Run global constructors for linked modules.
fn vrt_run_global_ctors() i32;
//! Run local constructors for linked modules.
fn vrt_run_local_ctors() i32;
//! Run the given main function with the given arguments.
fn vrt_run_main(argc: i32, argv: char**, vMain: VMain) i32;
//! Run global destructors for linked modules.
fn vrt_run_global_dtors() i32;
//! Run local destructors for linked modules.
fn vrt_run_local_dtors() i32;
//! Encode c as a string in buf.
fn vrt_encode_static_u8(buf: char[6], c: dchar) size_t;
//! Decode a single codepoint of str, starting from index.
fn vrt_decode_u8_d(str: scope (const(scope (char)[]), index: size_t) dchar;
//! Decode a single codepoint of str, starting from index.
fn vrt_reverse_decode_u8_d(str: scope (const(scope (char)[]), index: size_t) dchar;

core.rt.format

module core.rt.format;


//! The argument that is passed to Sinks.
alias SinkArg = scope (const(scope (char)[]);
//! The Sink delegate.
alias Sink = scope (void delegate(scope (SinkArg)));
//! These are the sink store that the compiler uses for composable
//! strings.
alias SinkStore = SinkStore1024;
//! These are the sink store that the compiler uses for composable
//! strings.
alias vrt_sink_init = vrt_sink_init_1024;
//! Default implementation of SinkStore used by the compiler.
alias SinkStore1024 = void[1024];

//! Format a given u64 as a string, and pass it to sink.
fn vrt_format_u64(sink: scope (Sink), i: u64);
//! Format a given i64 as a string, and pass it to sink.
fn vrt_format_i64(sink: scope (Sink), i: i64);
//! Format a given f32 as a string, and pass it to sink.
fn vrt_format_f32(sink: scope (Sink), i: f32, width: i32);
//! Format a given f64 as a string, and pass it to sink.
fn vrt_format_f64(sink: scope (Sink), i: f64, width: i32);
//! Format a given integer as a hex string, and pass it to sink.
fn vrt_format_hex(sink: scope (Sink), i: u64, padding: size_t);
//! Format a given u64 and pass it to sink.
fn vrt_format_readable_size(sink: scope (Sink), size: u64);
//! Format a given dchar as a string (surrounded with ') and pass it to 
//! sink.
fn vrt_format_dchar(sink: scope (Sink), c: dchar);
//! Default implementation of SinkStore used by the compiler.
fn vrt_sink_init_1024(sink: SinkStore1024) scope (Sink);
//! Default implementation of SinkStore used by the compiler.
fn vrt_sink_getstr_1024(sink: SinkStore1024) string;

core.object

//! Root object for classes.
module core.object;


//! Root object for all classes.
class Object
{
public:
	this() { }
	fn toString() string { }
}