The identification of an object.
uint32_t id
Used internally to map an id to an object pointer.
struct x11windowmap_t * idmap
It’s a marker in a function declaration.
#define IDNAME void*
A pointer to the implementation of the interface iobj_it.
iobj_it * iimpl
The pointer to callback function iocallback_f.
iocallback_f iimpl
Pointer to interface implementing memory allocation strategy.
const wbuffer_it * iimpl
Points to wrapped object or a static allocated buffer.
void * impl
Implements textpos_t.incrcolumn_textpos.
#define incrcolumn_textpos( txtpos ) ((void)(++(txtpos)->column))
Increments the column number.
void incrcolumn_textpos( textpos_t * txtpos )
Implements textpos_t.incrline_textpos.
#define incrline_textpos( txtpos ) do { textpos_t * _tpos = (txtpos) ; _tpos->prevlastcolumn = _tpos->column ; _tpos->column = 0 ; ++ _tpos->line ; } while (0)
Increments the line number.
void incrline_textpos( textpos_t * txtpos )
Implements arraysf_mwaybranch_t.init_arraysfmwaybranch.
#define init_arraysfmwaybranch( branch, _shift, pos1, childnode1, pos2, childnode2 ) do { memset((branch)->child, 0, sizeof((branch)->child)) ; (branch)->child[0x03u & ((pos1) >> (_shift))] = childnode1 ; (branch)->child[0x03u & ((pos2) >> (_shift))] = childnode2 ; (branch)->shift = (uint8_t) _shift ; (branch)->used = 2 ; } while(0)
Initializes a new branch node.
void init_arraysfmwaybranch( /*out*/arraysf_mwaybranch_t * branch, unsigned shift, size_t pos1, arraysf_unode_t * childnode1, size_t pos2, arraysf_unode_t * childnode2 )
Loads next key data byte at offset from node into keyval.
static void init_arraystfkeyval( /*out*/arraystf_keyval_t * keyval, size_t offset, arraystf_node_t * node )
Implements arraystf_mwaybranch_t.init_arraystfmwaybranch.
#define init_arraystfmwaybranch( branch, _offset, _shift, data1, childnode1, data2, childnode2 ) do { memset((branch)->child, 0, sizeof((branch)->child)) ; (branch)->child[0x03u & ((data1) >> (_shift))] = childnode1 ; (branch)->child[0x03u & ((data2) >> (_shift))] = childnode2 ; (branch)->offset = _offset ; (branch)->shift = (uint8_t) _shift ; (branch)->used = 2 ; } while(0)
Initializes a new branch node.
void init_arraystfmwaybranch( /*out*/arraystf_mwaybranch_t * branch, size_t offset, unsigned shift, size_t data1, arraystf_unode_t * childnode1, size_t data2, arraystf_unode_t * childnode2 )
Initializes stack object and reserves at least preallocate_size bytes.
int init_binarystack( /*out*/binarystack_t * stack, uint32_t preallocate_size )
Initializes barray to use blocks of memory of size pagesize (see pagesize_e).
int init_blockarray( /*out*/blockarray_t * barray, uint8_t pagesize, uint16_t elementsize )
Inits convert_wchar_t with a pointer to a mbs string.
extern int init_convertwchar( /*out*/convert_wchar_t * conv, size_t input_len, const char * input_string )
Initializes object of type crc32_t.
void init_crc32( /*out*/crc32_t * crc )
Inits cstring_t and preallocates memory.
int init_cstring( /*out*/cstring_t * cstr, size_t preallocate_size )
Opens file and reads all contained values.
int init_csvfilereader( /*out*/csvfilereader_t * csvfile, const char * filepath )
Implements dlist_t.init_dlist.
#define init_dlist( list ) ((void)(*(list) = (dlist_t)dlist_INIT))
Initializes a dlist_t object.
void init_dlist( /*out*/dlist_t * list )
Returns a configuration which matches the given attributes.
int init_eglconfig( /*out*/eglconfig_t * eglconf, struct opengl_display_t * egldisp, const int32_t config_attributes[] )
Initializes eglcont with a graphic context.
int init_eglcontext( /*out*/eglcontext_t * eglcont, struct opengl_display_t * egldisp, struct opengl_config_t * eglconf, uint8_t api )
Allocates a pixel buffer with size (width, height) in pixels and returns it in eglpbuf.
int init_eglpbuffer( /*out*/eglpbuffer_t * eglpbuf, struct opengl_display_t * egldisp, struct opengl_config_t * eglconf, uint32_t width, uint32_t height )
Initializes errcontext with static system error string table.
int init_errorcontext( /*out*/errorcontext_t * errcontext )
Allocates a hash table of at least size 1.
int init_exthash( /*out*/exthash_t * htable, size_t initial_size, size_t max_size, const typeadapt_member_t * nodeadp )
Opens a file identified by its path and name.
int init_file( /*out*/file_t * fileobj, const char * filepath, accessmode_e iomode, const struct directory_t * relative_to/*0 = > current working dir*/ )
Initializes fpath with the path of working directory workdir and filename.
void init_filepathstatic( /*out*/filepath_static_t * fpath, const struct directory_t * workdir, const char * filename )
Opens file for reading into a double buffer.
int init_filereader( /*out*/filereader_t * frd, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Returns an OpenGL surface configuration for display.
int init_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[] )
Creates a new native OpenGL graphic context.
int init_gcontext( /*out*/gcontext_t * cont, struct display_t * disp, struct gconfig_t * gconf, uint8_t api )
Initializes the OpenGL part of win in an OS specific way.
#define INIT_GLWINDOW( win, disp, gconf ) initx11_eglwindow(&gl_window(win), gl_display(disp), gl_gconfig(gconf), &win->oswindow)
Initialize initentry with mainfct and initarg.
static inline void init_initqueueentry( initqueue_entry_t * initentry, syncrun_f mainfct, void * initarg )
Implements iobj_t.init_iobj.
#define init_iobj( iobj, _object, _iimpl ) do { typeof(iobj) _obj = (iobj) ; _obj->object = (_object) ; _obj->iimpl = (_iimpl) ; } while (0)
Generic initialization.
void init_iobj( /*out*/iobj_t * iobj, void * object, void * iimpl )
Creates epoll event notification facility.
int init_iopoll( /*out*/iopoll_t * iopoll )
Creates system specific event queue to query for io events (ioevent_t).
int init_iopoll( /*out*/iopoll_t * iopoll )
Creates a new unconnected UDP network communication endpoint.
int init_ipsocket( /*out*/ipsocket_t * ipsock, const struct ipaddr_t * localaddr )
Initializes object.
int init_logbuffer( /*out*/logbuffer_t * logbuf, uint32_t buffer_size, uint8_t buffer_addr[buffer_size], sys_iochannel_t io )
Allocates memory for the structure and initializes all variables to default values.
int init_logwriter( /*out*/logwriter_t * lgwrt )
Initializes global program context.
int init_maincontext( const maincontext_e context_type, int argc, const char ** argv )
Opens a new file and maps it to memory.
int init_mmfile( /*out*/mmfile_t * mfile, const char * file_path, off_t file_offset, size_t size, accessmode_e mode, const struct directory_t * relative_to /*0 = >current_working_directory*/ )
Initializes a new memory manager.
int init_mmimpl( /*out*/mm_impl_t * mman )
Maps a file as binary executable into memory whose filename is modulename.
int init_module( /*out*/module_t * mod, const char * modulename )
Implement mutex_t.init_mutex as a no op if !defined(KONFIG_SUBSYS_THREAD)
#define init_mutex( mutex ) (0)
Initializer for a mutex with error checking.
int init_mutex( /*out*/mutex_t * mutex )
Inits objectcache_impl_t and all contained objects.
int init_objectcacheimpl( /*out*/objectcache_impl_t * objectcache )
Initializes the OpenGL part of the graphic display in an OS specific way.
#define INIT_OPENGL( disp ) initx11_egldisplay(&(disp)->gldisplay, &(disp)->osdisplay)
Initializes the graphic display in an OS specific way.
#define INIT_OSDISPLAY( disp, display_selector ) (s_display_noext ? init2_x11display(&(disp)->osdisplay, display_selector, false) : init_x11display(&(disp)->osdisplay, display_selector))
Initializes the native window oswindow in an OS specific way.
#define INIT_OSWINDOW( oswindow, disp, screennr, eventhandler, visualid, winattr ) initvid_x11window(oswindow, os_display(disp), screennr, genericcast_x11windowevh(eventhandler, window_t), (uint32_t)visualid, winattr)
Allocates a shared hash table of size pagecache_blockmap_FREE.
int init_pagecacheblockmap( /*out*/pagecache_blockmap_t * blockmap )
Preallocates at least 1MB of memory and initializes pgcache.
int init_pagecacheimpl( /*out*/pagecache_impl_t * pgcache )
Implements patriciatrie_t.init_patriciatrie.
#define init_patriciatrie( tree, nodeadp ) ((void)(*(tree) = (patriciatrie_t) patriciatrie_INIT(0, *(nodeadp))))
Inits an empty tree object.
void init_patriciatrie( /*out*/patriciatrie_t * tree, const typeadapt_member_t * nodeadp )
Creates a new native OpenGL off-screen pixel buffer.
int init_pixelbuffer( /*out*/pixelbuffer_t * pbuf, struct display_t * disp, struct gconfig_t * gconf, uint32_t width, uint32_t height )
Initialize system context and calls main_thread.
int init_platform( mainthread_f main_thread, void * user )
Creates child process which executes a function.
int init_process( /*out*/process_t * process, process_task_f child_main, void * start_arg, process_stdio_t * stdfd )
Initializes the current process context.
int init_processcontext( /*out*/processcontext_t * pcontext )
Initializes process_stdfd2_t with process_stdio_t and opens devnull.
static int init_processstdio2( /*out*/process_stdfd2_t * stdfd2, process_stdio_t * stdfd )
Implements queue_t.init_queue.
#define init_queue( queue ) (*(queue) = (queue_t) queue_INIT, 0)
Sets al fields to 0.
int init_queue( /*out*/queue_t * queue )
Implements redblacktree_t.init_redblacktree.
#define init_redblacktree( tree, nodeadp ) ((void)(*(tree) = (redblacktree_t) redblacktree_INIT(0, *(nodeadp))))
Inits an empty tree object.
int init_redblacktree( /*out*/redblacktree_t * tree, const typeadapt_member_t * nodeadp )
Stores the number of resources currently in use.
int init_resourceusage( /*out*/resourceusage_t * usage )
Initializes runentry with thread and exitevent.
static inline void init_run2queueentry( /*out*/run2queue_entry_t * runentry, syncthread_t * thread, syncevent_t * exitevent )
Initializes runentry with thread.
static inline void init_runqueueentry( /*out*/runqueue_entry_t * runentry, const syncthread_t * thread )
Implements rwlock_t.init_rwlock.
#define init_rwlock( rwlock ) ((void)(*(rwlock) = (rwlock_t) rwlock_INIT))
Initializes data members.
void init_rwlock( /*out*/rwlock_t * rwlock )
Initializes a semaphore.
int init_semaphore( /*out*/semaphore_t * semaobj, uint16_t init_signal_count )
Inits internal fields to start values.
void init_sha1hash( /*out*/sha1_hash_t * sha1 )
Implements slist_t.init_slist.
#define init_slist( list ) ((void)(*(list) = (slist_t)slist_INIT))
Initializes a single linked list object.
void init_slist( /*out*/slist_t * list )
Implements splaytree_t.init_splaytree.
#define init_splaytree( tree ) ((void)(*(tree) = (splaytree_t) splaytree_INIT(0)))
Inits an empty tree object.
void init_splaytree( /*out*/splaytree_t * tree )
Initializes a staticpage_t as head of page and returns a pointer to it.
static inline void init_staticpage( staticpage_t ** staticpage, memblock_t * page )
Implements string_t.init_string.
static inline void init_string( /*out*/string_t * str, size_t size, const uint8_t string[size] )
Assigns constant string buffer to str.
static inline void init_string( /*out*/string_t * str, size_t size, const uint8_t string[size] )
Initializes stringstream with start and end address.
int init_stringstream( /*out*/stringstream_t * strstream, const uint8_t * startaddr, const uint8_t * endaddr )
Implements syncqueue_t.init_syncqueue.
#define init_syncqueue( syncqueue ) ((void)(*(syncqueue) = (syncqueue_t) syncqueue_INIT))
Initializes syncqueue.
void init_syncqueue( /*out*/syncqueue_t * syncqueue )
Initializes a set of queues.
int init_syncrun( /*out*/syncrun_t * srun )
Implements syncthread_t.init_syncthread.
#define init_syncthread( sthread, mainfct, state ) ((void)(*(sthread) = (syncthread_t) syncthread_INIT(mainfct, state)))
Initializes sthread with { mainfct, state } .
void init_syncthread( /*out*/syncthread_t * sthread, syncthread_f mainfct, void * state )
Implements syncwait_t.init_syncwait.
#define init_syncwait( syncwait, thread, _event, continuelabel ) do { typeof(syncwait) _sw = (syncwait) ; *_sw = (syncwait_t) { *(thread), (_event), (continuelabel) } ; _sw->event->waiting = _sw ; } while(0)
Initializes syncwait and registers itself at event.
void init_syncwait( /*out*/syncwait_t * syncwait, const syncthread_t * thread, syncevent_t * event, void * continuelabel )
The double linked list dlist_t will not be stored.
void init_syncwlist( /*out*/syncwlist_t * wlist )
Initializes wlist to an empty list.
void init_syncwlist( /*out*/syncwlist_t * wlist )
Allocates a new system timer.
int init_systimer( /*out*/systimer_t * timer, sysclock_e clock_type )
Implement sysuser_t.init_sysuser as noop if !defined(KONFIG_SUBSYS_SYSUSER)
#define init_sysuser( sysuser ) ((*(sysuser)) = (sysuser_t) sysuser_FREE, 0)
Initializes system user of process at process start.
int init_sysuser( /*out*/sysuser_t * sysusr )
Implements test_errortimer_t.init_testerrortimer.
#define init_testerrortimer( errtimer, timercount, errcode ) ((void) (*(errtimer) = (test_errortimer_t){ timercount, errcode }))
Inits errtimer with timercount and errcode.
void init_testerrortimer( /*out*/test_errortimer_t * errtimer, uint32_t timercount, int errcode )
Initializes a new test memory manager.
int init_testmm( /*out*/testmm_t * mman )
Implements textpos_t.init_textpos.
#define init_textpos( txtpos, colnr, linenr ) ((void)(*(txtpos) = (textpos_t) { colnr, linenr, 0 }))
Sets column and line numbers to arbitrary values.
void init_textpos( /*out*/textpos_t * txtpos, size_t colnr, size_t linenr )
Initializes textresource_t object.
static int init_textresource( /*out*/textresource_t * textres, const char * read_from_filename )
Opens file and reads header for the version information.
static int init_textresourcereader( /*out*/textresource_reader_t * reader, const char * filename )
Creates all top level services which are bound to a single thread.
int init_threadcontext( /*out*/threadcontext_t * tcontext, struct processcontext_t * pcontext, uint8_t context_type )
Allocates a memory block big enoug to hold all thread local storage data.
int init_threadtls( /*out*/thread_tls_t * tls )
Implements thrmutex_t.init_thrmutex.
#define init_thrmutex( mutex ) ((void)(*(mutex) = (thrmutex_t) thrmutex_INIT))
Sets mutex to thrmutex_INIT.
void init_thrmutex( /*out*/thrmutex_t * mutex )
Implements trie_t.init_trie.
#define init_trie( trie ) (*(trie) = (trie_t) trie_INIT, 0)
Initializes trie with 0 pointer.
int init_trie( /*out*/trie_t * trie )
Initializes offsets from prefixlen, optional uservalue, and number of child pointers nrchild.
static void init_trienodeoffsets( /*out*/trie_nodeoffsets_t * offsets, uint16_t prefixlen, bool isuservalue, const uint16_t nrchild )
Initializes implementation to support objectes of size objectsize.
int init_typeadaptimpl( /*out*/typeadapt_impl_t * typeadp, size_t objectsize )
Implements typeadapt_nodeoffset_t.init_typeadaptnodeoffset.
#define init_typeadaptnodeoffset( nodeoff, nodeoffset ) ((void) (*(nodeoff) = nodeoffset))
Inits typeadapt_nodeoffset_t structure with offset to struct member.
void init_typeadaptnodeoffset( /*out*/typeadapt_nodeoffset_t * nodeoff, uint16_t nodeoffset )
Opens file at filepath for reading as UTF-8 encoded text.
int init_utf8reader( /*out*/utf8reader_t * utfread, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Sets all data members to 0.
int init_utf8scanner( /*out*/utf8scanner_t * scan )
Implements utf8validator_t.init_utf8validator.
#define init_utf8validator( utf8validator ) ((void)(*(utf8validator) = (utf8validator_t) utf8validator_INIT))
Same as assigning utf8validator_INIT.
void init_utf8validator( /*out*/utf8validator_t * utf8validator )
Sets values of valuecache.
int init_valuecache( /*out*/valuecache_t * valuecache )
Returns in mappedregions the descriptions of all current virtual memory mappings.
int init_vmmappedregions( /*out*/vm_mappedregions_t * mappedregions )
Implements vmpage_t.init_vmpage.
#define init_vmpage( vmpage, size_in_bytes ) (init2_vmpage((vmpage), (size_in_bytes), accessmode_RDWR|accessmode_PRIVATE))
Map memory into the virtual address space of the calling process.
int init_vmpage( /*out*/vmpage_t * vmpage, size_t size_in_bytes )
Initializes waitentry with thread and exitevent and uses srun->waitinfo to read the event and the continuelabel.
static inline void init_wait2queueentry( /*out*/wait2queue_entry_t * waitentry, syncrun_t * srun, syncthread_t * thread, syncevent_t * exitevent )
Inits a waiting list.
int init_waitlist( /*out*/waitlist_t * wlist )
Initializes waitentry with thread and uses srun->waitinfo to read the event and the continuelabel.
static inline void init_waitqueueentry( /*out*/waitqueue_entry_t * waitentry, syncrun_t * srun, syncthread_t * thread )
Creates a new native window and its OpenGL extension/wrapper type.
int init_window( /*out*/window_t * win, struct display_t * disp, uint32_t screennr, const struct window_evh_t * eventhandler, struct gconfig_t * gconf, struct windowconfig_t * winattr )
Tries to allocate a double buffer associated with window.
int init_x11dblbuffer( /*out*/x11dblbuffer_t * dblbuf, struct x11window_t * x11win )
Connects to a X11 display server and returns the newly created connection.
int init_x11display( /*out*/x11display_t * x11disp, const char * display_server_name )
Initializes x11screen_t with reference to x11display_t and screen number.
int init_x11screen( /*out*/x11screen_t * x11screen, struct x11display_t * display, uint32_t nrscreen )
Returns an iterator to a list of all video modes supported by x11screen_t.
int init_x11videomodeiterator( /*out*/x11videomode_iterator_t * xvidit, struct x11screen_t * x11screen )
Create a native X11 window on x11screen and assign it to x11win.
int init_x11window( /*out*/x11window_t * x11win, struct x11display_t * x11disp, uint32_t screennr, const struct x11window_evh_t * eventhandler, const int32_t * gconf_attrib, const struct windowconfig_t * winconf_attrib )
Initialize initentry with mainfct and initarg and initargsize.
static inline void init2_initqueueentry( initqueue_entry_t * initentry, syncrun_f mainfct, uint8_t initargsize )
Map memory into the virtual address space of the calling process.
int init2_vmpage( /*out*/vmpage_t * vmpage, size_t size_in_bytes, const accessmode_e access_mode )
Same as init_x11display but allows to not initialize any X11 extension.
int init2_x11display( /*out*/x11display_t * x11disp, const char * display_server_name, bool isInitExtension )
Waits for an incoming connection request from a peer (client).
int initaccept_ipsocket( /*out*/ipsocket_t * ipsock, ipsocket_t * listensock, struct ipaddr_t * remoteaddr/*0 = > ignored*/ )
Map new memory into the virtual address space of the calling process.
int initaligned_vmpage( /*out*/vmpage_t * vmpage, size_t powerof2_size_in_bytes )
Inits ipaddr_storage_t as an ip addr of type ipaddr_t with given ipversion_e.
ipaddr_t * initany_ipaddrstorage( ipaddr_storage_t * addr, ipprotocol_e protocol, ipport_t port, ipversion_e version )
Opens or creates a file to append only.
int initappend_file( /*out*/file_t * fileobj, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Calls init_testmm and wraps object into interface object mm_t.
int initasmm_testmm( /*out*/struct mm_t * testmm )
Creates a connected network communication endpoint.
int initconnect_ipsocket( /*out*/ipsocket_t * ipsock, const struct ipaddr_t * remoteaddr, const struct ipaddr_t * localaddr/*0 = newany_ipaddr*/ )
Same as initconnect_ipsocket except for async operation.
int initconnect_ipsocketasync( /*out*/ipsocket_async_t * ipsockasync, const struct ipaddr_t * remoteaddr, const struct ipaddr_t * localaddr )
Copies state from source to dest.
extern int initcopy_convertwchar( /*out*/convert_wchar_t * restrict dest, const convert_wchar_t * restrict source )
Implements iobj_t.initcopy_iobj.
#define initcopy_iobj( destiobj, srciobj ) do { typeof(srciobj) _src = (srciobj) ; typeof(destiobj) _dest = (destiobj) ; _dest->object = _src->object ; _dest->iimpl = _src->iimpl ; } while (0)
Generic initialization.
void initcopy_iobj( /*out*/iobj_t * destiobj, const iobj_t * srciobj )
Makes ioc a duplicate of from_ioc.
int initcopy_iochannel( /*out*/iochannel_t * ioc, iochannel_t from_ioc )
Implements string_t.initcopy_string.
static inline void initcopy_string( /*out*/string_t * str, const string_t * restrict srcstr )
Copies content of srcstr to str.
static inline void initcopy_string( /*out*/string_t * str, const string_t * restrict srcstr )
Counts the number of successfull initialized services/subsystems.
uint16_t initcount
Number of correct initialized objects.
size_t initcount
Creates a file identified by its path and name.
int initcreate_file( /*out*/file_t * fileobj, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Returns the current active video mode of the default screen.
int initcurrent_x11videomode( /*out*/x11videomode_t * current_xvidmode, struct x11screen_t * x11screen )
Init offsets from decoded information stored in header.
static int initdecode_trienodeoffsets( /*out*/trie_nodeoffsets_t * offsets, const trie_nodedata_t * data )
Initializes disp with a connection to the default display.
int initdefault_display( /*out*/display_t * disp )
Initializes egldisp with the default display connection.
int initdefault_egldisplay( /*out*/egldisplay_t * egldisp )
Searches the first position where the two keys differ.
static int initdiff_arraystfkeyval( /*out*/arraystf_keyval_t * keyval, arraystf_node_t * node, arraystf_node_t * key )
Implements string_field_t.initdouble_stringfield.
#define initdouble_stringfield( strfield, dval ) ( __extension__ ({ (strfield)->type = string_field_DOUBLE ; (strfield)->val.d = dval ; 0 ; }))
Inits string_field_t describing a double value.
int initdouble_stringfield( /*out*/string_field_t * strfield, double dval )
Executes another program with same environment.
int initexec_process( /*out*/process_t * process, const char * filename, const char * const * arguments, process_stdio_t * stdfd /*0 = > /dev/null*/ )
Opens file for reading.
static int initfile_filereader( /*out*/file_t * fd, /*out*/off_t * filesize, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Same as init_eglconfig except that more than one possible configuration is considered.
int initfiltered_eglconfig( /*out*/eglconfig_t * eglconf, struct opengl_display_t * egldisp, const int32_t config_attributes[], eglconfig_filter_f filter, void * user )
Same as init_gconfig except that more than one possible configuration is considered.
int initfiltered_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[], gconfig_filter_t * filter )
Initializes an iterator for arraysf_t.
int initfirst_arraysfiterator( /*out*/arraysf_iterator_t * iter, arraysf_t * array )
Initializes an iterator for an arraystf_t.
int initfirst_arraystfiterator( /*out*/arraystf_iterator_t * iter, arraystf_t * array )
Implements dlist_iterator_t.initfirst_dlistiterator.
#define initfirst_dlistiterator( iter, list ) ( __extension__ ({ typeof(iter) _iter = (iter) ; typeof(list) _list = (list) ; *_iter = (typeof(*_iter)) { first_dlist(_list), _list } ; 0 ; }))
Initializes an iterator for dlist_t.
int initfirst_dlistiterator( /*out*/dlist_iterator_t * iter, dlist_t * list )
Initializes an iterator for exthash_t.
int initfirst_exthashiterator( /*out*/exthash_iterator_t * iter, exthash_t * htable )
Initializes an iterator for patriciatrie_t.
int initfirst_patriciatrieiterator( /*out*/patriciatrie_iterator_t * iter, patriciatrie_t * tree )
Initializes an iterator for patriciatrie_t for nodes with prefix prefixkey.
int initfirst_patriciatrieprefixiter( /*out*/patriciatrie_prefixiter_t * iter, patriciatrie_t * tree, size_t keylength, const uint8_t prefixkey[keylength] )
Implements queue_iterator_t.initfirst_queueiterator.
#define initfirst_queueiterator( iter, queue, nodesize ) ( __extension__ ({ typeof(iter) _it = (iter) ; typeof(queue) _qu = (queue) ; uint16_t _ns = (nodesize) ; if (_qu->last && _ns) { *_it = (typeof(*_it)) { (queue_page_t*) _qu->last, (queue_page_t*)((queue_page_t*) _qu->last)->next, ((queue_page_t*)((queue_page_t*) _qu->last)->next)->start_offset, ((queue_page_t*)((queue_page_t*) _qu->last)->next)->end_offset, _ns } ; } else { *_it = (typeof(*_it)) { 0, 0, 0, 0, 1 } ; } 0 ; }))
Initializes an iterator for queue_t.
int initfirst_queueiterator( /*out*/queue_iterator_t * iter, queue_t * queue, uint16_t nodesize )
Initializes an iterator for redblacktree_t.
int initfirst_redblacktreeiterator( /*out*/redblacktree_iterator_t * iter, redblacktree_t * tree )
Implements slist_t.initfirst_slistiterator.
#define initfirst_slistiterator( iter, list ) ( __extension__ ({ typeof(iter) _iter = (iter) ; typeof(list) _list = (list) ; *_iter = (typeof(*_iter)) { first_slist(_list), _list } ; 0 ; }))
Initializes an iterator for slist_t.
int initfirst_slistiterator( /*out*/slist_iterator_t * iter, slist_t * list )
Initializes an iterator for splaytree_t.
int initfirst_splaytreeiterator( /*out*/splaytree_iterator_t * iter, splaytree_t * tree, uint16_t nodeoffset, typeadapt_t * typeadp )
Initializes an iterator for syncwlist_t.
int initfirst_syncwlistiterator( /*out*/syncwlist_iterator_t * iter, syncwlist_t * wlist )
Assigns static string buffer to str.
int initfl_string( /*out*/string_t * str, const uint8_t * first, const uint8_t * last )
Implements string_field_t.initfloat_stringfield.
#define initfloat_stringfield( strfield, fval ) ( __extension__ ({ (strfield)->type = string_field_FLOAT ; (strfield)->val.f = fval ; 0 ; }))
Inits string_field_t describing a float value.
int initfloat_stringfield( /*out*/string_field_t * strfield, float fval )
Returns a configuration with ID id.
int initfromconfigid_eglconfig( /*out*/eglconfig_t * eglconf, struct opengl_display_t * egldisp, const uint32_t id )
Returns an OpenGL surface configuration whose ID matches configid.
int initfromconfigid_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const uint32_t configid )
Maps a file referenced by sys_iochannel_t into memory.
int initfromio_mmfile( /*out*/mmfile_t * mfile, sys_iochannel_t fd, off_t file_offset, size_t size, accessmode_e mode )
Inits cstring_t and copies data from string_t.
int initfromstring_cstring( /*out*/cstring_t * cstr, const struct string_t * copiedfrom )
Initializes stringstream from string_t.
int initfromstring_string( /*out*/stringstream_t * strstream, const struct string_t * str )
Initializes str with content of stringstream_t.
void initfromstringstream_string( /*out*/string_t * str, const struct stringstream_t * strstream )
Implements x11videomode_t.initfromvalues_x11videomode.
#define initfromvalues_x11videomode( xvidmode, width_in_pixel, height_in_pixel, modeid ) ((void)(*(xvidmode) = (x11videomode_t) { width_in_pixel, height_in_pixel, modeid }))
Initializes xvidmode with the parameter values.
void initfromvalues_x11videomode( /*out*/x11videomode_t * xvidmode, uint32_t width_in_pixel, uint32_t height_in_pixel, uint16_t modeid )
Implements process_t.initgeneric_process.
#define initgeneric_process( process, child_main, start_arg, stdfd ) ( __extension__ ({ int (*_child_main) (typeof(start_arg)) ; _child_main = (child_main) ; static_assert( sizeof(start_arg) == sizeof(void*), "same as void*" ) ; init_process( process, (process_task_f) _child_main, (void*)start_arg, stdfd ) ; }))
Same as init_process except that it accepts functions with generic argument type.
int initgeneric_process( /*out*/process_t * process, process_task_f child_main, void * start_arg, process_stdio_t * stdfd )
Initializes iobj.
#define INITIOBJ( module, objtype_t, iobj ) int err ; memblock_t memobject = memblock_FREE ; if (! interface_##module()) { keep static object return 0 ; } ONERROR_testerrortimer( &s_threadcontext_errtimer, &err, ONABORT); err = ALLOCSTATIC_PAGECACHE( sizeof(objtype_t), &memobject) ; if (err) goto ONABORT ; objtype_t * newobj ; newobj = (objtype_t*) memobject.addr ; ONERROR_testerrortimer( &s_threadcontext_errtimer, &err, ONABORT); err = init_##module(newobj) ; if (err) goto ONABORT ; init_iobj(&(iobj), (void*)newobj, interface_##module()) ; return 0 ; ONABORT: FREESTATIC_PAGECACHE(&memobject) ; return err ;
Implements dlist_iterator_t.initlast_dlistiterator.
#define initlast_dlistiterator( iter, list ) ( __extension__ ({ typeof(iter) _iter = (iter) ; typeof(list) _list = (list) ; *_iter = (typeof(*_iter)) { last_dlist(_list), _list } ; 0 ; }))
Initializes an iterator for dlist_t.
int initlast_dlistiterator( /*out*/dlist_iterator_t * iter, dlist_t * list )
Initializes an iterator of patriciatrie_t.
int initlast_patriciatrieiterator( /*out*/patriciatrie_iterator_t * iter, patriciatrie_t * tree )
Initializes an iterator of redblacktree_t.
int initlast_redblacktreeiterator( /*out*/redblacktree_iterator_t * iter, redblacktree_t * tree )
Initializes an iterator of splaytree_t.
int initlast_splaytreeiterator( /*out*/splaytree_iterator_t * iter, splaytree_t * tree, uint16_t nodeoffset, typeadapt_t * typeadp )
Creates a TCP server socket for accepting connections from peers (clients).
int initlisten_ipsocket( /*out*/ipsocket_t * ipsock, const struct ipaddr_t * localaddr, uint16_t max_outstanding_connections )
Initializes main thread.
int initmain_thread( /*out*/thread_t * thread )
Same as init_threadtls but calls no other functions of C-kern system.
int initmain_threadtls( /*out*/thread_tls_t * tls, /*out*/struct memblock_t * threadstack, /*out*/struct memblock_t * signalstack )
Implements cstring_t.initmove_cstring.
#define initmove_cstring( dest, source ) do { *(dest) = *(source) ; *(source) = (cstring_t) cstring_FREE ; } while(0)
Inits dest with content of source and sets source to cstring_FREE.
void initmove_cstring( /*out*/cstring_t * restrict dest, cstring_t * restrict source )
Implements file_t.initmove_file.
static inline void initmove_file( file_t * restrict destfile, file_t * restrict sourcefile )
Moves content of sourcefile to destfile.
static inline void initmove_file( /*out*/file_t * restrict destfile, file_t * restrict sourcefile )
Implements mmfile_t.initmove_mmfile.
#define initmove_mmfile( destmfile, sourcemfile ) do { mmfile_t * _sourcemfile = (sourcemfile); *(destmfile) = *(_sourcemfile); *(_sourcemfile) = (mmfile_t) mmfile_FREE; } while (0)
Moves content of sourcemfile to destmfile.
void initmove_mmfile( /*out*/mmfile_t * restrict destmfile, mmfile_t * restrict sourcemfile )
Moves the object to another memory address.
void initmove_queue( /*out*/queue_t * dest, queue_t * src )
Initializes dest with src.
static inline void initmove_run2queueentry( /*out*/run2queue_entry_t * dest, run2queue_entry_t * src )
Initializes dest with src.
static inline void initmove_runqueueentry( /*out*/runqueue_entry_t * dest, runqueue_entry_t * src )
Implements syncevent_t.initmove_syncevent.
#define initmove_syncevent( destsyncevent, srcsyncevent ) do { typeof(destsyncevent) _dest = (destsyncevent) ; *_dest = *(srcsyncevent) ; _dest->waiting->event = _dest ; } while(0)
Moves initialized srcsyncevent to destsyncevent.
void initmove_syncevent( /*out*/syncevent_t * destsyncevent, const syncevent_t * srcsyncevent )
Implements syncwait_t.initmove_syncwait.
#define initmove_syncwait( destsyncwait, srcsyncwait ) do { typeof(destsyncwait) _dest = (destsyncwait) ; *_dest = *(srcsyncwait) ; _dest->event->waiting = _dest ; } while(0)
Moves initialized (!)
void initmove_syncwait( /*out*/syncwait_t * destsyncwait, const syncwait_t * srcsyncwait )
Initializes destwlist with content of scrwlist and clears srcwlist.
void initmove_syncwlist( /*out*/syncwlist_t * destwlist, syncwlist_t * srcwlist )
Moves content of initialized src to dest.
static inline void initmove_wait2queueentry( /*out*/wait2queue_entry_t * dest, wait2queue_entry_t * src )
Moves content of initialized src to dest.
static inline void initmove_waitqueueentry( /*out*/waitqueue_entry_t * dest, waitqueue_entry_t * src )
Moves src to dest.
void initmove_wlistentry( /*out*/wlistentry_t * dest, wlistentry_t * src )
Must be called if address of x11display_t changes.
int initmove_x11display( /*out*/x11display_t * destination, x11display_t * source )
Must be called if address of x11window_t changes.
int initmove_x11window( /*out*/x11window_t * dest_x11win, x11window_t * src_x11win )
Implements syncwait_t.initmovesafe_syncevent.
#define initmovesafe_syncevent( destsyncevent, srcsyncevent ) do { typeof(destsyncevent) _dest = (destsyncevent) ; *_dest = *(srcsyncevent) ; if (_dest->waiting) { _dest->waiting->event = _dest ; } } while(0)
Moves initialized or free srcsyncevent to destsyncevent.
void initmovesafe_syncevent( /*out*/syncevent_t * destsyncevent, const syncevent_t * srcsyncevent )
Returns the tcp and udp port numbers of a named IP service.
int initnamed_ipport( /*out*/ipport_t * port, const char * servicename, ipprotocol_e protocol )
Initializes object.
#define INITOBJECT( module, objtype_t, object ) int err ; objtype_t * newobj = 0 ; ONERROR_testerrortimer( &s_processcontext_errtimer, &err, ONABORT); newobj = allocstatic_maincontext( sizeof(objtype_t)) ; if (!newobj) { err = ENOMEM ; goto ONABORT ; } ONERROR_testerrortimer( &s_processcontext_errtimer, &err, ONABORT); err = init_##module(newobj) ; if (err) goto ONABORT ; (object) = newobj ; return 0 ; ONABORT: if (newobj) { freestatic_maincontext(sizeof(objtype_t)) ; } return err ;
Implements errorcontext_t.initonce_errorcontext.
#define initonce_errorcontext( error ) (init_errorcontext(genericcast_errorcontext(error)))
Called from maincontext_t.init_maincontext.
int initonce_errorcontext( /*out*/errorcontext_t * error )
Called from maincontext_t.init_maincontext.
int initonce_locale( void )
Implement init as a no op if !defined(KONFIG_SUBSYS_THREAD)
#define initonce_signalhandler( ) (0)
Sets up a process wide signal handler and signal masks at process initialization.
int initonce_signalhandler( void )
Implement init as a no op if defined KONFIG_USERINTERFACE_X11.
#define initonce_X11( ) (0)
Init Xlib such that calling into it is thread safe.
int initonce_X11( void )
Allocates resources of pagecache_block_t stored in pagecache_block_t.pageblock.
static inline int initpageblock_pagecacheblock( vmpage_t * pageblock, size_t blocksize )
Sets *progname to (strrchr(argv0, “/”)+1).
static void initprogname_maincontext( const char ** progname, const char * argv0 )
Helds all data needed to construct a new syncthread_t.
struct initqueue_entry_t
Initializes a set of realtime signals which can be waited upon.
int initrealtime_signalwait( /*out*/signalwait_t * signalwait, signalrt_t minrt, signalrt_t maxrt )
Assigns static string buffer to str.
int initse_string( /*out*/string_t * str, const uint8_t * start, const uint8_t * end )
Inits egldisp with display.
static inline int initshared_egldisplay( egldisplay_t * egldisp, EGLDisplay display )
Opens file for reading into a single buffer.
int initsingle_filereader( /*out*/filereader_t * frd, const char * filepath, const struct directory_t * relative_to/*0 = > current working dir*/ )
Implements slist_t.initsingle_slist.
#define initsingle_slist( list, node ) ((void)(*(list) = (slist_t){ node }, (node)->next = (node)))
Initializes a single linked list object containing a single node.
void initsingle_slist( /*out*/slist_t * list, slist_node_t * node )
Prepares the single instance of unittest_t to execute tests.
int initsingleton_unittest( const char * log_files_directory )
Split a memory mapping into two.
int initsplit_mmfile( /*out*/mmfile_t * destheadmfile, /*out*/mmfile_t * desttailmfile, size_t headsize, mmfile_t * sourcemfile )
Calls platform_t.init_platform, maincontext_t.init_maincontext and runs main_thread.
int initstart_maincontext( const maincontext_startparam_t * startparam )
Implements string_field_t.initstring_stringfield.
#define initstring_stringfield( strfield, strval ) ( __extension__ ({ (strfield)->type = string_field_STRING ; (strfield)->val.str.addr = (strval)->addr ; (strfield)->val.str.size = (strval)->size ; 0 ; }))
Inits string_field_t describing a string value.
int initstring_stringfield( /*out*/string_field_t * strfield, struct string_t * strval )
Initializes str with substring of fromstr.
int initsubstr_string( /*out*/string_t * str, const string_t * restrict fromstr, size_t start_offset, size_t size )
Calls init_pagecacheimpl and adds interface pagecache_it to object.
int initthread_pagecacheimpl( /*out*/struct pagecache_t * pagecache )
Called from x11window_t.init_x11window.
int initvid_x11window( out struct x11display_t * x11disp, uint32_t screennr, const struct x11window_evh_t * eventhandler, (X11) VisualID const struct windowconfig_t * winconf_attrib )
Create a native X11 window on x11screen and assign it to x11win.
int initvid_x11window( /*out*/x11window_t * x11win, struct x11display_t * x11disp, uint32_t screennr, const struct x11window_evh_t * eventhandler, /*(X11) VisualID*/uint32_t config_visualid, const struct windowconfig_t * winconf_attrib )
Initializes egldisp with x11disp.
int initx11_egldisplay( /*out*/egldisplay_t * egldisp, struct x11display_t * x11disp )
Initializes eglwin with x11win.
int initx11_eglwindow( /*out*/eglwindow_t * eglwin, struct opengl_display_t * egldisp, struct opengl_config_t * eglconf, struct x11window_t * x11win )
Inserts new node at position pos into array.
int insert_arraysf( arraysf_t * array, struct arraysf_node_t * node, /*out*/struct arraysf_node_t ** inserted_node/*0 = >not returned*/, struct typeadapt_member_t * nodeadp/*0 = >no copy is made*/ )
Inserts new node with string key into array.
int insert_arraystf( arraystf_t * array, struct arraystf_node_t * node, /*out*/struct arraystf_node_t ** inserted_node/*0 = >copy not returned*/, struct typeadapt_member_t * nodeadp/*0 = >no copy is made*/ )
Inserts a new node into the hash table if it is unique.
int insert_exthash( exthash_t * htable, exthash_node_t * new_node )
Inserts a new node into the tree only if it is unique.
int insert_patriciatrie( patriciatrie_t * tree, patriciatrie_node_t * newnode )
Inserts a new node into the tree only if it is unique.
int insert_redblacktree( redblacktree_t * tree, redblacktree_node_t * new_node )
Inserts a new node into the tree only if it is unique.
int insert_splaytree( splaytree_t * tree, splaytree_node_t * new_node, uint16_t nodeoffset, typeadapt_t * typeadp )
Implements syncqueue_t.insert_syncqueue.
#define insert_syncqueue( syncqueue, newelem ) ( __extension__ ({ syncqueue_t * _sq = (syncqueue) ; typeof(**(newelem)) ** _elem = (newelem) ; int _err = insertlast_queue( genericcast_queue(_sq), (void**)_elem, sizeof(**_elem)) ; _sq->nrelements += (_err == 0) ; _err ; }))
Add new element of type IDNAME to end of queue (last).
int insert_syncqueue( syncqueue_t * syncqueue, IDNAME ** newelem )
Allocates new wlist node and inserts it into wlist.
int insert_syncwlist( syncwlist_t * wlist, struct syncqueue_t * queue, /*out*/struct syncevent_t ** newevent )
Implements trie_t.insert_trie.
#define insert_trie( trie, keylen, key, uservalue ) (insert2_trie((trie), (keylen), (key), (uservalue), true))
TODO: describe
int insert_trie( trie_t * trie, uint16_t keylen, const uint8_t key[keylen], void * uservalue )
Implements syncqueue_t.insert2_syncqueue.
#define insert2_syncqueue( syncqueue, elemsize, newelem ) ( __extension__ ({ syncqueue_t * _sq = (syncqueue) ; typeof(**(newelem)) ** _elem = (newelem) ; int _err = insertlast_queue( genericcast_queue(_sq), (void**)_elem, elemsize) ; _sq->nrelements += (_err == 0) ; _err ; }))
Add new element to end of queue (last).
int insert2_syncqueue( syncqueue_t * syncqueue, uint8_t elemsize, IDNAME ** newelem )
TODO: describe
int insert2_trie( trie_t * trie, uint16_t keylen, const uint8_t key[keylen], void * uservalue, bool islog )
Inserts new_node after prev_node into the list.
void insertafter_dlist( dlist_t * list, struct dlist_node_t * prev_node, struct dlist_node_t * new_node )
Adds new_node after prev_node into list.
void insertafter_slist( slist_t * list, struct slist_node_t * prev_node, struct slist_node_t * new_node )
Adds thread to list of waiting threads in rwlock.
static inline void insertandwait_rwlock( rwlock_t * rwlock, slist_t * waitlist, thread_t * self )
Inserts new_node before next_node into the list.
void insertbefore_dlist( struct dlist_node_t * next_node, struct dlist_node_t * new_node )
Inserts child into node.
static int insertchild_trienode( trie_node_t * node, uint8_t digit, trie_nodedata_t * child, uint8_t childindex )
Makes new_node the new first element of list.
void insertfirst_dlist( dlist_t * list, struct dlist_node_t * new_node )
Allocates nodesize bytes on the first memory page.
int insertfirst_queue( queue_t * queue, /*out*/void ** nodeaddr, uint16_t nodesize )
Makes new_node the new first element of list.
void insertfirst_slist( slist_t * list, struct slist_node_t * new_node )
Makes new_node the new last element of list.
void insertlast_dlist( dlist_t * list, struct dlist_node_t * new_node )
Allocates nodesize bytes on the last memory page.
int insertlast_queue( queue_t * queue, /*out*/void ** nodeaddr, uint16_t nodesize )
Makes new_node the new last element of list.
void insertlast_slist( slist_t * list, struct slist_node_t * new_node )
Registers an object under an objectid.
int insertobject_x11display( x11display_t * x11disp, struct x11window_t * object, uint32_t objectid )
Installs mm_t which must be of type testmm_t.
static int installnew_testmm( const mm_t * testmm )
Installs the previous mm_t if the current mm is of type testmm_t.
static int installold_testmm( /*out*/mm_t * testmm )
Offers some atomic operations on integers.
struct int_t
This function is called from init_threadcontext.
struct log_it * interface_logwriter( void )
This function is called from init_threadcontext.
struct mm_it * interface_mmimpl( void )
This function is called from init_threadcontext.
struct objectcache_it * interface_objectcacheimpl( void )
Internal state used in conversion.
mbstate_t internal_state
Checks that every bucket points to a correct red black tree.
int invariant_exthash( const exthash_t * htable )
Checks that this tree meets 5 conditions of red-black trees.
int invariant_redblacktree( redblacktree_t * tree )
Checks that nodes of left subtree are smaller and nodes in right subtree are higher than root node.
int invariant_splaytree( splaytree_t * tree, uint16_t nodeoffset, typeadapt_t * typeadp )
Checks that all nodes are stored in correct search order.
int invariant_splaytree( splaytree_t * tree, uint16_t nodeoffset, typeadapt_t * typeadp )
Holds iochannel the log is written to.
sys_iochannel_t io
Implements directory_t.io_directory.
#define io_directory( dir ) (dirfd((DIR*)CONST_CAST(directory_t, dir)))
Returns iochannel_t (file descriptor) of the opened directory.
sys_iochannel_t io_directory( const directory_t * dir )
Implements file_t.io_file.
#define io_file( fileobj ) (fileobj)
Returns iochannel_t for a file.
sys_iochannel_t io_file( const file_t fileobj )
Implements ipsocket_t.io_ipsocket.
#define io_ipsocket( ipsock ) (*(ipsock))
Returns the file descriptor sys_iochannel_t of the socket.
sys_iochannel_t io_ipsocket( const ipsocket_t * ipsock )
Implements logbuffer_t.io_logbuffer.
#define io_logbuffer( logbuf ) ((logbuf)->io)
Returns the iochannel_t the content of the buffer is written to.
sys_iochannel_t io_logbuffer( const logbuffer_t * logbuf )
Implement signalwait_t.io_signalwait.
#define io_signalwait( signalwait ) ((sys_iochannel_t)signalwait)
Returns the iochannel_t of signalwait.
sys_iochannel_t io_signalwait( const signalwait_t signalwait )
Returns file descriptor of network connection.
sys_iochannel_t io_x11display( const x11display_t * x11disp )
Implements iobj_t.iobj_DECLARE.
#define iobj_DECLARE( declared_t, typenameprefix ) struct declared_t { struct typenameprefix##_t * object ; struct typenameprefix##_it * iimpl ; }
Declares an interfaceable object of type declared_t.
void iobj_DECLARE( TYPENAME declared_t, IDNAME typenameprefix )
Static initializer.
#define iobj_FREE { 0, 0 }
Static initializer.
#define iobj_INIT( object, iimpl ) { (object), (iimpl) }
This type has only template character.
struct iobj_t
Used in ALLOC_PAGECACHE.
struct { uint8_t * addr ; size_t size ; } iobuffer
Declares a subtype of iocallback_t, i.e.
#define iocallback_DECLARE( declared_t, iohandler_t ) typedef struct declared_t declared_t ; struct declared_t { iohandler_t * object ; void (* iimpl) ( iohandler_t * iohandler, sys_iochannel_t fd, uint8_t ioevents) ; }
Callback function for handling ioevent_t.
typedef void ( * iocallback_f ) (void * iohandler, sys_iochannel_t fd, uint8_t ioevents)
Static initializer.
#define iocallback_FREE iocallback_INIT( 0, )
Static initializer.
#define iocallback_INIT( object, iimpl ) { (object), (iimpl) }
Declares a pointer to callback interface implementing object.
struct iocallback_t
Static initializer.
#define iochannel_FREE sys_iochannel_FREE
Describes an input/output channel like a file or network connection.
typedef sys_iochannel_t iochannel_t
Safes status of last read access to file.
int ioerror
Implements filereader_t.ioerror_filereader.
#define ioerror_filereader( frd ) ((frd)->ioerror)
Returns the I/0 error (>0) or 0 if no error occurred.
int ioerror_filereader( const filereader_t * frd )
The id value of an event.
union ioevent_id_t
Static initializer.
#define ioevent_INIT_PTR( ioevents, eventid ) { ioevents, { .ptr = eventid } }
Static initializer.
#define ioevent_INIT_VAL32( ioevents, eventid ) { ioevents, { .val32 = eventid } }
Static initializer.
#define ioevent_INIT_VAL64( ioevents, eventid ) { ioevents, { .val64 = eventid } }
Associates one or more ioevent_e with an ioevent_id_t.
struct ioevent_t
One or more ioevent_e values ored together in one event mask.
uint32_t ioevents
Static initializer.
#define iopoll_FREE { sys_iochannel_FREE }
Event manager which stores sys_iochannel_t and returns associated ioevent_t.
struct iopoll_t
Stores list of ipaddr_t.
struct ipaddr_list_t
Holds enough memory for every possible version of ipaddr_t.
struct ipaddr_storage_t
Stores description of an internet protocol address.
struct ipaddr_t
System chooses free port number for you.
#define ipport_ANY 0
A socket of type ipsocket_t.
ipsocket_t ipsock
Static initializer.
#define ipsocket_async_FREE { ipsocket_FREE, 0 }
Allows to make a TCP connection in an async way.
struct ipsocket_async_t
Static initializer for ipsocket_t.
#define ipsocket_FREE sys_iochannel_FREE
Defines ipsocket_t as alias for sys_iochannel_t.
typedef sys_iochannel_t ipsocket_t
Returns true if this user is administrator (== root).
bool isadmin_sysuserid( sysuser_id_t uid )
Implements ptr_t.isaligned_ptr.
#define isaligned_ptr( ptr, nrbits ) (0 == lsbits_ptr(ptr, nrbits))
Returns true if all nrbits least significant bits of ptr are zero.
int isaligned_ptr( const ptr_t ptr, unsigned nrbits )
Returns true if color is black.
#define ISBLACK( node ) (0 != COLOR(node))
Implements arraysf_unode_t.isbranchtype_arraysfunode.
#define isbranchtype_arraysfunode( node ) ( __extension__ ({ const arraysf_unode_t * _node2 = (node) ; ((uintptr_t)(_node2) & 0x01) ; }))
Returns true in case node is pointer to arraysf_mwaybranch_t.
int isbranchtype_arraysfunode( const arraysf_unode_t * node )
Implements arraystf_unode_t.isbranchtype_arraystfunode.
#define isbranchtype_arraystfunode( node ) ( __extension__ ({ const arraystf_unode_t * _node3 = (node) ; ((uintptr_t)(_node3) & 0x01) ; }))
Returns true in case node is pointer to arraystf_mwaybranch_t.
int isbranchtype_arraystfunode( const arraystf_unode_t * node )
Implements typeadapt_t.iscalldelete_typeadapt.
#define iscalldelete_typeadapt( typeadp ) (0 != (typeadp)->lifetime.delete_object)
Returns true if typeadapt_lifetime_it.delete_object is not NULL.
bool iscalldelete_typeadapt( const typeadapt_t * typeadp )
Return true in case child and digit array are encoded in trie_node_t.
static inline int ischild_header( const header_t header )
Return true in case ischild_header or issubnode_header returns true.
static inline int ischildorsubnode_header( const header_t header )
Returns if the socket is connected to a peer.
bool isconnected_ipsocket( const ipsocket_t * ipsock )
Implements binarystack_t.isempty_binarystack.
#define isempty_binarystack( stack ) ((stack)->freeblocksize == (stack)->blocksize)
Returns true if stack contains no more data.
int isempty_binarystack( const binarystack_t * stack )
Implements dlist_t.isempty_dlist.
#define isempty_dlist( list ) (0 == (list)->last)
Returns true if list contains no elements else false.
int isempty_dlist( const dlist_t * list )
Implements exthash_t.isempty_exthash.
#define isempty_exthash( htable ) (0 == ((htable)->nr_nodes))
Returns true if the table contains no element.
bool isempty_exthash( const exthash_t * htable )
Implements patriciatrie_t.isempty_patriciatrie.
#define isempty_patriciatrie( tree ) (0 == (tree)->root)
Returns true if tree contains no elements.
bool isempty_patriciatrie( const patriciatrie_t * tree )
Implements queue_t.isempty_queue.
#define isempty_queue( queue ) (0 == (queue)->last)
Returns true if queue contains no elements.
bool isempty_queue( const queue_t * queue )
Implements redblacktree_t.isempty_redblacktree.
#define isempty_redblacktree( tree ) (0 == (tree)->root)
Returns true if tree contains no elements.
bool isempty_redblacktree( const redblacktree_t * tree )
Implements slist_t.isempty_slist.
#define isempty_slist( list ) (0 == (list)->last)
Returns true if list contains no nodes.
int isempty_slist( const slist_t * list )
Implements splaytree_t.isempty_splaytree.
#define isempty_splaytree( tree ) (0 == (tree)->root)
Returns true if tree contains no elements.
bool isempty_splaytree( const splaytree_t * tree )
Implements string_t.isempty_string.
#define isempty_string( str ) (0 == (str)->size)
Returns true if string has size 0.
bool isempty_string( const string_t * str )
Implements syncwlist_t.isempty_syncwlist.
#define isempty_syncwlist( wlist ) (0 == (wlist)->nrnodes)
Returns true if wlist contains no elements.
bool isempty_syncwlist( const syncwlist_t * wlist )
Returns true if no thread is waiting else false.
bool isempty_waitlist( waitlist_t * wlist )
Implements test_errortimer_t.isenabled_testerrortimer.
#define isenabled_testerrortimer( errtimer ) ((errtimer)->timercount > 0)
Returns true if timer has not fired.
bool isenabled_testerrortimer( const test_errortimer_t * errtimer )
Implements filereader_t.iseof_filereader.
#define iseof_filereader( frd ) ( __extension__ ({ const filereader_t * _f ; _f = (frd) ; (_f->unreadsize == 0 && _f->fileoffset == _f->filesize) ; }))
Returns true if end of file is reached.
bool iseof_filereader( const filereader_t * frd )
Returns true if lsysusr equals rsysusr.
bool isequal_sysuser( const sysuser_t * lsysusr, const sysuser_t * rsysusr )
Compares two sysuser_id_t for equality.
bool isequal_sysuserid( sysuser_id_t luid, sysuser_id_t ruid )
Returns true if both typeadapt_t are equal.
bool isequal_typeadapt( const typeadapt_t * ltypeadp, const typeadapt_t * rtypeadp )
Returns true if two typeadapt_gethash_it objects are equal.
bool isequal_typeadaptgethash( const typeadapt_gethash_it * lgethash, const typeadapt_gethash_it * rgethash )
Returns true if both typeadapt_member_ts are equal.
bool isequal_typeadaptmember( const typeadapt_member_t * ltypeadp, const typeadapt_member_t * rtypeadp )
Implements typeadapt_nodeoffset_t.isequal_typeadaptnodeoffset.
#define isequal_typeadaptnodeoffset( lnodeoff, rnodeoff ) ( __extension__ ({ typeadapt_nodeoffset_t _loff = (lnodeoff) ; typeadapt_nodeoffset_t _roff = (rnodeoff) ; _loff == _roff ; }))
Returns true if both typeadapt_nodeoffset_ts are equal.
bool isequal_typeadaptnodeoffset( const typeadapt_nodeoffset_t lnodeoff, const typeadapt_nodeoffset_t rnodeoff )
Returns true if the two objects refer to the same screen.
bool isequal_x11screen( const x11screen_t * lx11screen, const x11screen_t * rx11screen )
Returns true if two strings compare equal in a case insensitive way.
bool isequalasciicase_string( const string_t * str, const string_t * str2 )
Returns true if the nodesize is lower than maximum size.
static inline int isexpandable_trienodeoffsets( const trie_nodeoffsets_t * offsets )
Implements x11display_t.isextxrandr_x11display.
#define isextxrandr_x11display( x11disp ) ((x11disp)->xrandr.isSupported)
Returns true if xrandr extension is supported.
bool isextxrandr_x11display( const x11display_t * x11disp )
Returns true if this byte is a possible first (start) byte of an utf-8 encoded multibyte sequence.
bool isfirstbyte_utf8( const uint8_t firstbyte )
Returns true if barray equals blockarray_FREE.
bool isfree_blockarray( const blockarray_t * barray )
Implements file_t.isfree_file.
static inline bool isfree_file( file_t fileobj )
Returns true if the file was opened with init_file.
static inline bool isfree_file( const file_t fileobj )
Returns true in case frd == filereader_FREE.
bool isfree_filereader( const filereader_t * frd )
Implements iochannel_t.isfree_iochannel.
static inline bool isfree_iochannel( iochannel_t ioc )
Returns true if ioc equals iochannel_FREE.
static inline bool isfree_iochannel( const iochannel_t ioc )
Implements memblock_t.isfree_memblock.
#define isfree_memblock( mblock ) (0 == (mblock)->addr && 0 == (mblock)->size)
Returns true if mblock equals memblock_FREE.
bool isfree_memblock( const memblock_t * mblock )
Implements mmfile_t.isfree_mmfile.
#define isfree_mmfile( mfile ) (0 == addr_mmfile(mfile) && 0 == size_mmfile(mfile))
Returns true if mfile == mmfile_FREE.
bool isfree_mmfile( const mmfile_t * mfile )
Returns true in case the OS specific display is already freed.
#define ISFREE_OSDISPLAY( disp ) isfree_x11display(disp)
Returns true in case the OS specific window is already freed.
#define ISFREE_OSWINDOW( oswindow ) isfree_x11window(oswindow)
Returns true if pgcache equals pagecache_impl_FREE.
bool isfree_pagecacheimpl( const pagecache_impl_t * pgcache )
Returns true if spstr equals splitstring_FREE.
bool isfree_splitstring( const splitstring_t * spstr )
Implements string_t.isfree_string.
#define isfree_string( str ) (0 == (str)->addr && 0 == (str)->size)
Returns true if string has address and size of 0.
bool isfree_string( const string_t * str )
Implements surface_t.isfree_surface.
#define isfree_surface( surf ) (0 == (surf)->glsurface)
Returns true if surf->glsurface is set to 0.
bool isfree_surface( const surface_t * surf )
Implements syncevent_t.isfree_syncevent.
#define isfree_syncevent( syncevent ) (0 == (syncevent)->waiting)
Returns true if syncevent equals to syncevent_FREE.
bool isfree_syncevent( const syncevent_t * syncevent )
Returns true if syncqueue is equal to syncqueue_FREE.
bool isfree_syncqueue( const syncqueue_t * syncqueue )
Returns true if *srun equals to syncrun_FREE.
bool isfree_syncrun( const syncrun_t * srun )
Returns true if sthread is intialized with syncthread_FREE.
bool isfree_syncthread( const syncthread_t * sthread )
Returns true if wlist equals syncwlist_FREE.
bool isfree_syncwlist( const syncwlist_t * wlist )
Returns true if mutex equals thrmutex_FREE.
bool isfree_thrmutex( thrmutex_t * mutex )
Returns true if scan is initialized with utf8scanner_FREE.
bool isfree_utf8scanner( const utf8scanner_t * scan )
Implements <vmpage_t.isfree_vmpage>>.
#define isfree_vmpage( vmpage ) (0 == (vmpage)->addr && 0 == (vmpage)->size)
Returns true if vmpage equals vmpage_FREE.
bool isfree_vmpage( vmpage_t * vmpage )
Implements x11display_t.isfree_x11display.
static inline bool isfree_x11display( const x11display_t * x11disp )
Returns true if x11disp is set to x11display_FREE.
static inline bool isfree_x11display( const x11display_t * x11disp )
Implements x11window_t.isfree_x11window.
static inline bool isfree_x11window( const x11window_t * x11win )
Returns true if x11win is set to x11window_FREE.
static inline bool isfree_x11window( const x11window_t * x11win )
Uses node to check if last child entry is empty.
static inline bool isfreechild_trienode( trie_node_t * node )
Implements iocallback_t.isinit_iocallback.
#define isinit_iocallback( iocb ) (0 != (iocb)->iimpl)
Returns true if iocallback_t.iimpl is not 0.
bool isinit_iocallback( const iocallback_t * iocb )
Implements dlist_t.isinlist_dlist.
#define isinlist_dlist( node ) (0 != (node)->next)
Returns true if node is stored in a list else false.
bool isinlist_dlist( const struct dlist_node_t * node )
Implements slist_t.isinlist_slist.
#define isinlist_slist( node ) (0 != (node)->next)
Returns true if node is stored in a list else false.
bool isinlist_slist( struct slist_node_t * node )
Implements testmm_t.isinstalled_testmm.
#define isinstalled_testmm( ) (0 != mmcontext_testmm())
Returns true if test memory manager is installed.
bool isinstalled_testmm( void )
Returns true if parameter points to node of type suffixtree_leaf_t.
#define ISLEAF( leaf ) ((leaf)->str_size & 0x01)
Returns true if the socket listens for incoming connections.
bool islisten_ipsocket( const ipsocket_t * ipsock )
Returns true if a thread locked the mutex.
bool islocked_thrmutex( thrmutex_t * mutex )
Implements thread_t.ismain_thread.
#define ismain_thread( thread ) ( __extension__ ({ volatile const thread_t * _thr ; _thr = (thread) ; (0 == _thr->tls_addr) ; }))
Returns true if the calling thread is the main thread.
bool ismain_thread( const thread_t * thread )
Returns true is vmpage is mapped whose accessmode equals protection.
bool ismapped_vm( const vmpage_t * vmpage, accessmode_e protection )
Returns true if mappedregions contains a memory region with correct protection.
bool ismapped_vmmappedregions( vm_mappedregions_t * mappedregions, const vmpage_t * mblock, accessmode_e protection )
Returns true if big is negative else false.
bool isnegative_bigint( const bigint_t * big )
Returns true if dec is negative else false.
bool isnegative_decimal( const decimal_t * dec )
Implements filereader_t.isnext_filereader.
#define isnext_filereader( frd ) ( __extension__ ({ const filereader_t * _f ; _f = (frd) ; (_f->unreadsize != 0) ; }))
Returns true if there is a free buffer available.
bool isnext_filereader( const filereader_t * frd )
Implements stringstream_t.isnext_stringstream.
#define isnext_stringstream( strstream ) ( __extension__({ typeof(strstream) _strstream = (strstream) ; ((uintptr_t)_strstream->next < (uintptr_t)_strstream->end) ; }))
Returns true if there are is at least one more unread bytes.
bool isnext_stringstream( const stringstream_t * strstream )
Implements utf8reader_t.isnext_utf8reader.
#define isnext_utf8reader( utfread ) ((utfread)->next < (utfread)->end)
Returns true if there is at least one byte to read.
bool isnext_utf8reader( const utf8reader_t * utfread )
Returns true if the buffer contains at least one more byte.
bool isnext_utf8scanner( const utf8scanner_t * scan )
Implements pagecache_t.isobject_pagecache.
#define isobject_pagecache( pgcache ) (0 != (pgcache)->object)
Returns true if member pagecache_t.object of pgcache is not null.
bool isobject_pagecache( const pagecache_t * pgcache )
Implements int_t.ispowerof2_int as a generic function.
#define ispowerof2_int( i ) (!( (typeof(i)) (((i)-1) & (i)) ))
Determines if argument is of power of 2 or 0.
int ispowerof2_int( unsigned i )
Returns true if color is red.
#define ISRED( node ) (0 == COLOR(node))
Returns true if pcontext equals processcontext_INIT_STATIC.
bool isstatic_processcontext( const processcontext_t * pcontext )
Returns true if tcontext == threadcontext_INIT_STATIC.
bool isstatic_threadcontext( const threadcontext_t * tcontext )
Returns true if at least one suffix begins with searchstr.
bool isstring_suffixtree( suffixtree_t * tree, size_t length, const uint8_t searchstr[length] )
Return true in case child array points to trie_subnode_t.
static inline int issubnode_header( const header_t header )
Returns true if memory at vmpage is not mapped.
bool isunmapped_vm( const vmpage_t * vmpage )
Returns true if mappedregions contains no memory region which overlaps with mblock.
bool isunmapped_vmmappedregions( vm_mappedregions_t * mappedregions, const vmpage_t * mblock )
Return true in case node contains member uservalue.
static inline int isuservalue_header( const header_t header )
Indicates if this structure contains valid information.
bool isvalid
Uses fcntl to query file descriptor flags (FD_CLOEXEC).
bool isvalid_file( file_t fileobj )
Returns true if fileobj is valid.
bool isvalid_file( const file_t fileobj )
Returns true if ioc is initialized and valid.
bool isvalid_iochannel( const iochannel_t ioc )
Checks that internal fields are ok.
bool isvalid_ipaddr( const ipaddr_t * addr )
Implements memblock_t.isvalid_memblock.
#define isvalid_memblock( mblock ) (0 != (mblock)->size && 0 != (mblock)->addr)
Returns true if mblock->addr != 0 and block->size != 0.
bool isvalid_memblock( const memblock_t * mblock )
Returns true if tv contains a valid value.
bool isvalid_timevalue( timevalue_t * tv )
Returns true if the byte is a legal first byte of an utf8 encoded multibyte sequence.
bool isvalidfirstbyte_utf8( const uint8_t firstbyte )
Implements window_t.isvisible_window.
#define isvisible_window( win ) (x11window_state_SHOWN == state_x11window(os_window(win)))
Returns true if window is visible on the screen.
bool isvisible_window( const window_t * win )
Implements syncevent_t.iswaiting_syncevent.
#define iswaiting_syncevent( syncevent ) (0 != (syncevent)->waiting)
Returns true if there is already a waiting thread.
bool iswaiting_syncevent( const syncevent_t * syncevent )
Returns true if mutex is locked and wait list is not empty.
bool iswaiting_thrmutex( thrmutex_t * mutex )
Returns true if there is a single writer holding the lock.
bool iswriter_rwlock( rwlock_t * rwlock )
Implements bigint_t.iszero_bigint.
#define iszero_bigint( big ) (0 == (big)->sign_and_used_digits)
Returns true in case big has value 0 else false.
bool iszero_bigint( const bigint_t * big )
Implements decimal_t.iszero_decimal.
#define iszero_decimal( dec ) ((dec)->sign_and_used_digits == 0)
Returns true if dec has value 0 else false.
bool iszero_decimal( const decimal_t * dec )
Function declaration to associate arraysf_node_t with arraysf_t.
typedef struct arraysf_node_t * iteratedtype_arraysf
Function declaration to associate arraystf_node_t with arraystf_t.
typedef struct arraystf_node_t * iteratedtype_arraystf
Declaration to associate dlist_node_t with dlist_t.
typedef struct dlist_node_t * iteratedtype_dlist
Declaration to associate exthash_node_t with exthash_t.
typedef exthash_node_t * iteratedtype_exthash
Declaration to associate patriciatrie_node_t with patriciatrie_t.
typedef patriciatrie_node_t * iteratedtype_patriciatrie
Declaration to associate (void*) with queue_t.
typedef void * iteratedtype_queue
Declaration to associate redblacktree_node_t with redblacktree_t.
typedef redblacktree_node_t * iteratedtype_redblacktree
Declaration to associate slist_node_t with slist_t.
typedef struct slist_node_t * iteratedtype_slist
Declaration to associate splaytree_node_t with splaytree_t.
typedef splaytree_node_t * iteratedtype_splaytree
Declaration to associate syncevent_t with syncwlist_t.
typedef struct syncevent_t * iteratedtype_syncwlist
Declaration to associate arraysf_iterator_t with arraysf_t.
typedef arraysf_iterator_t iteratortype_arraysf
Declaration to associate arraystf_iterator_t with arraystf_t.
typedef arraystf_iterator_t iteratortype_arraystf
Declaration to associate dlist_iterator_t with dlist_t.
typedef dlist_iterator_t iteratortype_dlist
Declaration to associate exthash_iterator_t with exthash_t.
typedef exthash_iterator_t iteratortype_exthash
Declaration to associate patriciatrie_iterator_t with patriciatrie_t.
typedef patriciatrie_iterator_t iteratortype_patriciatrie
Declaration to associate queue_iterator_t with queue_t.
typedef queue_iterator_t iteratortype_queue
Declaration to associate redblacktree_iterator_t with redblacktree_t.
typedef redblacktree_iterator_t iteratortype_redblacktree
Declaration to associate slist_iterator_t with slist_t.
typedef slist_iterator_t iteratortype_slist
Declaration to associate splaytree_iterator_t with splaytree_t.
typedef splaytree_iterator_t iteratortype_splaytree
Declaration to associate syncwlist_iterator_t with syncwlist_t.
typedef syncwlist_iterator_t iteratortype_syncwlist