Exits the whole process in a controlled manner.
void abort_maincontext( int err )
Aborts the calling thread.
void abort_thread( void )
Aborts all running and waiting threads.
int abortall_syncrun( syncrun_t * srun )
Implements syncrun_t.abortthread_syncrun.
#define abortthread_syncrun( srun ) do { setstateabort_syncrun(srun) ; return 0 ; } while (0)
Sets the state of the running thread to syncrun_state_ABORT and returns 0.
void abortthread_syncrun( syncrun_t * srun )
Returns the absolute value as unsigned value from a signed integer.
uint32_t abs_int32( int32_t i )
Returns the absolute value as unsigned value from a signed.
uint64_t abs_int64( int64_t i )
Implements resourceusage_t.acceptmallocleak_resourceusage.
#define acceptmallocleak_resourceusage( usage, malloc_leak_in_bytes ) do { (usage)->malloc_acceptleak = (malloc_leak_in_bytes); } while (0)
Returns access mode (read and or write) for a io channel.
accessmode_e accessmode_file( const file_t fileobj )
Returns accessmode_e for an io channel.
uint8_t accessmode_iochannel( const iochannel_t ioc )
Adds a new root ptrblock_t and sets ptrblock_t.childs[0] to old root.
static int adaptdepth_blockarray( blockarray_t * barray, uint8_t depth )
Adds the last two parameters and returns the sum in the first.
int add_bigint( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Adds two integers.
static int add_biginthelper( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Adds the last two parameters and returns the sum in the first.
int add_decimal( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec )
Implements adding of two decimal numbers.
static int add_decimalhelper( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec )
This function process the next input character in state->suffix.
static int addchar_suffixtree( suffixtree_t * tree, suffixtree_addstate_t * state )
Implements textpos_t.addcolumn_textpos.
#define addcolumn_textpos( txtpos, increment ) ((txtpos)->column += (increment))
Adds increment to the column number.
size_t addcolumn_textpos( textpos_t * txtpos, size_t increment )
Memory start address of binary/string key.
const uint8_t * addr
Same as ipaddr_t.addr.
sys_socketaddr_t addr[1]
Opaque representation of internet address (IPv4 or IPv6).
sys_socketaddr_t addr[]
Holds start address of memory buffer.
uint8_t * addr
Address of allocated buffer.
uint8_t *addr
Points to start (lowest) address of memory.
uint8_t * addr
The start address of the mapped memory.
uint8_t * addr
Start address of non-const string memory.
const uint8_t * addr
Start address of binary data of key.
const uint8_t * addr/*[size]*/
Start address or lowest address of mapping.
void * addr
Points to start (lowest) address of memory.
uint8_t * addr
Implements memblock_t.addr_memblock.
#define addr_memblock( mblock ) ((mblock)->addr)
Returns start (lowest) address of memory block.
uint8_t * addr_memblock( const memblock_t * mblock )
Implements mmfile_t.addr_mmfile.
#define addr_mmfile( mfile ) ((mfile)->addr)
Returns the lowest address of the mapped memory.
uint8_t * addr_mmfile( const mmfile_t * mfile )
Returns the start address of a part of the string at index stridx.
const uint8_t * addr_splitstring( const splitstring_t * spstr, uint8_t stridx )
Implements string_t.addr_string.
#define addr_string( str ) ((str)->addr)
Returns the start address of the string in memory.
const uint8_t * addr_string( const string_t * str )
Same as ipaddr_t.addrlen.
uint16_t addrlen
Length of internal address representation addr.
uint16_t addrlen
Implements adding of two positive decimal numbers.
static void addsplit_decimalhelper( decimal_t * restrict result, uint8_t digitsoffset, uint8_t lsize, const uint32_t * ldigits, uint8_t rsize, const uint32_t * rdigits )
Implements syncqueue_t.addtofreelist_syncqueue.
#define addtofreelist_syncqueue( syncqueue, freelist, elem ) do { static_assert( sizeof(*(elem)) >= sizeof(dlist_node_t), "Check that element can hold a dlist_node_t") ; insertfirst_dlist( freelist, (dlist_node_t*)elem) ; } while (0)
Adds elem to freelist.
void addtofreelist_syncqueue( syncqueue_t * syncqueue, struct dlist_t * freelist, IDNAME * elem )
Add header_USERVALUE to offsets->header and adapts offsets.
static void adduservalue_trienodeoffsets( trie_nodeoffsets_t * offsets )
Expects data not to be accessed in the near future.
int advisedontneed_file( file_t fileobj, off_t offset, off_t length )
Expects data to be accessed sequentially and in the near future.
int advisereadahead_file( file_t fileobj, off_t offset, off_t length )
Stores an exponent of DIGITSBASE and a reference to a shift-left function.
struct alignedexpandshift_t
Implements mmfile_t.alignedsize_mmfile.
#define alignedsize_mmfile( mfile ) ((size_mmfile(mfile) + (pagesize_vm()-1)) & ~(pagesize_vm()-1))
Returns the size of the mapped memory.
size_t alignedsize_mmfile( const mmfile_t * mfile )
Returns sizeof(staticpage_t) aligned to KONFIG_MEMALIGN.
static inline size_t alignedsize_staticpage( void )
Returns the difference between decimal_exponent and the aligned exponent.
static inline int alignexponent_decimalhelper( /*out*/uint32_t * exponent_correction, int32_t decimal_exponent )
Aligns offset to architecture specific pointer alignment.
static inline unsigned alignoffset_trienode( unsigned offset )
Aligns a value to the next multiple of KONFIG_MEMALIGN.
static inline size_t alignsize_testmmblock( size_t bytesize )
Allocate a new memory block of new_size bytes and return it in memstr.
int ( * alloc ) (void * impl, size_t new_size, /*inout*/struct memstream_t * memstr)
Resizes cstring_t if necessary and returns additional memory in memstr.
static int alloc_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Allocates a new memory block with error.
#define ALLOC_ERR_MM( errtimer, size, mblock ) ( __extension__ ({ err = process_testerrortimer(errtimer); if (! err) err = ALLOC_MM(size, mblock); err ; }))
Resizes memblock_t if necessary and returns additional memory in memstr.
static int alloc_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Allocates a new memory block.
#define ALLOC_MM( size, mblock ) malloc_mm(mm_maincontext(), size, mblock)
Allocates a single memory page of size pgsize (see pagesize_e) and returns it in page.
#define ALLOC_PAGECACHE( pgsize, page ) (allocpage_pagecache(pagecache_maincontext(), (pgsize), (page)))
Returns always ENOMEM.
static int alloc_static_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Makes sure cstr has at least allocate_size preallocated bytes.
int allocate_cstring( cstring_t * cstr, size_t allocate_size )
Does the real allocation / reallocation.
static int allocate_decimalhelper( decimal_t *restrict * dec, uint32_t size_allocate )
Preallocates blocks on disk filled with 0 bytes.
int allocate_file( file_t fileobj, off_t file_size )
Allocates a block of memory.
static int allocateblock_binarystack( binarystack_t * stack, uint32_t size )
Reserves some memory pages for internal buffer.
static int allocatebuffer_logwriter( /*out*/memblock_t * buffer )
The number of allocated digits.
uint16_t allocated_digits
The number of allocated rows of tablevalues.
size_t allocated_rows
Size of allocated memory block chars points to.
size_t allocated_size
Implements cstring_t.allocatedsize.
#define allocatedsize_cstring( cstr ) ((cstr)->allocated_size)
Returns the allocated buffer size in bytes.
size_t allocatedsize_cstring( const cstring_t * cstr )
Returns allocated number of bytes which are not freed.
int allocatedsize_malloc( /*out*/size_t * number_of_allocated_bytes )
Allocate new pageblock_block_t and add it to freelist.
static inline int allocblock_pagecacheimpl( pagecache_impl_t * pgcache, pagesize_e pgsize, /*out*/pagecache_block_t ** block )
Allocates a single memory page of size pgsize.
int ( * allocpage ) (pagecache_t * pgcache, uint8_t pgsize, /*out*/struct memblock_t * page)
Implements pagecache_t.allocpage_pagecache.
#define allocpage_pagecache( pgcache, pgsize, page ) ((pgcache).iimpl->allocpage((pgcache).object, (pgsize), (page)))
Calls pgcache->iimpl->allocpage with pgcache->object as first parameter.
int allocpage_pagecache( const pagecache_t pgcache, uint8_t pgsize, /*out*/struct memblock_t * page )
Allocates a single memory page of size pgsize.
int allocpage_pagecacheimpl( pagecache_impl_t * pgcache, uint8_t pgsize, /*out*/struct memblock_t * page )
Allocates static memory which should live as long as pgcache.
int ( * allocstatic ) (pagecache_t * pgcache, size_t bytesize, /*out*/struct memblock_t * memblock)
Allocates size bytes of memory and returns the start address.
void * allocstatic_maincontext( uint8_t size )
Implements pagecache_t.allocstatic_pagecache.
#define allocstatic_pagecache( pgcache, bytesize, memblock ) ((pgcache).iimpl->allocstatic((pgcache).object, (bytesize), (memblock)))
Calls pgcache->iimpl->allocstatic with pgcache->object as first parameter.
int allocstatic_pagecache( const pagecache_t pgcache, size_t bytesize, /*out*/struct memblock_t * memblock )
Allocates static block of memory and returns it in memblock.
#define ALLOCSTATIC_PAGECACHE( bytesize, memblock ) (allocstatic_pagecache(pagecache_maincontext(), (bytesize), (memblock)))
Allocates static memory which should live as long as pgcache.
int allocstatic_pagecacheimpl( pagecache_impl_t * pgcache, size_t bytesize, /*out*/struct memblock_t * memblock )
Returns in api the client rendering API the context supports.
int api_eglcontext( const eglcontext_t eglcont, struct opengl_display_t * egldisp, /*out*/uint8_t * api )
Implements gcontext_t.api_gcontext.
#define api_gcontext( cont, disp, api ) api_eglcontext(gl_gcontext(cont), gl_display(disp), api)
Returns in api the client rendering API cont supports.
int api_gcontext( const gcontext_t * cont, struct display_t * disp, /*out*/uint8_t * api )
Appends str with len str_len to cstr.
int append_cstring( cstring_t * cstr, size_t str_len, const char str[str_len] )
Implements wbuffer_t.appendbyte_wbuffer.
#define appendbyte_wbuffer( wbuf, c ) ( __extension__ ({ int _err = 0 ; wbuffer_t * _wb = (wbuf) ; if ( 0 != sizereserved_wbuffer(_wb) || (0 == (_err = _wb->iimpl-> alloc(_wb->impl, 1, (struct memstream_t*)_wb)))) { *(_wb->next++) = c ; } _err ; }))
Appends 1 byte to the buffer.
int appendbyte_wbuffer( wbuffer_t * wbuf, const uint8_t c )
Appends buffer_size bytes of unitilaized memory to wbuf.
int appendbytes_wbuffer( wbuffer_t * wbuf, size_t buffer_size, uint8_t ** buffer )
Appends the first buffer_size bytes from buffer to wbuf.
int appendcopy_wbuffer( wbuffer_t * wbuf, size_t buffer_size, const uint8_t * buffer )
The number of process arguments.
int argc
An array of program arguments.
const char ** argv
Remembers iterated container.
arraysf_t * array
Remembers iterated container.
arraystf_t * array
Points to next array of vm_region_t which comes after array element_iterator points to.
vm_regionsarray_t * array_iterator
Returns an array index for an addr located in a pagecache_block_t.pageblock.
static inline size_t arrayindex_pagecacheblock( const void * addr )
Implements arraysf_t.arraysf_IMPLEMENT.
#define arraysf_IMPLEMENT( _fsuffix, object_t, nodename ) typedef arraysf_iterator_t iteratortype##_fsuffix ; typedef object_t * iteratedtype##_fsuffix ; static inline int new##_fsuffix(/*out*/arraysf_t ** array, uint32_t toplevelsize, uint8_t posshift) __attribute__ ((always_inline)) ; static inline int delete##_fsuffix(arraysf_t ** array, struct typeadapt_member_t * nodeadp) __attribute__ ((always_inline)) ; static inline size_t length##_fsuffix(arraysf_t * array) __attribute__ ((always_inline)) ; static inline object_t * at##_fsuffix(const arraysf_t * array, size_t pos) __attribute__ ((always_inline)) ; static inline int insert##_fsuffix(arraysf_t * array, object_t * node, /*out*/object_t ** inserted_node/*0=>not returned*/, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) __attribute__ ((always_inline)) ; static inline int tryinsert##_fsuffix(arraysf_t * array, object_t * node, /*out;err*/object_t ** inserted_or_existing_node, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) __attribute__ ((always_inline)) ; static inline int remove##_fsuffix(arraysf_t * array, size_t pos, /*out*/object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int tryremove##_fsuffix(arraysf_t * array, size_t pos, /*out*/object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int initfirst##_fsuffix##iterator(/*out*/arraysf_iterator_t * iter, arraysf_t * array) __attribute__ ((always_inline)) ; static inline int free##_fsuffix##iterator(arraysf_iterator_t * iter) __attribute__ ((always_inline)) ; static inline bool next##_fsuffix##iterator(arraysf_iterator_t * iter, /*out*/object_t ** node) __attribute__ ((always_inline)) ; static inline arraysf_node_t * asnode##_fsuffix(object_t * object) { static_assert(&((object_t*)0)->nodename == (void*)offsetof(object_t, nodename), "correct type") ; return (arraysf_node_t*) ((uintptr_t)object + offsetof(object_t, nodename)) ; } static inline object_t * asobject##_fsuffix(arraysf_node_t * node) { return (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) ; } static inline object_t * asobjectnull##_fsuffix(arraysf_node_t * node) { return node ? (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) : 0 ; } static inline int new##_fsuffix(/*out*/arraysf_t ** array, uint32_t toplevelsize, uint8_t posshift) { return new_arraysf(array, toplevelsize, posshift) ; } static inline int delete##_fsuffix(arraysf_t ** array, struct typeadapt_member_t * nodeadp) { return delete_arraysf(array, nodeadp) ; } static inline size_t length##_fsuffix(arraysf_t * array) { return length_arraysf(array) ; } static inline object_t * at##_fsuffix(const arraysf_t * array, size_t pos) { arraysf_node_t * node = at_arraysf(array, pos) ; return asobjectnull##_fsuffix(node) ; } static inline int insert##_fsuffix(arraysf_t * array, object_t * node, /*out*/object_t ** inserted_node/*0=>not returned*/, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) { int err = insert_arraysf(array, asnode##_fsuffix(node), (struct arraysf_node_t**)inserted_node, nodeadp) ; if (!err && inserted_node) *inserted_node = asobject##_fsuffix(*(struct arraysf_node_t**)inserted_node) ; return err ; } static inline int tryinsert##_fsuffix(arraysf_t * array, object_t * node, /*out;err*/object_t ** inserted_or_existing_node, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) { int err = tryinsert_arraysf(array, asnode##_fsuffix(node), (struct arraysf_node_t**)inserted_or_existing_node, nodeadp) ; *inserted_or_existing_node = asobjectnull##_fsuffix(*(struct arraysf_node_t**)inserted_or_existing_node) ; return err ; } static inline int remove##_fsuffix(arraysf_t * array, size_t pos, /*out*/object_t ** removed_node) { int err = remove_arraysf(array, pos, (struct arraysf_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(struct arraysf_node_t**)removed_node) ; return err ; } static inline int tryremove##_fsuffix(arraysf_t * array, size_t pos, /*out*/object_t ** removed_node) { int err = tryremove_arraysf(array, pos, (struct arraysf_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(struct arraysf_node_t**)removed_node) ; return err ; } static inline int initfirst##_fsuffix##iterator(/*out*/arraysf_iterator_t * iter, arraysf_t * array) { return initfirst_arraysfiterator(iter, array) ; } static inline int free##_fsuffix##iterator(arraysf_iterator_t * iter) { return free_arraysfiterator(iter) ; } static inline bool next##_fsuffix##iterator(arraysf_iterator_t * iter, /*out*/object_t ** node) { bool isNext = next_arraysfiterator(iter, (struct arraysf_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(struct arraysf_node_t**)node) ; return isNext ; }
Adapts interface of arraysf_t to object type object_t.
void arraysf_IMPLEMENT( IDNAME _fsuffix, TYPENAME object_t, IDNAME nodename ) ;
Static initializer.
#define arraysf_iterator_FREE { 0, 0, 0 }
Iterates over elements contained in arraysf_t.
struct arraysf_iterator_t
Internal node to implement a multiway trie.
struct arraysf_mwaybranch_t
Allows to embed members of arraysf_node_t into another structure.
#define arraysf_node_EMBED( name_pos ) size_t name_pos
Static initializer with parameter pos of type size_t.
#define arraysf_node_INIT( pos ) { pos }
Generic node type stored by arraysf_t.
struct arraysf_node_t
Trie implementation to support sparse arrays.
struct arraysf_t
Implements arraystf_t.arraystf_IMPLEMENT.
#define arraystf_IMPLEMENT( _fsuffix, object_t, nodename ) typedef arraystf_iterator_t iteratortype##_fsuffix ; typedef object_t * iteratedtype##_fsuffix ; static inline int new##_fsuffix(/*out*/arraystf_t ** array, uint32_t toplevelsize) __attribute__ ((always_inline)) ; static inline int delete##_fsuffix(arraystf_t ** array, struct typeadapt_member_t * nodeadp) __attribute__ ((always_inline)) ; static inline size_t length##_fsuffix(arraystf_t * array) __attribute__ ((always_inline)) ; static inline object_t * at##_fsuffix(const arraystf_t * array, size_t size, const uint8_t keydata[size]) __attribute__ ((always_inline)) ; static inline int insert##_fsuffix(arraystf_t * array, object_t * node, /*out*/object_t ** inserted_node/*0=>copy not returned*/, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) __attribute__ ((always_inline)) ; static inline int tryinsert##_fsuffix(arraystf_t * array, object_t * node, /*out;err*/object_t ** inserted_or_existing_node, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) __attribute__ ((always_inline)) ; static inline int remove##_fsuffix(arraystf_t * array, size_t size, const uint8_t keydata[size], /*out*/object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int tryremove##_fsuffix(arraystf_t * array, size_t size, const uint8_t keydata[size], /*out*/object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int initfirst##_fsuffix##iterator(/*out*/arraystf_iterator_t * iter, arraystf_t * array) __attribute__ ((always_inline)) ; static inline int free##_fsuffix##iterator(arraystf_iterator_t * iter) __attribute__ ((always_inline)) ; static inline bool next##_fsuffix##iterator(arraystf_iterator_t * iter, /*out*/object_t ** node) __attribute__ ((always_inline)) ; static inline arraystf_node_t * asnode##_fsuffix(object_t * object) { static_assert(&((object_t*)0)->nodename == (void*)offsetof(object_t, nodename), "correct type") ; return (arraystf_node_t*) ((uintptr_t)object + offsetof(object_t, nodename)) ; } static inline object_t * asobject##_fsuffix(arraystf_node_t * node) { return (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) ; } static inline object_t * asobjectnull##_fsuffix(arraystf_node_t * node) { return node ? (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) : 0 ; } static inline int new##_fsuffix(/*out*/arraystf_t ** array, uint32_t toplevelsize) { return new_arraystf(array, toplevelsize) ; } static inline int delete##_fsuffix(arraystf_t ** array, struct typeadapt_member_t * nodeadp) { return delete_arraystf(array, nodeadp) ; } static inline size_t length##_fsuffix(arraystf_t * array) { return length_arraystf(array) ; } static inline object_t * at##_fsuffix(const arraystf_t * array, size_t size, const uint8_t keydata[size]) { arraystf_node_t * node = at_arraystf(array, size, keydata) ; return asobjectnull##_fsuffix(node) ; } static inline int insert##_fsuffix(arraystf_t * array, object_t * node, /*out*/object_t ** inserted_node/*0=>copy not returned*/, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) { int err = insert_arraystf(array, asnode##_fsuffix(node), (struct arraystf_node_t**)inserted_node, nodeadp) ; if (!err && inserted_node) *inserted_node = asobject##_fsuffix(*(struct arraystf_node_t**)inserted_node) ; return err ; } static inline int tryinsert##_fsuffix(arraystf_t * array, object_t * node, /*out;err*/object_t ** inserted_or_existing_node, struct typeadapt_member_t * nodeadp/*0=>no copy is made*/) { int err = tryinsert_arraystf(array, asnode##_fsuffix(node), (struct arraystf_node_t**)inserted_or_existing_node, nodeadp) ; *inserted_or_existing_node = asobjectnull##_fsuffix(*(struct arraystf_node_t**)inserted_or_existing_node) ; return err ; } static inline int remove##_fsuffix(arraystf_t * array, size_t size, const uint8_t keydata[size], /*out*/object_t ** removed_node) { int err = remove_arraystf(array, size, keydata, (struct arraystf_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(struct arraystf_node_t**)removed_node) ; return err ; } static inline int tryremove##_fsuffix(arraystf_t * array, size_t size, const uint8_t keydata[size], /*out*/object_t ** removed_node) { int err = tryremove_arraystf(array, size, keydata, (struct arraystf_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(struct arraystf_node_t**)removed_node) ; return err ; } static inline int initfirst##_fsuffix##iterator(/*out*/arraystf_iterator_t * iter, arraystf_t * array) { return initfirst_arraystfiterator(iter, array) ; } static inline int free##_fsuffix##iterator(arraystf_iterator_t * iter) { return free_arraystfiterator(iter) ; } static inline bool next##_fsuffix##iterator(arraystf_iterator_t * iter, /*out*/object_t ** node) { bool isNext = next_arraystfiterator(iter, (struct arraystf_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(struct arraystf_node_t**)node) ; return isNext ; }
Adapts interface of arraystf_t to object type object_t.
void arraystf_IMPLEMENT( IDNAME _fsuffix, TYPENAME object_t, IDNAME nodename ) ;
Static initializer.
#define arraystf_iterator_FREE { 0, 0, 0 }
Iterates over elements contained in arraystf_t.
struct arraystf_iterator_t
Describes the value of a key string at a certain memory offset.
struct arraystf_keyval_t
Internal node to implement a multiway trie.
struct arraystf_mwaybranch_t
Allows to embed members of arraystf_node_t into another structure.
#define arraystf_node_EMBED( name_addr, name_size ) const uint8_t * name_addr ; size_t name_size
Static initializer with parameter length in bytes and address of key.
#define arraystf_node_INIT( length, key ) { .addr = key, .size = length }
Static initializer with parameter cstr referencing a “constant string”.
#define arraystf_node_INIT_CSTR( cstr ) { .addr = (const uint8_t*)(cstr), .size = (sizeof(cstr)?sizeof(cstr)-1:0) }
Generic user node type stored by arraystf_t.
struct arraystf_node_t
Trie implementation to support arrays index with string keys.
struct arraystf_t
Converts value returned by eglerr_egl into a system/application specific error code.
int aserrcode_egl( int eglerr )
Prints »Assertion failed« and aborts process.
#define assert( expr ) ((expr) ? (void) 0 : assertfail_maincontext(STR(expr), __FILE__, __LINE__, __FUNCTION__))
Exits the whole process in a controlled manner.
void assertfail_maincontext( const char * condition, const char * file, int line, const char * funcname )
Implements blockarray_t.assign_blockarray.
#define assign_blockarray( barray, arrayindex, elemaddr ) (assign2_blockarray(barray, arrayindex, true, elemaddr))
Assigns memory to an element at position arrayindex and returns its address in elemaddr.
int assign_blockarray( blockarray_t * barray, size_t arrayindex, /*out*/void ** elemaddr )
Implements at_blockarray and assign_blockarray.
int assign2_blockarray( blockarray_t * barray, size_t arrayindex, bool is_allocate, /*out*/void ** elemaddr )
Returns contained node at position pos.
struct arraysf_node_t * at_arraysf( const arraysf_t * array, size_t pos )
Returns node with same key as *keydata*[size].
struct arraystf_node_t * at_arraystf( const arraystf_t * array, size_t size, const uint8_t keydata[size] )
Implements blockarray_t.at_blockarray.
#define at_blockarray( barray, arrayindex ) ( __extension__ ({ void * elemaddr = 0 ; assign2_blockarray( (barray), (arrayindex), false, &elemaddr) ; elemaddr ; }))
Returns the memory address of element at position arrayindex.
void * at_blockarray( blockarray_t * barray, size_t arrayindex )
TODO: describe During trie traversal two nodes are merged into one if this saves space.
void ** at_trie( trie_t * trie, uint16_t keylen, const uint8_t key[keylen] )
Implements int_t.atomicadd_int.
#define atomicadd_int( i, increment ) (__sync_fetch_and_add((i), (increment)))
Add increment to i and return old value atomically.
int atomicadd_int( int * i, uint32_t increment )
Implements int_t.atomicclear_int.
#define atomicclear_int( flag ) (__sync_lock_release(flag))
Sets flag to value 0.
void atomicclear_int( uint8_t * flag )
Implements int_t.atomicread_int.
#define atomicread_int( i ) (__sync_fetch_and_add((i), 0))
Reads last written value from memory location i.
int atomicread_int( int * i )
Implements int_t.atomicset_int.
#define atomicset_int( flag ) (__sync_lock_test_and_set(flag, 1))
Sets flag to value != 0 and returns previous value.
int atomicset_int( uint8_t * flag )
Implements int_t.atomicsub_int.
#define atomicsub_int( i, decrement ) (__sync_fetch_and_sub((i), (decrement)))
Sub decrement from i and return old value atomically.
int atomicsub_int( int * i, uint32_t decrement )
Implements int_t.atomicswap_int.
#define atomicswap_int( i, oldval, newval ) (__sync_val_compare_and_swap(i, oldval, newval))
If *i is equal to oldval change it into newval atomically else do nothing.
int atomicswap_int( int * i, int oldval, int newval )
Implements int_t.atomicwrite_int.
#define atomicwrite_int( i, newval ) ( __extension__ ({ typeof(i) _i = (i) ; typeof(*_i) _new = (newval) ; typeof(*_i) _old = *_i ; typeof(*_i) _old2 ; for (;;) { _old2 = __sync_val_compare_and_swap( _i, _old, _new) ; if (_old2 == _old) break ; _old = _old2 ; } _old ; }))
Writes newval into memory located at i.
void atomicwrite_int( int * i, int newval )
Checks that a certain user / password combination is valid.
int authenticate_sysuser( const char * username, const char * password )
Function called back from PAM library during authentication of user.
static int authenticatecallback_sysuser( int num_msg, const struct pam_message ** msg, struct pam_response ** resp, void * appdata_ptr )