Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 abort
 abort_maincontext, maincontext_t
 abort_thread, thread_t
 abortall_syncrun, syncrun_t
 abortthread_syncrun
 abs_int32
 abs_int64
 acceptmallocleak_resourceusage
 access
 Accessing Context
 accessmode_e
 accessmode_EXEC
 accessmode_file, file_t
 accessmode_iochannel, iochannel_t
 accessmode_NEXTFREE_BITPOS
 accessmode_NONE
 accessmode_PRIVATE
 accessmode_RDWR
 accessmode_RDWR_PRIVATE
 accessmode_RDWR_SHARED
 accessmode_READ
 accessmode_SHARED
 accessmode_WRITE
 adaptdepth_blockarray
 add
 add_bigint, bigint_t
 add_biginthelper
 add_decimal, decimal_t
 add_decimalhelper
 addchar_suffixtree
 addcolumn_textpos
 addr
 addr_memblock
 addr_mmfile
 addr_splitstring
 addr_string
 addrlen
 addsplit_decimalhelper
 addsubnode_trienode, trie_node_t
 addtofreelist_syncqueue
 adduservalue_trienode, trie_node_t
 adduservalue_trienodeoffsets, trie_nodeoffsets_t
 advisedontneed_file, file_t
 advisereadahead_file, file_t
 Algorithm
 alignedexpandshift_t
 alignedsize_mmfile
 alignedsize_staticpage, staticpage_t
 alignexponent_decimalhelper
 alignoffset_trienode, trie_node_t
 alignsize_testmmblock, testmm_block_t
 All-or-Nothing Approach
 alloc
 alloc_cstring_wbuffer
 ALLOC_ERR_MM
 alloc_memblock_wbuffer
 ALLOC_MM
 ALLOC_PAGECACHE
 alloc_static_wbuffer
 allocate
 allocate-test
 allocate_cstring, cstring_t
 allocate_decimalhelper
 allocate_file, file_t
 allocateblock_binarystack
 allocatebuffer_logwriter
 allocated_digits, bigint_t
 allocated_rows, csvfilereader_t
 allocated_size, cstring_t
 allocatedsize_cstring
 allocatedsize_malloc
 allocatedsize_malloc impl
 allocation
 allocblock_pagecacheimpl
 allocpage, pagecache_it
 allocpage_pagecache
 allocpage_pagecacheimpl, pagecache_impl_t
 allocstatic, pagecache_it
 allocstatic_maincontext, maincontext_t
 allocstatic_pagecache
 ALLOCSTATIC_PAGECACHE
 allocstatic_pagecacheimpl, pagecache_impl_t
 api_eglcontext, eglcontext_t
 api_gcontext
 append_cstring, cstring_t
 appendbyte_wbuffer
 appendbytes_wbuffer
 appendcopy_wbuffer, wbuffer_t
 Archtitectural Support
 argc, maincontext_startparam_t
 argv, maincontext_startparam_t
 array
 array_iterator, vm_mappedregions_t
 arrayindex_pagecacheblock
 ArraySF
 ArraySF impl
 ArraySF-Node
 arraysf_IMPLEMENT
 arraysf_iterator_FREE, arraysf_iterator_t
 arraysf_iterator_t
 arraysf_mwaybranch_t
 arraysf_node_EMBED, arraysf_node_t
 arraysf_node_INIT, arraysf_node_t
 arraysf_node_t
 arraysf_t
 arraysf_unode_t
 ArraySTF
 ArraySTF impl
 ArraySTF-Node
 arraystf_IMPLEMENT
 arraystf_iterator_FREE, arraystf_iterator_t
 arraystf_iterator_t
 arraystf_keyval_t
 arraystf_mwaybranch_t
 arraystf_node_EMBED, arraystf_node_t
 arraystf_node_INIT, arraystf_node_t
 arraystf_node_INIT_CSTR, arraystf_node_t
 arraystf_node_t
 arraystf_t
 arraystf_unode_t
 aserrcode_egl, egl_t
 assert
 assertfail_maincontext, maincontext_t
 AssertTest
 assign
 assign_blockarray
 assign2_blockarray, blockarray_t
 asTOTYPE
 at_arraysf, arraysf_t
 at_arraystf, arraystf_t
 at_blockarray
 at_trie, trie_t
 atomic_uint32_t
 atomicadd_int
 atomicclear_int
 atomicops, int_t
 AtomicOps
 AtomicOps impl
 atomicread_int
 atomicset_int
 atomicsub_int
 atomicswap_int
 atomicwrite_int
 authenticate_sysuser, sysuser_t
 authenticatecallback_sysuser
 authentication
void abort_maincontext(int err)
Exits the whole process in a controlled manner.
void abort_thread(void)
Aborts the calling thread.
int abortall_syncrun(syncrun_t *srun)
Aborts all running and waiting threads.
#define abortthread_syncrun(
   srun
) do { setstateabort_syncrun(srun) ; return 0 ; } while (0)
Implements syncrun_t.abortthread_syncrun.
void abortthread_syncrun(syncrun_t *srun)
Sets the state of the running thread to syncrun_state_ABORT and returns 0.
Implements int_t.abs_int32.
uint32_t abs_int32(int32_t i)
Returns the absolute value as unsigned value from a signed integer.
Implements int_t.abs_int64.
uint64_t abs_int64(int64_t i)
Returns the absolute value as unsigned value from a signed.
#define acceptmallocleak_resourceusage(
   usage,
   malloc_leak_in_bytes
) do { (usage)->malloc_acceptleak = (malloc_leak_in_bytes); } while (0)
Implements resourceusage_t.acceptmallocleak_resourceusage.
The process context (processcontext_t) can be accessed with maincontext_t.pcontext_maincontext.
Determines how you can access a data block (on disk or in memory).
Allows for executing (only).
accessmode_e accessmode_file(const file_t fileobj)
Returns access mode (read and or write) for a io channel.
uint8_t accessmode_iochannel(const iochannel_t ioc)
Returns accessmode_e for an io channel.
Next free bit position useful in a subtype of accessmode_e.
Neither read nor write nor exec is allowed.
Write access to data or memory block is private to its process (COPY_ON_WRITE).
Combination of accessmode_READ and accessmode_WRITE.
Combination of accessmode_RDWR and accessmode_PRIVATE.
Combination of accessmode_RDWR and accessmode_SHARED.
Allows for reading (only).
A write to a data or memory block is shared between all processes.
Allows for writing (only).
static int adaptdepth_blockarray(blockarray_t *barray,
uint8_t depth)
Adds a new root ptrblock_t and sets ptrblock_t.childs[0] to old root.
int add_bigint(bigint_t *restrict *result,
const bigint_t *lbig,
const bigint_t *rbig)
Adds the last two parameters and returns the sum in the first.
static int add_biginthelper(bigint_t *restrict *result,
const bigint_t *lbig,
const bigint_t *rbig)
Adds two integers.
int add_decimal(decimal_t *restrict *result,
const decimal_t *ldec,
const decimal_t *rdec)
Adds the last two parameters and returns the sum in the first.
static int add_decimalhelper(decimal_t *restrict *result,
const decimal_t *ldec,
const decimal_t *rdec)
Implements adding of two decimal numbers.
static int addchar_suffixtree(suffixtree_t *tree,
suffixtree_addstate_t *state)
This function process the next input character in state->suffix.
#define addcolumn_textpos(txtpos,
increment) ((txtpos)->column += (increment))
Implements textpos_t.addcolumn_textpos.
size_t addcolumn_textpos(textpos_t *txtpos,
size_t increment)
Adds increment to the column number.
const uint8_t * addr
Memory start address of binary/string key.
sys_socketaddr_t addr[1]
Same as ipaddr_t.addr.
sys_socketaddr_t addr[]
Opaque representation of internet address (IPv4 or IPv6).
uint8_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.
const uint8_t * addr
Start address of non-const string memory.
const uint8_t * addr/*[size]*/
Start address of binary data of key.
void * addr
Start address or lowest address of mapping.
uint8_t * addr
Points to start (lowest) address of memory.
#define addr_memblock(mblock) ((mblock)->addr)
Implements memblock_t.addr_memblock.
uint8_t * addr_memblock(const memblock_t *mblock)
Returns start (lowest) address of memory block.
#define addr_mmfile(mfile) ((mfile)->addr)
Implements mmfile_t.addr_mmfile.
uint8_t * addr_mmfile(const mmfile_t *mfile)
Returns the lowest address of the mapped memory.
Implements splitstring_t.addr_splitstring.
const uint8_t * addr_splitstring(const splitstring_t *spstr,
uint8_t stridx)
Returns the start address of a part of the string at index stridx.
#define addr_string(str) ((str)->addr)
Implements string_t.addr_string.
const uint8_t * addr_string(const string_t *str)
Returns the start address of the string in memory.
uint16_t addrlen
Same as ipaddr_t.addrlen.
uint16_t addrlen
Length of internal address representation addr.
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 adding of two positive decimal numbers.
Moves all pointers in child[] array to subnode.
#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)
Implements syncqueue_t.addtofreelist_syncqueue.
void addtofreelist_syncqueue(syncqueue_t *syncqueue,
struct dlist_t *freelist,
IDNAME *elem)
Adds elem to freelist.
static void adduservalue_trienodeoffsets(trie_nodeoffsets_t *offsets)
Add header_USERVALUE to offsets->header and adapts offsets.
int advisedontneed_file(file_t fileobj,
off_t offset,
off_t length)
Expects data not to be accessed in the near future.
int advisereadahead_file(file_t fileobj,
off_t offset,
off_t length)
Expects data to be accessed sequentially and in the near future.
The container of exthash_t holds all entries in an array of size of a power of two.
struct alignedexpandshift_t
Stores an exponent of DIGITSBASE and a reference to a shift-left function.
#define alignedsize_mmfile(
   mfile
) ((size_mmfile(mfile) + (pagesize_vm()-1)) & ~(pagesize_vm()-1))
Implements mmfile_t.alignedsize_mmfile.
size_t alignedsize_mmfile(const mmfile_t *mfile)
Returns the size of the mapped memory.
static inline size_t alignedsize_staticpage(void)
Returns sizeof(staticpage_t) aligned to KONFIG_MEMALIGN.
static inline int alignexponent_decimalhelper(
   /*out*/uint32_t *exponent_correction,
   int32_t decimal_exponent
)
Returns the difference between decimal_exponent and the aligned exponent.
static inline unsigned alignoffset_trienode(unsigned offset)
Aligns offset to architecture specific pointer alignment.
static inline size_t alignsize_testmmblock(size_t bytesize)
Aligns a value to the next multiple of KONFIG_MEMALIGN.
Functions which change something should do so in an all-or-nothing approach.
int (
   *alloc
) (void * impl, size_t new_size, /*inout*/struct memstream_t * memstr)
Allocate a new memory block of new_size bytes and return it in memstr.
static int alloc_cstring_wbuffer(void *impl,
size_t new_size,
/*inout*/memstream_t *memstr)
Resizes cstring_t if necessary and returns additional memory in memstr.
#define ALLOC_ERR_MM(
   errtimer,
   size,
   mblock
) ( __extension__ ({ err = process_testerrortimer(errtimer); if (! err) err = ALLOC_MM(size, mblock); err ; }))
Allocates a new memory block with error.
static int alloc_memblock_wbuffer(void *impl,
size_t new_size,
/*inout*/memstream_t *memstr)
Resizes memblock_t if necessary and returns additional memory in memstr.
#define ALLOC_MM(size,
mblock) malloc_mm(mm_maincontext(), size, mblock)
Allocates a new memory block.
#define ALLOC_PAGECACHE(
   pgsize,
   page
) (allocpage_pagecache(pagecache_maincontext(), (pgsize), (page)))
Allocates a single memory page of size pgsize (see pagesize_e) and returns it in page.
static int alloc_static_wbuffer(void *impl,
size_t new_size,
/*inout*/memstream_t *memstr)
Returns always ENOMEM.
int allocate_cstring(cstring_t *cstr,
size_t allocate_size)
Makes sure cstr has at least allocate_size preallocated bytes.
static int allocate_decimalhelper(decimal_t *restrict *dec,
uint32_t size_allocate)
Does the real allocation / reallocation.
int allocate_file(file_t fileobj,
off_t file_size)
Preallocates blocks on disk filled with 0 bytes.
static int allocateblock_binarystack(binarystack_t *stack,
uint32_t size)
Allocates a block of memory.
static int allocatebuffer_logwriter(/*out*/memblock_t *buffer)
Reserves some memory pages for internal buffer.
uint16_t allocated_digits
The number of allocated digits.
size_t allocated_rows
The number of allocated rows of tablevalues.
size_t allocated_size
Size of allocated memory block chars points to.
#define allocatedsize_cstring(cstr) ((cstr)->allocated_size)
Implements cstring_t.allocatedsize.
size_t allocatedsize_cstring(const cstring_t *cstr)
Returns the allocated buffer size in bytes.
int allocatedsize_malloc(/*out*/size_t *number_of_allocated_bytes)
Returns allocated number of bytes which are not freed.
Uses GNU malloc_stats extension.
static inline int allocblock_pagecacheimpl(pagecache_impl_t *pgcache,
pagesize_e pgsize,
/*out*/pagecache_block_t **block)
Allocate new pageblock_block_t and add it to freelist.
int (
   *allocpage
) (pagecache_t * pgcache, uint8_t pgsize, /*out*/struct memblock_t * page)
Allocates a single memory page of size pgsize.
#define allocpage_pagecache(
   pgcache,
   pgsize,
   page
) ((pgcache).iimpl->allocpage((pgcache).object, (pgsize), (page)))
Implements pagecache_t.allocpage_pagecache.
int allocpage_pagecache(const pagecache_t pgcache,
uint8_t pgsize,
/*out*/struct memblock_t *page)
Calls pgcache->iimpl->allocpage with pgcache->object as first parameter.
int allocpage_pagecacheimpl(pagecache_impl_t *pgcache,
uint8_t pgsize,
/*out*/struct memblock_t *page)
Allocates a single memory page of size pgsize.
int (
   *allocstatic
) (pagecache_t * pgcache, size_t bytesize, /*out*/struct memblock_t * memblock)
Allocates static memory which should live as long as pgcache.
void * allocstatic_maincontext(uint8_t size)
Allocates size bytes of memory and returns the start address.
#define allocstatic_pagecache(
   pgcache,
   bytesize,
   memblock
) ((pgcache).iimpl->allocstatic((pgcache).object, (bytesize), (memblock)))
Implements pagecache_t.allocstatic_pagecache.
int allocstatic_pagecache(const pagecache_t pgcache,
size_t bytesize,
/*out*/struct memblock_t *memblock)
Calls pgcache->iimpl->allocstatic with pgcache->object as first parameter.
#define ALLOCSTATIC_PAGECACHE(
   bytesize,
   memblock
) (allocstatic_pagecache(pagecache_maincontext(), (bytesize), (memblock)))
Allocates static block of memory and returns it in memblock.
int allocstatic_pagecacheimpl(pagecache_impl_t *pgcache,
size_t bytesize,
/*out*/struct memblock_t *memblock)
Allocates static memory which should live as long as pgcache.
int api_eglcontext(const eglcontext_t eglcont,
struct opengl_display_t *egldisp,
/*out*/uint8_t *api)
Returns in api the client rendering API the context supports.
#define api_gcontext(
   cont,
   disp,
   api
) api_eglcontext(gl_gcontext(cont), gl_display(disp), api)
Implements gcontext_t.api_gcontext.
int api_gcontext(const gcontext_t *cont,
struct display_t *disp,
/*out*/uint8_t *api)
Returns in api the client rendering API cont supports.
int append_cstring(cstring_t *cstr,
size_t str_len,
const char str[str_len])
Appends str with len str_len to cstr.
#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 ; }))
Implements wbuffer_t.appendbyte_wbuffer.
int appendbyte_wbuffer(wbuffer_t *wbuf,
const uint8_t c)
Appends 1 byte to the buffer.
Implements wbuffer_t.appendbytes_wbuffer.
int appendbytes_wbuffer(wbuffer_t *wbuf,
size_t buffer_size,
uint8_t **buffer)
Appends buffer_size bytes of unitilaized memory to wbuf.
int appendcopy_wbuffer(wbuffer_t *wbuf,
size_t buffer_size,
const uint8_t *buffer)
Appends the first buffer_size bytes from buffer to wbuf.
int argc
The number of process arguments.
const char ** argv
An array of program arguments.
arraysf_t * array
Remembers iterated container.
arraystf_t * array
Remembers iterated container.
vm_regionsarray_t * array_iterator
Points to next array of vm_region_t which comes after array element_iterator points to.
static inline size_t arrayindex_pagecacheblock(const void *addr)
Returns an array index for an addr located in a pagecache_block_t.pageblock.
Array implementation which supports non-continuous index numbers (sparse distribution).
Implements array which supports non-continuous index values.
Defines node type arraysf_node_t which can be stored in an array of type arraysf_t.
#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 ; }
Implements arraysf_t.arraysf_IMPLEMENT.
void arraysf_IMPLEMENT(IDNAME _fsuffix,
TYPENAME object_t,
IDNAME nodename) ;
Adapts interface of arraysf_t to object type object_t.
#define arraysf_iterator_FREE { 0, 0, 0 }
Static initializer.
struct arraysf_iterator_t
Iterates over elements contained in arraysf_t.
struct arraysf_mwaybranch_t
Internal node to implement a multiway trie.
#define arraysf_node_EMBED(name_pos) size_t name_pos
Allows to embed members of arraysf_node_t into another structure.
#define arraysf_node_INIT(pos) { pos }
Static initializer with parameter pos of type size_t.
struct arraysf_node_t
Generic node type stored by arraysf_t.
struct arraysf_t
Trie implementation to support sparse arrays.
Array implementation which supports strings as indizes (st).
Implements array which supports strings as index values.
Defines node type arraystf_node_t which can be stored in an array of type arraystf_t.
#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 ; }
Implements arraystf_t.arraystf_IMPLEMENT.
void arraystf_IMPLEMENT(IDNAME _fsuffix,
TYPENAME object_t,
IDNAME nodename) ;
Adapts interface of arraystf_t to object type object_t.
#define arraystf_iterator_FREE { 0, 0, 0 }
Static initializer.
struct arraystf_iterator_t
Iterates over elements contained in arraystf_t.
struct arraystf_keyval_t
Describes the value of a key string at a certain memory offset.
struct arraystf_mwaybranch_t
Internal node to implement a multiway trie.
#define arraystf_node_EMBED(
   name_addr,
   name_size
) const uint8_t * name_addr ; size_t name_size
Allows to embed members of arraystf_node_t into another structure.
#define arraystf_node_INIT(length,
key) { .addr = key, .size = length }
Static initializer with parameter length in bytes and address of key.
#define arraystf_node_INIT_CSTR(
   cstr
) { .addr = (const uint8_t*)(cstr), .size = (sizeof(cstr)?sizeof(cstr)-1:0) }
Static initializer with parameter cstr referencing a “constant string”.
struct arraystf_node_t
Generic user node type stored by arraystf_t.
struct arraystf_t
Trie implementation to support arrays index with string keys.
int aserrcode_egl(int eglerr)
Converts value returned by eglerr_egl into a system/application specific error code.
#define assert(
   expr
) ((expr) ? (void) 0 : assertfail_maincontext(STR(expr), __FILE__, __LINE__, __FUNCTION__))
Prints »Assertion failed« and aborts process.
void assertfail_maincontext(const char *condition,
const char *file,
int line,
const char *funcname)
Exits the whole process in a controlled manner.
Defines system specific assert and standard static_assert.
#define assign_blockarray(
   barray,
   arrayindex,
   elemaddr
) (assign2_blockarray(barray, arrayindex, true, elemaddr))
Implements blockarray_t.assign_blockarray.
int assign_blockarray(blockarray_t *barray,
size_t arrayindex,
/*out*/void **elemaddr)
Assigns memory to an element at position arrayindex and returns its address in elemaddr.
int assign2_blockarray(blockarray_t *barray,
size_t arrayindex,
bool is_allocate,
/*out*/void **elemaddr)
Implements at_blockarray and assign_blockarray.
This cast reverses the type conversion.
struct arraysf_node_t * at_arraysf(const arraysf_t *array,
size_t pos)
Returns contained node at position pos.
struct arraystf_node_t * at_arraystf(const arraystf_t *array,
size_t size,
const uint8_t keydata[size])
Returns node with same key as *keydata*[size].
#define at_blockarray(
   barray,
   arrayindex
) ( __extension__ ({ void * elemaddr = 0 ; assign2_blockarray( (barray), (arrayindex), false, &elemaddr) ; elemaddr ; }))
Implements blockarray_t.at_blockarray.
void * at_blockarray(blockarray_t *barray,
size_t arrayindex)
Returns the memory address of element at position arrayindex.
void ** at_trie(trie_t *trie,
uint16_t keylen,
const uint8_t key[keylen])
TODO: describe During trie traversal two nodes are merged into one if this saves space.
#define atomicadd_int(i,
increment) (__sync_fetch_and_add((i), (increment)))
Implements int_t.atomicadd_int.
int atomicadd_int(int *i,
uint32_t increment)
Add increment to i and return old value atomically.
#define atomicclear_int(flag) (__sync_lock_release(flag))
Implements int_t.atomicclear_int.
void atomicclear_int(uint8_t *flag)
Sets flag to value 0.
Offers atomic operations for type integers.
Implements AtomicOps.
#define atomicread_int(i) (__sync_fetch_and_add((i), 0))
Implements int_t.atomicread_int.
int atomicread_int(int *i)
Reads last written value from memory location i.
#define atomicset_int(flag) (__sync_lock_test_and_set(flag, 1))
Implements int_t.atomicset_int.
int atomicset_int(uint8_t *flag)
Sets flag to value != 0 and returns previous value.
#define atomicsub_int(i,
decrement) (__sync_fetch_and_sub((i), (decrement)))
Implements int_t.atomicsub_int.
int atomicsub_int(int *i,
uint32_t decrement)
Sub decrement from i and return old value atomically.
#define atomicswap_int(i,
oldval,
newval) (__sync_val_compare_and_swap(i, oldval, newval))
Implements int_t.atomicswap_int.
int atomicswap_int(int *i,
int oldval,
int newval)
If *i is equal to oldval change it into newval atomically else do nothing.
#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 ; }))
Implements int_t.atomicwrite_int.
void atomicwrite_int(int *i,
int newval)
Writes newval into memory located at i.
int authenticate_sysuser(const char *username,
const char *password)
Checks that a certain user / password combination is valid.
static int authenticatecallback_sysuser(int num_msg,
const struct pam_message **msg,
struct pam_response **resp,
void *appdata_ptr)
Function called back from PAM library during authentication of user.
Close