Parameter of executed main_task function.
void * main_arg
Function executed after thread has been created.
thread_f main_task
The start function of the thread.
static void * main_thread( thread_startargument_t * startarg )
The main threads main function.
maincontext_thread_f main_thread
Implements thread_t.mainarg_thread.
#define mainarg_thread( threadobj ) ( __extension__ ({ volatile const thread_t * _thr ; _thr = (threadobj) ; _thr->main_arg ; }))
Reads thread_t.main_arg field of thread_t object.
void * mainarg_thread( const thread_t * threadobj )
Static initializer.
#define maincontext_startparam_INIT( context_type, argc, argv, main_thread ) { context_type, argc, argv, main_thread }
Start parameters used in initstart_maincontext.
struct maincontext_startparam_t
Defines size for s_maincontext_staticmem.
#define maincontext_STATICSIZE processcontext_STATICSIZE
Defines additonal size for s_maincontext_staticmem.
#define maincontext_STATICTESTSIZE ( maincontext_STATICSIZE )
Defines the main top level context of the whole process.
struct maincontext_t
Define maincontext_thread_f as signature of start function for main thread.
typedef int ( * maincontext_thread_f ) (maincontext_t * maincontext)
Function where execution should continue.
syncthread_f mainfct
Implements thread_t.maintask_thread.
#define maintask_thread( threadobj ) ( __extension__ ({ volatile const thread_t * _thr ; _thr = (threadobj) ; _thr->main_task ; }))
Returns thread_t.main_task.
thread_f maintask_thread( const thread_t * threadobj )
Signature of main thread is the same as function main.
typedef int ( * mainthread_f ) (void * user)
Creates directory with directory_path relative to dir.
int makedirectory_directory( directory_t * dir/*0 = > current working directory*/, const char * directory_path )
Creates a new file with file_path relative to dir.
int makefile_directory( directory_t * dir/*0 = > current working directory*/, const char * file_path, off_t file_length )
Returns power of 2 value of the argument or 0.
unsigned makepowerof2_int( unsigned i )
See mm_impl_t.malloc_mmimpl for an implementation.
int ( * malloc ) (struct mm_t * mman, size_t size, /*out*/struct memblock_t * memblock)
Holds maximum number of bytes of accepted malloc memory leak.
uint16_t malloc_acceptleak
Number of bytes resourceusage_t uses itself.
size_t malloc_correction
Implements mm_t.malloc_mm.
#define malloc_mm( mm, size, /*out*/memblock ) ((mm).iimpl->malloc((mm).object, (size), (memblock)))
Calls mm->iimpl->malloc with mm->object as first parameter.
int malloc_mm( mm_t mm, size_t size, /*out*/struct memblock_t * memblock )
Allocates new memory block.
int malloc_mmimpl( mm_impl_t * mman, size_t size, /*out*/struct memblock_t * memblock )
Allocates a new memory block.
int malloc_testmm( testmm_t * mman, size_t size, /*out*/struct memblock_t * memblock )
Number of memory bytes allocated by malloc.
size_t malloc_usage
Returns number of times and start addresses of suffixes which contain searchstr.
int matchall_suffixtree( suffixtree_t * tree, size_t length, const uint8_t searchstr[length], size_t skip_count, /*out*/size_t * matched_count, size_t maxmatchcount, /*out*/const uint8_t * matchedpos[maxmatchcount] )
Matches a string of bytes.
int matchbytes_utf8reader( utf8reader_t * utfread, size_t colnr, size_t nrbytes, const uint8_t bytes[nrbytes], /*err*/size_t * matchedsize )
The number of characters matched in node.
size_t matched_len
Returns the maximum character value (unicode code point) which can be encoded into utf-8.
char32_t maxchar_utf8( void )
The maximum nr of child pointer which could be stored in a trie_nodedata_t of size header_t.MAXSIZE.
#define MAXCHILD ( (MAXSIZE-offsetof(trie_nodedata_t, keylen)-sizeof(((trie_nodedata_t*)0)->uservalue)) / (sizeof(void*)+sizeof(uint8_t)) )
Max length (in bytes) of all added strings.
size_t maxlength
Determines the max size of the hash table.
uint8_t maxlevel
Returns the maximum supported signal number signalrt_t.
signalrt_t maxnr_signalrt( void )
Returns the maximum size of an off-screen pixel buffer.
int maxpbuffer_eglconfig( eglconfig_t eglconf, struct opengl_display_t * egldisp, /*out*/uint32_t * maxwidth, /*out*/uint32_t * maxheight, /*out*/uint32_t * maxpixels )
Implements gconfig_t.maxpbuffer_gconfig.
#define maxpbuffer_gconfig( gconf, display, maxwidth, maxheight, maxpixels ) maxpbuffer_eglconfig(gl_gconfig(gconf), gl_display(display), maxwidth, maxheight, maxpixels)
Returns the maximum size of an off-screen pixel buffer.
int maxpbuffer_gconfig( const gconfig_t * gconf, struct display_t * display, /*out*/uint32_t * maxwidth, /*out*/uint32_t * maxheight, /*out*/uint32_t * maxpixels )
#define MAXSIZE ( 64*sizeof(void*) )
Returns the maximum size in bytes of an utf-8 encoded multibyte sequence.
uint8_t maxsize_utf8( void )
Implements errorcontext_t.maxsyserrnum_errorcontext.
#define maxsyserrnum_errorcontext( ) (132)
Returns the number of system error entries.
uint16_t maxsyserrnum_errorcontext( void )
Imeplements typeadapt_member_t.memberasobject_typeadaptmember.
#define memberasobject_typeadaptmember( nodeadp, node ) memberasobject_typeadaptnodeoffset((nodeadp)->nodeoff, node)
See memberasobject_typeadaptnodeoffset.
struct typeadapt_object_t * memberasobject_typeadaptmember( typeadapt_member_t * nodeadp, void * node )
Implements typeadapt_nodeoffset_t.memberasobject_typeadaptnodeoffset.
#define memberasobject_typeadaptnodeoffset( nodeoff, node ) ( __extension__ ({ uint32_t _off = (nodeoff); (struct typeadapt_object_t*) ( (uintptr_t)(node) - _off ); }))
Converts a pointer to a struct member to the object which contains it.
struct typeadapt_object_t * memberasobject_typeadaptnodeoffset( const typeadapt_nodeoffset_t nodeoff, void * node )
Static initializer.
#define memblock_FREE { 0, 0 }
Static initializer.
#define memblock_INIT( size, addr ) { (addr), (size) }
Describes memory block.
struct memblock_t
Copies memory from source to destination.
#define MEMCOPY( destination, source ) do { static_assert(sizeof(*(destination)) == sizeof(*(source)),"same size") ; memcpy((destination), (source), sizeof(*(destination))) ; } while(0)
Sets memory of variable to 0.
#define MEMSET0( pointer ) memset((pointer), 0, sizeof(*(pointer)))
Static initializer.
#define memstream_FREE { 0, 0 }
Initializes memstream_t.
#define memstream_INIT( start, end ) { start, end }
Wraps a memory block which points to start and end address.
struct memstream_t
See mm_impl_t.mfree_mmimpl for an implementation.
int ( * mfree ) (struct mm_t * mman, struct memblock_t * memblock)
Implements mm_t.mfree_mm.
#define mfree_mm( mm, memblock ) ((mm).iimpl->mfree((mm).object, (memblock)))
Calls mm->iimpl->mfree with mm->object as first parameter.
int mfree_mm( mm_t mm, struct memblock_t * memblock )
Frees the memory of an allocated memory block.
int mfree_mmimpl( mm_impl_t * mman, struct memblock_t * memblock )
Frees the memory of an allocated memory block.
int mfree_testmm( testmm_t * mman, struct memblock_t * memblock )
Thread local memory manager.
iobj_DECLARE( , mm ) mm
Static initializer.
#define mm_FREE iobj_FREE
Adapts mm_it to mm_impl_t.
mm_it_DECLARE( mm_impl_it, mm_impl_t )
Default memory manager for allocating/freeing blocks of memory.
struct mm_impl_t
Static initializer.
#define mm_INIT( object, iimpl ) iobj_INIT(object, iimpl)
The function table describing the interface to a memory manager.
struct mm_it
Implements mm_it.mm_it_DECLARE.
#define mm_it_DECLARE( declared_it, memorymanager_t ) typedef struct declared_it declared_it ; struct declared_it { int (* malloc) (memorymanager_t * mman, size_t size, /*out*/struct memblock_t * memblock) ; int (* mresize) (memorymanager_t * mman, size_t newsize, struct memblock_t * memblock) ; int (* mfree) (memorymanager_t * mman, struct memblock_t * memblock) ; size_t (* sizeallocated) (memorymanager_t * mman) ; } ;
Declares an interface function table for accessing a memory manager service.
void mm_it_DECLARE( TYPENAME declared_it, TYPENAME memorymanager_t )
Static initializer.
#define mm_it_FREE { 0, 0, 0, 0 }
Static initializer.
#define mm_it_INIT( malloc_f, mresize_f, mfree_f, sizeallocated_f ) { (malloc_f), (mresize_f), (mfree_f), (sizeallocated_f) }
Inline implementation of maincontext_t.mm_maincontext.
#define mm_maincontext( ) (tcontext_maincontext()->mm)
Uses iobj_DECLARE to declare interfaceable object.
iobj_DECLARE( mm_t, mm )
Returns the installed testmm_t memory manager or 0.
testmm_t * mmcontext_testmm( void )
The buffered input of the file.
struct { uint8_t* addr ; size_t size ; } mmfile[2]
Static initializer for mmfile_t.
#define mmfile_FREE { 0, 0 }
Describes a memory mapped file.
struct mmfile_t
Static initializer.
#define mmimpl_FREE { 0 }
Number of bytes resourceusage_t uses itself.
size_t mmtrans_correction
Number of memory bytes allocated by mm_impl_t.
size_t mmtrans_usage
Implements bigint_t.mod_bigint.
#define mod_bigint( result, lbig, rbig ) (divmod_bigint(0, result, lbig, rbig))
Computes lbig modulo rbig.
int mod_bigint( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Internal implementation specific id.
uint16_t modeid
The name of the directory the loadable module binary blobs are stored.
#define module_DIRECTORY "bin/mod/"
Static initializer.
#define module_FREE { 0, 0 }
Describes the meory page where the program code is stored.
struct module_t
Grows an already mapped virtual memory block.
int movexpand_vmpage( vmpage_t * vmpage, size_t size_in_bytes )
See mm_impl_t.mresize_mmimpl for an implementation.
int ( * mresize ) (struct mm_t * mman, size_t newsize, struct memblock_t * memblock)
Implements mm_t.mresize_mm.
#define mresize_mm( mm, newsize, memblock ) ((mm).iimpl->mresize((mm).object, (newsize), (memblock)))
Calls mm->iimpl->mresize with mm->object as first parameter.
int mresize_mm( mm_t mm, size_t newsize, struct memblock_t * memblock )
Allocates new memory or resizes already allocated memory.
int mresize_mmimpl( mm_impl_t * mman, size_t newsize, struct memblock_t * memblock )
Allocates new or resizes already allocated memory block.
int mresize_testmm( testmm_t * mman, size_t newsize, struct memblock_t * memblock )
Multiplies two big integers and returns the result.
int mult_bigint( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Multiplies two numbers with the simple schoolbook algorithm.
static void mult_biginthelper( bigint_t * big, uint16_t lnrdigits, const uint32_t * ldigits, uint16_t rnrdigits, const uint32_t * rdigits, const uint16_t exponent )
Multiplies the two last parameters and returns the product in the first.
int mult_decimal( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec )
Multiplies two decimal numbers and returns the positive result.
static void mult_decimalhelper( decimal_t * dec, uint8_t lsize, const uint32_t * ldigits, uint8_t rsize, const uint32_t * rdigits, int16_t exponent )
Multiplies two big integer numbers and returns the positive result.
static int multsplit_biginthelper( bigint_t *restrict * result, uint16_t lnrdigits, const uint32_t * ldigits, uint16_t rnrdigits, const uint32_t * rdigits )
Multiplies two decimal numbers and returns the positive result.
static int multsplit_decimalhelper( decimal_t * restrict * result, uint8_t lsize, const uint32_t * ldigits, uint8_t rsize, const uint32_t * rdigits )
Multiplies the big integer with a 32 bit unsigned int.
int multui32_bigint( bigint_t *restrict * result, const bigint_t * lbig, const uint32_t factor )
Static initializer for mutex_t without error checking.
#define mutex_INIT_DEFAULT sys_mutex_INIT_DEFAULT
Implements a mutual exclusion lock.
typedef sys_mutex_t mutex_t