The D standard library is an extensible framework which contains components for language support, string processing, input/output, containers, algorithms, etc. Language support components are required for features such as memory allocation, exceptions, and built-in UTF transcoding.
This section describes functions that are called implicitly, and types that are fundamental to the D language.
Blah blah.
Types: size_t ptrdiff_t wint_t wchar_t wctype_t wctrans_t Constants: WEOF
The size and type of these symbols are equivalent to the standard C/C++ symbols with the same name. This module is roughly equivalent to the standard C header <stddef.h> but has been expanded to include wide character types and constants as well.
class Object; struct Interface; class TypeInfo; class ClassInfo; class Exception;
class Object { void print(); char[] toString(); uint toHash(); int opCmp(Object obj); int opEquals(Object obj); }
struct Interface { ClassInfo classinfo; void*[] vtbl; int offset; }
class TypeInfo { uint toHash(); int opCmp(Object o); int opEquals(Object o); uint getHash(void *p); int equals(void *p1, void *p2); int compare(void *p1, void *p2); int tsize(); void swap(void *p1, void *p2); }
class ClassInfo { byte[] init; char[] name; void*[] vtbl; Interface[] interfaces; ClassInfo base; void* destructor; void(*classInvariant)(Object); uint flags; void* deallocator; }
class Exception { char[] msg; this(char[] msg); void print(); char[] toString(); }Blah blah.
Blah blah.
class AssertError; class OutOfMemoryError; class ArrayBoundsError; class SwitchError; class InvalidUtfError; void setAssertHandler( void function( char[] file, uint line ) ); extern (C) void onAssert( char[] file, uint line ); extern (C) void onOutOfMemory(); extern (C) void onArrayBoundsError( char[] file, uint line ); extern (C) void onSwitchError( char[] file, uint line ); extern (C) void onInvalidUtfError( char[] msg, size_t idx );
class AssertError { char[] file; uint line; this( char[] file, uint line ); void print(); }
class OutOfMemoryError { char[] file; uint line; this( char[] file, uint line ); void print(); }
class ArrayBoundsError { char[] file; uint line; this( char[] file, uint line ); void print(); }
class SwitchError { char[] file; uint line; this( char[] file, uint line ); void print(); }
class InvalidUtfError : Exception { size_t idx; this( char[] msg, size_t idx ); }
void setAssertHandler( void function( char[] file, uint line ) );
Sets a user defined assert handler that will be called on an assertion failure.
extern (C) void onAssert( char[] file, uint line );
extern (C) void onOutOfMemory();
extern (C) void onArrayBoundsError( char[] file, uint line );
extern (C) void onSwitchError( char[] file, uint line );
extern (C) void onInvalidUtfError( char[] msg, size_t idx );
These functions are designed to facilitate library interaction. Each is expected to be called when its respective event occurs. If a handler is mapped via a setHandler routine then that function should be called, otherwise the
class ThreadError; class Thread;
class ThreadError : Exception { this( char[] msg ); }
class Thread { this(); this( void function() fn ); this( void delegate() dg ); ~this(); final char[] name(); final void name( char[] n ); final void start(); final bit isRunning(); final void join(); final void suspend(); final void resume(); final void* stackHead(); final void* stackTail(); final void* regHead(); final void* regTail(); static this(); static ~this(); static void sleep( uint milliseconds ); static void yield(); static size_t count(); static void suspendAll(); static void resumeAll(); static Thread getThis(); static Thread[] getAll(); static int opApply( int delegate( inout Thread ) dg ); protected: void run(); }
Note that some static members of this class are required by the garbage collector and therefore must operate correctly without dynamic memory allocation and may be called before the module's static ctor has been run.