Simulates an error in different functions.
static test_errortimer_t s_arraysf_errtimer
Simulates an error in different functions.
static test_errortimer_t s_arraystf_errtimer
Simulates an error in different functions.
static test_errortimer_t s_bigint_errtimer
static test_errortimer_t s_binarystack_errtimer
Simulates an error in different functions.
static test_errortimer_t s_decimal_errtimer
Tables of powers of pow(10,9) used to convert bigint_t, float, double, into decimal_t.
static const bigint_t * s_decimal_powbase[7]
Simulates an error in path_directory.
static test_errortimer_t s_directory_errtimer
Allows to introduce artificial errors.
static test_errortimer_t s_display_errtimer
Allows to initialize an X11 display without extensions.
static bool s_display_noext
Allows to introduce artificial errors during test.
static test_errortimer_t s_eglcontext_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_egldisplay_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_eglpbuffer_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_eglwindow_errtimer
Simulates an error in init_filepathstatic.
static test_errortimer_t s_filepathstatic_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_gcontext_errtimer
Remembers if prepare_malloc was called already.
static bool s_isprepared_malloc
Table of 256 octets (first are 128 ascii codes).
static const uint8_t s_isurlencode[256]
Contains single instance of interface logwriter_it.
static logwriter_it s_logwriter_interface
Simulates an error in maincontext_t.init_maincontext.
static test_errortimer_t s_maincontext_errtimer
Static memory block used in in global maincontext_t.
static uint8_t s_maincontext_staticmem[maincontext_STATICSIZE + maincontext_STATICTESTSIZE]
Contains single instance of interface mm_impl_it.
static mm_impl_it s_mmimpl_interface
Contains single instance of interface objectcache_it.
static objectcache_impl_it s_objectcacheimpl_interface
Stores single instance of interface pagecache_it.
static pagecache_impl_it s_pagecacheimpl_interface
Allows to introduce artificial errors during test.
static test_errortimer_t s_pixelbuffer_errtimer
Used to simulate an error in platform_t.init_platform.
static test_errortimer_t s_platform_errtimer
Contains powers of 10 (10ⁿ).
static uint64_t s_pow10[20]
Precomputed remainder for every possible input byte divided by bit reversed polynomial 0x104C11DB7.
static uint32_t s_precomputed_crc32[256]
Simulates an error in init_processcontext.
static test_errortimer_t s_processcontext_errtimer
Stores global configuration information for signal handlers.
static signalhandler_t s_signalhandler[64]
Stores old signal mask.
static sigset_t s_signalhandler_oldmask
Allows to introduce artificial errors during test.
static test_errortimer_t s_syncrun_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_syncwlist_errtimer
Contains single instance of interface testmm_it.
static testmm_it s_testmm_interface
Simulates an error in newgroup_thread.
static test_errortimer_t s_thread_errtimer
Simulates an error in init_threadcontext.
static test_errortimer_t s_threadcontext_errtimer
The next id which is assigned to threadcontext_t.thread_id.
static size_t s_threadcontext_nextid
Simulates an error in init_threadtls and free_threadtls.
static test_errortimer_t s_threadtls_errtimer
Simulates an error in different functions.
static test_errortimer_t s_trie_errtimer
Holds the context for all running unit tests.
static unittest_t s_unittest_singleton
Simulates an error in reserve_memblock_wbuffer and reserve_cstring_wbuffer.
static test_errortimer_t s_wbuffer_errtimer
Allows to introduce artificial errors during test.
static test_errortimer_t s_window_errtimer
Remembers if initialization was done.
static bool s_X11_init
Returns 0 if the numbers of resources equals the numbers stored in usage.
int same_resourceusage( const resourceusage_t * usage )
Creates file and writes file_content into it.
int save_file( const char * filepath, size_t file_size, const void * file_content/*[filer_size]*/, struct directory_t * relative_to )
Stores the begin and length of a string of a recognized token.
splitstring_t scanned_token
Returns the address to an internally stored splitstring_t.
const splitstring_t * scannedtoken_utf8scanner( utf8scanner_t * scan )
The url scheme.
uint16_t scheme
scanf unsigned int format specifier ‘zu’ for type size_t.
#define SCNuSIZE "zu"
Returns the screen number the window is located on.
uint32_t screen_x11window( const x11window_t * x11win )
The seconds counted from some point in time.
int64_t seconds
Use it to change offset of the underlying file mapped into memory.
int seek_mmfile( mmfile_t * mfile, sys_iochannel_t fd, off_t file_offset, accessmode_e mode )
Inline implementation of maincontext_t.self_maincontext.
#define self_maincontext( ) ((maincontext_t*)pcontext_maincontext())
Returns maincontext_t of the current process.
maincontext_t * self_maincontext( void )
Implements thread_t.self_thread.
#define self_thread( ) (sys_thread_threadtls())
Returns a pointer to own thread_t.
thread_t * self_thread( void )
Static initializer.
#define semaphore_FREE { sys_semaphore_FREE }
Describes a system semaphore used between threads.
struct semaphore_t
Sends realtime signal to any thread in the process.
int send_signalrt( signalrt_t nr, uintptr_t value )
Sends realtime signal to a specific thread.
int send2_signalrt( signalrt_t nr, uintptr_t value, const struct thread_t * thread )
Implements window_t.sendclose_window.
#define sendclose_window( win ) sendclose_x11window(os_window(win))
Sends a close request to win.
int sendclose_window( window_t * win )
Sends a close request to a window.
int sendclose_x11window( x11window_t * x11win )
Implements window_t.sendredraw_window.
#define sendredraw_window( win ) sendredraw_x11window(os_window(win))
Sends a redraw event to win.
int sendredraw_window( window_t * win )
Sends a redraw event to a window.
int sendredraw_x11window( x11window_t * x11win )
Converts accessmode_e into POSIX representation.
#define SET_PROT( prot, access_mode ) static_assert(0 == accessmode_NONE, "") ; static_assert(0 == PROT_NONE, "") ; if ( accessmode_READ == PROT_READ && accessmode_WRITE == PROT_WRITE && accessmode_EXEC == PROT_EXEC) { prot = access_mode & (accessmode_RDWR|accessmode_EXEC); } else { if (accessmode_READ & access_mode) { prot = PROT_READ ; } else { prot = PROT_NONE ; } if (accessmode_WRITE & access_mode) { prot |= PROT_WRITE ; } if (accessmode_EXEC & access_mode) { prot |= PROT_EXEC ; } }
Overwrites a previously set signal handler with sighandler.
static int set_signalhandler( unsigned signr, signalhandler_f sighandler )
Sets a new videomode of x11screen_t.
int set_x11videomode( const x11videomode_t * xvidmode, struct x11screen_t * x11screen )
Sets the ip number, protocol and port.
int setaddr_ipaddr( ipaddr_t * addr, ipprotocol_e protocol, uint16_t sock_addr_len, const sys_socketaddr_t * sock_addr )
Sets the value of big integer from an array of integers.
int setbigfirst_bigint( bigint_t * restrict * big, int sign, uint16_t size, const uint32_t numbers[size], uint16_t exponent )
Sets the color of node to black.
#define SETBLACK( node ) (node)->parent = (redblacktree_node_t*) (((uintptr_t)1) | (uintptr_t)((node)->parent))
Implements arraysf_mwaybranch_t.setchild_arraysfmwaybranch.
#define setchild_arraysfmwaybranch( branch, childindex, childnode ) do { (branch)->child[childindex] = (childnode) ; } while(0)
Changes entries in arry arraysf_mwaybranch_t.child.
void setchild_arraysfmwaybranch( arraysf_mwaybranch_t * branch, unsigned childindex, arraysf_node_t * childnode )
Implements arraystf_mwaybranch_t.setchild_arraystfmwaybranch.
#define setchild_arraystfmwaybranch( branch, childindex, childnode ) do { (branch)->child[childindex] = (childnode) ; } while(0)
Changes entries in arry arraystf_mwaybranch_t.child.
void setchild_arraystfmwaybranch( arraystf_mwaybranch_t * branch, unsigned childindex, arraystf_node_t * childnode )
Sets child as pointer to child node for digit.
static inline void setchild_triesubnode( trie_subnode_t * subnode, uint8_t digit, trie_nodedata_t * child )
Implements thread_t.setcontinue_thread.
#define setcontinue_thread( is_abort ) ( __extension__ ({ thread_t * _self ; _self = self_thread() ; setreturncode_thread( _self, 0) ; int _err = getcontext( &_self->continuecontext) ; if (_err) { _err = errno ; TRACESYSCALL_ERRLOG( "getcontext", _err) ; } if (returncode_thread( _self)) { *(is_abort) = true ; } else { *(is_abort) = false ; } _err ; }))
Stores the current execution context and returns 0 on success.
int setcontinue_thread( bool * is_abort )
Implements syncthread_t.setcontinuelabel_syncthread.
#define setcontinuelabel_syncthread( sthread, labelname ) ((void)((sthread)->state = __extension__ && labelname))
Calls setstate_syncthread with address of a label.
void setcontinuelabel_syncthread( syncthread_t * sthread, IDNAME labelname )
Setzt den aktuellen OpenGL Kontext für diesen Thread auf eglcont.
int setcurrent_eglcontext( const eglcontext_t eglcont, struct opengl_display_t * egldisp, struct opengl_surface_t * drawsurf, struct opengl_surface_t * readsurf )
Implements gcontext_t.setcurrent_gcontext.
#define setcurrent_gcontext( cont, disp, drawsurf, readsurf ) setcurrent_eglcontext(gl_gcontext(cont), gl_display(disp), gl_surface(drawsurf), gl_surface(readsurf))
Setzt den aktuellen OpenGL Kontext für diesen Thread auf cont.
int setcurrent_gcontext( const gcontext_t cont, struct display_t * disp, struct surface_t * drawsurf, struct surface_t * readsurf )
Sets the default locale defined by the program environment.
int setdefault_locale( void )
Sets decimal dec to the value represented in decimal/scientific notation.
int setfromchar_decimal( decimal_t *restrict * dec, const size_t nrchars, const char decimalstr[nrchars] )
Sets the value of big to the integer value of the provided parameter.
int setfromdouble_bigint( bigint_t * big, double value )
Sets decimal to floating point value.
int setfromfloat_decimal( decimal_t *restrict * dec, float value )
Sets the value of big to the value of the provided parameter.
void setfromint32_bigint( bigint_t * big, int32_t value )
Sets decimal to value mutliplied by pow(10,*decimal_exponent*).
int setfromint32_decimal( decimal_t *restrict * dec, int32_t value, int32_t decimal_exponent )
Sets decimal to value mutliplied by pow(10,*decimal_exponent*).
int setfromint64_decimal( decimal_t *restrict * dec, int64_t value, int32_t decimal_exponent )
Sets the value of big to the positive value of the provided parameter .
void setfromuint32_bigint( bigint_t * big, uint32_t value )
Sets the value of big to the positive value of the provided parameter .
void setfromuint64_bigint( bigint_t * big, uint64_t value )
Sets signal handler which consumes and ignores signal signr.
static int setignore_signalhandler( unsigned signr )
Implements filereader_t.setioerror_filereader.
#define setioerror_filereader( frd, ioerr ) ((void)((frd)->ioerror = (ioerr)))
Sets ioerror of frd.
void setioerror_filereader( filereader_t * frd, int ioerr )
Sets the value of big integer from an array of integers.
int setlittlefirst_bigint( bigint_t * restrict * big, int sign, uint16_t size, const uint32_t numbers[size], uint16_t exponent )
Overwrites old mm_t of threadcontext_t with new_mm.
void setmm_threadcontext( threadcontext_t * tcontext, const struct mm_t * new_mm )
Implements bigint_t.setnegative_bigint.
#define setnegative_bigint( big ) do { (big)->sign_and_used_digits = (int16_t) ( (big)->sign_and_used_digits < 0 ? (big)->sign_and_used_digits : - (big)->sign_and_used_digits ) ; } while (0)
Changes the sign to be negative.
void setnegative_bigint( bigint_t * big )
Implements decimal_t.setnegative_decimal.
#define setnegative_decimal( dec ) do { (dec)->sign_and_used_digits = (int8_t) ( (dec)->sign_and_used_digits < 0 ? (dec)->sign_and_used_digits : - (dec)->sign_and_used_digits ) ; } while (0)
Changes the sign to be negative.
void setnegative_decimal( decimal_t * dec )
Sets the nr of parts the string is composed of.
void setnrofparts_splitstring( splitstring_t * spstr, uint8_t number_of_parts )
Implements test_errortimer_t.SETONERROR_testerrortimer.
#define SETONERROR_testerrortimer( errtimer, err ) do { typeof(err) _eret = (err) ; int _err2 ; _err2 = process_testerrortimer(errtimer) ; if (_err2) *_eret = _err2 ; } while(0)
No op if KONFIG_UNITTEST is not defined.
void SETONERROR_testerrortimer( test_errortimer_t * errtimer, /*err*/int * err )
Sets the opacity of the window and its window manager frame.
int setopacity_x11window( x11window_t * x11win, double opacity )
Sets the new parent of node and keeps the encoded color.
#define SETPARENT( node, newparent ) (node)->parent = (redblacktree_node_t*) (COLOR(node) | (uintptr_t)newparent)
Sets a new parent for node and sets its color to black.
#define SETPARENTBLACK( node, newparent ) (node)->parent = (redblacktree_node_t*) (((uintptr_t)1) | (uintptr_t)newparent)
Sets a new parent for node and sets its color to red.
#define SETPARENTRED( node, newparent ) (node)->parent = newparent
Changes ip address’ port value.
int setport_ipaddr( ipaddr_t * addr, ipport_t port )
Implements window_t.setpos_window.
#define setpos_window( win, screen_x, screen_y ) setpos_x11window(os_window(win), screen_x, screen_y)
Changes the position of the window on the screen.
int setpos_window( window_t * win, int32_t screen_x, int32_t screen_y )
Changes the position of the window on the screen.
int setpos_x11window( x11window_t * x11win, int32_t screen_x, int32_t screen_y )
Implements bigint_t.setpositive_bigint.
#define setpositive_bigint( big ) do
Changes the sign to be positive.
void setpositive_bigint( bigint_t * big )
Implements decimal_t.setpositive_decimal.
#define setpositive_decimal( dec ) do
Changes the sign to be positive.
void setpositive_decimal( decimal_t * dec )
Changes ip address’ protocol value.
int setprotocol_ipaddr( ipaddr_t * addr, ipprotocol_e protocol )
Changes the size of the read and write queue.
int setqueuesize_ipsocket( ipsocket_t * ipsock, size_t queuesize_read/*0 = > no change*/, size_t queuesize_write/*0 = > no change*/ )
Sets the color of node to red.
#define SETRED( node ) (node)->parent = PARENT(node)
Implements thread_t.setreturncode_thread.
#define setreturncode_thread( thread, retcode ) do { volatile typeof(*(thread)) * _thr ; _thr = (thread) ; _thr->returncode = (retcode) ; } while(0)
Changes value returned by returncode_thread.
void setreturncode_thread( thread_t * thread, int retcode )
Change segmentation fault signal handler.
int setsegv_signalhandler( signalhandler_segv_f segfault_handler )
Changes the size of the a part of the string at index stridx.
void setsize_splitstring( splitstring_t * spstr, uint8_t stridx, size_t stringsize )
Sets log_state_e logstate for a specific log_channel_e channel.
void ( * setstate ) (void * log, uint8_t channel, uint8_t logstate)
Sets LOGSTATE for LOGCHANNEL.
#define SETSTATE_LOG( LOGCHANNEL, LOGSTATE ) log_maincontext().iimpl->setstate(log_maincontext().object, LOGCHANNEL, LOGSTATE)
Change log_state_e of log_channel_e channel to logstate.
void setstate_logwriter( logwriter_t * lgwrt, uint8_t channel, uint8_t logstate )
Implements syncthread_t.setstate_syncthread.
#define setstate_syncthread( sthread, state_ ) ((void)((sthread)->state = state_))
Sets the state of the thread.
void setstate_syncthread( syncthread_t * sthread, void * state )
Changes state of running thread to syncrun_state_ABORT.
void setstateabort_syncrun( syncrun_t * srun )
Changes state of running thread to syncrun_state_EXIT.
void setstateexit_syncrun( syncrun_t * srun )
Changes state of running thread to syncrun_state_WAIT.
void setstatewait_syncrun( syncrun_t * srun, struct syncevent_t * event, void * continuelabel )
Same as setstatewait_syncrun except supports multiple waiting threads.
void setstatewaitlist_syncrun( syncrun_t * srun, struct syncwlist_t * wlist, void * continuelabel )
Sets the stringaddr and stringsize of a part of the string at index stridx.
void setstring_splitstring( splitstring_t * spstr, uint8_t stridx, size_t stringsize, const uint8_t stringaddr[stringsize] )
Implements thread_t.settask_thread.
#define settask_thread( thread, _main, _main_arg ) do { volatile typeof(*(thread)) * _thr ; _thr = (thread) ; _thr->main_task = (_main) ; _thr->main_arg = (_main_arg) ; } while(0)
Changes values returned by maintask_thread and mainarg_thread.
void settask_thread( thread_t * thread, thread_f main, void * main_arg )
Sets the text of the window titile bar.
int settitle_x11window( const x11window_t * x11win, const char * title )
Changes realuser and privileged user.
int setusers_sysuser( sysuser_t * sysusr, sysuser_id_t realuser, sysuser_id_t privilegeduser )
Stores the data needed to calculate SHA1 hash from binary data.
struct sha1_hash_t
Defines sha1_hashvalue_t as 160 bit value.
typedef uint8_t sha1_hashvalue_t[20]
Position of bit in array index used to branch.
uint8_t shift
Index of bit of key data byte at position offset used to branch.
uint8_t shift
Multiplies the number by pow(2, shift_count).
int shiftleft_bigint( bigint_t ** result, uint32_t shift_count )
A function which computes the decimal left shift of digit.
typedef uint32_t ( * shiftleft10p_f ) (/*inout*/uint32_t * shiftcarry, uint32_t shiftdigit)
Divides the number by pow(2, shift_count).
int shiftright_bigint( bigint_t ** result, uint32_t shift_count )
Implements window_t.show_window.
#define show_window( win ) show_x11window(os_window(win))
Makes window visible to the user.
int show_window( window_t * win )
Makes window visible to the user.
int show_x11window( x11window_t * x11win )
Free all memory beyond the first new_size bytes.
int ( * shrink ) (void * impl, size_t new_size, /*inout*/struct memstream_t * memstr)
Sets memstr to whole allocated buffer of impl (cstring_t) except for the first new_size bytes.
static int shrink_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Sets memstr to whole allocated buffer of impl (memblock_t) except for the first new_size bytes.
static int shrink_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Sets wbuf->next to start+new_size of static buffer.
static int shrink_static_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Shrinks the size of an already mapped virtual memory block.
int shrink_vmpage( vmpage_t * vmpage, size_t size_in_bytes )
Implements wbuffer_t.shrink_wbuffer.
#define shrink_wbuffer( wbuf, newsize ) ( __extension__ ({ wbuffer_t * _wb = (wbuf) ; _wb->iimpl->shrink(_wb->impl, (newsize), (struct memstream_t*)_wb); }))
Removes the last size_wbuffer(wbuf)-newsize bytes from wbuf.
int shrink_wbuffer( wbuffer_t * wbuf, size_t newsize )
Shrinks the memory block by incr its addr and decr its size.
int shrinkleft_memblock( memblock_t * mblock, size_t addr_increment )
Shrinks size of string by skipping bytes from the start.
int shrinkleft_string( string_t * str, size_t nr_bytes_removed_from_string_start )
Adapts offsets to newprefixlen.
static void shrinkprefix_trienodeoffsets( trie_nodeoffsets_t * offsets, uint8_t newprefixlen )
Keeps first newprefixlen bytes of the key prefix.
static void shrinkprefixkeephead_trienode( trie_node_t * node, uint8_t newprefixlen )
Keeps last newprefixlen bytes of the key prefix.
static void shrinkprefixkeeptail_trienode( trie_node_t * node, uint8_t newprefixlen )
Shrinks the memory block by decrementing only its size.
int shrinkright_memblock( memblock_t * mblock, size_t size_decrement )
Shrinks size of string by decrementing its size.
int shrinkright_string( string_t * str, size_t nr_bytes_removed_from_string_end )
Resize node to a smaller size.
static int shrinksize_trienode( trie_node_t * node )
The absolute value of this number is the number of valid digits.
int16_t sign_and_used_digits
The sign of this variable is the sign of the number.
int8_t sign_and_used_digits
Returns -1, 0 or +1 if big is negative, zero or positive.
int sign_bigint( const bigint_t * big )
Returns -1, 0 or +1 if dec is negative, zero or positive.
int sign_decimal( const decimal_t * dec )
Return the sign of an integer (signum function).
int sign_int( int i )
Signals an exceptional condition.
int signal_fpuexcept( fpu_except_e exception_flags )
Stores setting for every signal handler.
struct sigaction signal_handlers[/*nr_signal_handlers*/]
Wakes up signal_count waiters.
int signal_semaphore( semaphore_t * semaobj, uint32_t signal_count )
Transfers all nodes of syncwlist to an internal wakup_list.
int signalall_syncrun( syncrun_t * srun, struct syncwlist_t * syncwlist )
Stores the referenced waiting syncthread_t in a wakeup queue.
int signalevent_syncrun( syncrun_t * srun, struct syncevent_t * syncevent )
Transfers the first entry of syncwlist to an internal wakup_list.
int signalfirst_syncrun( syncrun_t * srun, struct syncwlist_t * syncwlist )
Export function signature of a signal handler.
typedef void ( * signalhandler_f ) (unsigned signr, uintptr_t value)
Export function signature of segmentation violation (fault) signal handler.
typedef void ( * signalhandler_segv_f ) (void * memaddr, bool ismapped)
Stores signal handler for the whole process.
struct signalhandler_t
The signal mask of the current thread.
sigset_t signalmask
Returns in stackmem the signalstack from tls.
void signalstack_threadtls( const thread_tls_t * tls, /*out*/struct memblock_t * stackmem )
Stores configuration state of signal subsystem.
struct signalstate_t * signalstate
Stores current state of all signal handlers and the signal mask.
struct signalstate_t
Static initializer.
#define signalwait_FREE sys_iochannel_FREE
Manages a set of signals which can be waited on for a read event.
typedef sys_iochannel_t signalwait_t
Length of key in memory in bytes.
size_t size
Size in bytes of this block.
uint32_t size
Holds size in bytes of memory buffer.
uint32_t size
Size in bytes of allocated buffer.
size_t size
Size of memory in bytes addr points to.
size_t size
Size of the mapped memory.
size_t size
Size in bytes of memory.
size_t size
Size in bytes of allocated memory this structure uses.
size_t size
Size in bytes of binary data addr points to.
size_t size
Size of memory in bytes addr points to.
size_t size
Returns number of used bytes.
size_t ( * size ) (void * impl, const struct memstream_t * memstr)
The number of allocated integers in digits.
uint8_t size_allocated
Implements bigint_t.size_bigint.
#define size_bigint( big ) ((uint32_t)exponent_bigint(big) + (uint32_t)nrdigits_bigint(big))
Returns the sum of exponent_bigint and nrdigits_bigint.
uint32_t size_bigint( const bigint_t * big )
This function walks through all allocated blocks and counts the allocated size.
size_t size_binarystack( binarystack_t * stack )
Returns the size of all pushed objects.
size_t size_binarystack( binarystack_t * stack )
Implements cstring_t.size_cstring.
#define size_cstring( cstr ) ((cstr)->size)
Returns the size of the string in bytes.
size_t size_cstring( const cstring_t * cstr )
Returns size in use of impl (cstring_t).
static size_t size_cstring_wbuffer( void * impl, const memstream_t * memstr )
Implements decimal_t.size_decimal.
#define size_decimal( dec ) ((uint8_t)( (dec)->sign_and_used_digits < 0 ? - (dec)->sign_and_used_digits : (dec)->sign_and_used_digits))
Returns number of integers needed to store all decimal digits.
uint8_t size_decimal( decimal_t * dec )
Returns the width and height of eglpbuf in width and height.
int size_eglpbuffer( const eglpbuffer_t eglpbuf, struct opengl_display_t * egldisp, /*out*/uint32_t * width, /*out*/uint32_t * height )
Returns the size in bytes of the file.
int size_file( const file_t fileobj, /*out*/off_t * file_size )
Returns the size in bytes of the header size field.
static uint_fast16_t size_header( unsigned headersize )
Implements memblock_t.size_memblock.
#define size_memblock( mblock ) ((mblock)->size)
Returns size of memory block.
size_t size_memblock( const memblock_t * mblock )
Returns number of appended bytes of impl (memblock_t).
static size_t size_memblock_wbuffer( void * impl, const memstream_t * memstr )
Implements memstream_t.size_memstream.
#define size_memstream( memstr ) ( __extension__ ({ const memstream_t * _m ; _m = (memstr) ; (size_t) (_m->end - _m->next) ; }))
Returns the nuber of unread bytes.
size_t size_memstream( const memstream_t * memstr )
Implements mmfile_t.size_mmfile.
#define size_mmfile( mfile ) ((mfile)->size)
Returns the size of the mapped memory.
size_t size_mmfile( const mmfile_t * mfile )
Implements pixelbuffer_t.size_pixelbuffer.
#define size_pixelbuffer( pbuf, disp, width, height ) size_eglpbuffer(gl_pixelbuffer(pbuf), gl_display(disp), width, height)
Returns the width and height of pbuf.
int size_pixelbuffer( const pixelbuffer_t * pbuf, struct display_t * disp, /*out*/uint32_t * width, /*out*/uint32_t * height )
Returns size of a part of the string at index stridx.
size_t size_splitstring( const splitstring_t * spstr, uint8_t stridx )
Returns number of appended bytes.
static size_t size_static_wbuffer( void * impl, const memstream_t * memstr )
Size in bytes of how much of the static memory is allocated.
uint16_t size_staticmem
Implements string_t.size_string.
#define size_string( str ) ((str)->size)
Returns size in bytes of string.
size_t size_string( const string_t * str )
Implements stringstream_t.size_stringstream.
#define size_stringstream( strstream ) ((size_t)((strstream)->end - (strstream)->next))
Returns the number of unread bytes.
size_t size_stringstream( const stringstream_t * strstream )
Implements thread_tls_t.size_threadtls.
#define size_threadtls( ) (sys_size_threadtls())
Returns the size of the allocated memory block.
size_t size_threadtls( void )
Returns vm_mappedregions_t->total_count.
#define size_vmmappedregions( mappedregions ) ((mappedregions)->total_count)
Returns the total number of contained vm_region_t.
size_t size_vmmappedregions( const vm_mappedregions_t * mappedregions )
Implements wbuffer_t.size_wbuffer.
#define size_wbuffer( wbuf ) ( __extension__ ({ const wbuffer_t * _wb = (wbuf) ; _wb->iimpl->size(_wb->impl, (const struct memstream_t*)_wb) ; }))
Returns the number of appended bytes.
size_t size_wbuffer( const wbuffer_t * wbuf )
Implements window_t.size_window.
#define size_window( win, width, height ) size_x11window(os_window(win), width, height)
Returns the width and height of win in pixels.
int size_window( const window_t * win, /*out*/uint32_t * width, /*out*/uint32_t * height )
Implements x11window_t.size_x11window.
#define size_x11window( x11win, width, height ) (geometry_x11window(x11win, 0, 0, width, height))
Returns the width and height of the window in pixels.
int size_x11window( const x11window_t * x11win, /*out*/uint32_t * width, /*out*/uint32_t * height )
Size of trie_node_t if header_t contains header_SIZE1NODE.
#define SIZE1NODE ( 2*sizeof(trie_node_t*) )
Size of trie_node_t if header_t contains header_SIZE2NODE.
#define SIZE2NODE ( 4*sizeof(trie_node_t*) )
Size of trie_node_t if header_t contains header_SIZE3NODE.
#define SIZE3NODE ( 8*sizeof(trie_node_t*) )
Size of trie_node_t if header_t contains header_SIZE4NODE.
#define SIZE4NODE ( 16*sizeof(trie_node_t*) )
Size of trie_node_t if header_t contains header_SIZE5NODE.
#define SIZE5NODE ( 32*sizeof(trie_node_t*) )
See mm_impl_t.sizeallocated_mmimpl for an implementation.
size_t ( * sizeallocated ) (struct mm_t * mman)
Number of allocated bytes.
size_t sizeallocated
Returns the sum of the size of all allocated pages.
size_t ( * sizeallocated ) (const pagecache_t * pgcache)
Implements mm_t.sizeallocated_mm.
#define sizeallocated_mm( mm ) ((mm).iimpl->sizeallocated((mm).object))
Calls mm->iimpl->sizeallocated with mm->object as first parameter.
size_t sizeallocated_mm( mm_t mm )
REturns number of allocated bytes.
#define SIZEALLOCATED_MM( ) sizeallocated_mm(mm_maincontext())
Returns the size in bytes of all allocated memory blocks.
size_t sizeallocated_mmimpl( mm_impl_t * mman )
Implements pagecache_t.sizeallocated_pagecache.
#define sizeallocated_pagecache( pgcache ) ((pgcache).iimpl->sizeallocated((pgcache).object))
Calls pgcache->iimpl->sizeallocated with pgcache->object as first parameter.
size_t sizeallocated_pagecache( const pagecache_t pgcache )
Returns sum of size of all allocated pages.
#define SIZEALLOCATED_PAGECACHE( ) (sizeallocated_pagecache(pagecache_maincontext()))
Returns the sum of the size of all allocated pages.
size_t sizeallocated_pagecacheimpl( const pagecache_impl_t * pgcache )
Returns the size in bytes of all allocated memory blocks.
size_t sizeallocated_testmm( testmm_t * mman )
Returns size of available physical memory in bytes
ramsize_t sizeavailableram_vm( void )
Returns the size of the decoded string.
size_t sizebase64decode_string( const struct string_t * str )
Implements string_t.sizebase64encode_string.
#define sizebase64encode_string( str ) (4 * ((2 + (str)->size)/3))
Returns the size of the encoded string.
size_t sizebase64encode_string( const struct string_t * str )
TODO: 1.
size_t sizebuffer_filereader( void )
Returns the buffer size in bytes.
size_t sizebuffer_filereader( void )
Returns the size in bytes of uchar as encoded mb-sequence.
uint8_t sizechar_utf8( char32_t uchar )
Implements hwcache_t.sizedataprefetch_hwcache.
#define sizedataprefetch_hwcache( ) (16)
Size of aligned memory block transfered to and from data cache.
uint32_t sizedataprefetch_hwcache( void )
The size in bytes of initqueue_entry_t depending on initargsize.
static inline uint16_t sizeentry_initqueueentry( uint8_t initargsize )
Implements queue_t.sizefirst_queue.
#define sizefirst_queue( queue ) ( __extension__ ({ typeof(queue) _qu = (queue) ; size_t _size ; queue_page_t * _first ; if (_qu->last) { _first = (queue_page_t*) ((queue_page_t*)_qu->last)->next ; _size = _first->end_offset - _first->start_offset ; } else { _size = 0 ; } _size ; }))
Returns the number of bytes allocated on the first memory page.
size_t sizefirst_queue( const queue_t * queue )
Returns in string_t.size the size of the formatted output fields.
int sizeformat_string( /*out*/struct string_t * str, int dummy )
Implements logbuffer_t.sizefree_logbuffer.
#define sizefree_logbuffer( logbuf ) ( __extension__ ({ const logbuffer_t * _lb ; _lb = (logbuf) ; _lb->size - _lb->logsize ; }))
Returns free size usable by the next written entry.
uint32_t sizefree_logbuffer( const logbuffer_t * logbuf )
Calculates unused bytes in node which corresponds to offset.
static uint8_t sizefree_trienodeoffsets( const trie_nodeoffsets_t * offsets )
Returns the size in bytes of a correct encoded mb-sequence by means of the value of its first byte.
uint8_t sizefromfirstbyte_utf8( const uint8_t firstbyte )
Calculates size the prefix could grow without growing the node size.
static uint8_t sizegrowprefix_trienodeoffsets( const trie_nodeoffsets_t * offsets )
Implements queue_t.sizelast_queue.
#define sizelast_queue( queue ) ( __extension__ ({ typeof(queue) _qu = (queue) ; size_t _size ; queue_page_t * _last ; if (_qu->last) { _last = (queue_page_t*)_qu->last ; _size = _last->end_offset - _last->start_offset ; } else { _size = 0 ; } _size ; }))
Returns the number of bytes allocated on the last memory page.
size_t sizelast_queue( const queue_t * queue )
Implements decimal_t.sizemax_decimal.
#define sizemax_decimal( ) ((uint8_t)127)
Returns the maximum number of integers which can be allocated.
uint8_t sizemax_decimal( void )
Same as SIZE5NODE.
#define SIZEMAXNODE SIZE5NODE
Return size in bytes of node.
static inline uint16_t sizenode_header( const header_t header )
Returns size of all physical memory in bytes.
ramsize_t sizephysram_vm( void )
Implements utf8validator_t.sizeprefix_utf8validator.
#define sizeprefix_utf8validator( utf8validator ) ((utf8validator)->size_of_prefix)
Returns a value != 0 if the last multibyte sequence was not fully contained in the last validated buffer.
uint8_t sizeprefix_utf8validator( const utf8validator_t * utf8validator )
Implements wbuffer_t.sizereserved_wbuffer.
#define sizereserved_wbuffer( wbuf ) ( __extension__ ({ const wbuffer_t * _wb2 = (wbuf) ; (size_t) (_wb2->end - _wb2->next) ; }))
Returns the number of allocated bytes which are not in use.
size_t sizereserved_wbuffer( const wbuffer_t * wbuf )
Returns the minimum size of the signal stack.
static inline size_t sizesignalstack_threadtls( const size_t pagesize )
Returns the default size of the thread stack.
static inline size_t sizestack_threadtls( const size_t pagesize )
Number of allocated bytes from static memory.
size_t sizestatic
Size of memory allocated with allocstatic.
size_t ( * sizestatic ) (const pagecache_t * pgcache)
Inline implementation of maincontext_t.sizestatic_maincontext.
#define sizestatic_maincontext( ) (self_maincontext()->size_staticmem)
Returns size in bytes of allocated static memory.
uint16_t sizestatic_maincontext( void )
Implements pagecache_t.sizestatic_pagecache.
#define sizestatic_pagecache( pgcache ) ((pgcache).iimpl->sizestatic((pgcache).object))
Calls pgcache->iimpl->sizestatic with pgcache->object as first parameter.
size_t sizestatic_pagecache( const pagecache_t pgcache )
Returns size of static allocated memory.
#define SIZESTATIC_PAGECACHE( ) (sizestatic_pagecache(pagecache_maincontext()))
Returns wize of memory allocated with allocstatic.
size_t sizestatic_pagecacheimpl( const pagecache_impl_t * pgcache )
The number of bytes which are not read from the current buffer.
size_t sizeunread_utf8scanner( const utf8scanner_t * scan )
Determines url decoded length of parameter str.
size_t sizeurldecode_string( const struct string_t * str )
Determines url encoded length of parameter str.
size_t sizeurlencode_string( const struct string_t * str, uint8_t except_char )
Returns number of usable bytes in the allocated memory block addr.
size_t sizeusable_malloc( void * addr )
Returns the size of all local thread variables on the stack.
static inline size_t sizevars_threadtls( const size_t pagesize )
Skips the next char_count characters.
extern int skip_convertwchar( convert_wchar_t * conv, size_t char_count )
Skips comments until next non space character.
static int skip_spaceandcomment( textresource_reader_t * reader )
Implements utf8reader_t.skipascii_utf8reader.
#define skipascii_utf8reader( utfread ) do { typeof(utfread) _rd1 = (utfread) ; bool _isnext = isnext_utf8reader(_rd1) ; if (_isnext) { incrcolumn_textpos(&_rd1->pos) ; if ('\n' == *(_rd1->next ++)) { incrline_textpos(&_rd1->pos) ; } } } while(0)
Skips next ascii character.
void skipascii_utf8reader( utf8reader_t * utfread )
Implements string_t.skipbyte_string.
#define skipbyte_string( str ) do { ++ (str)->addr ; -- (str)->size ; } while(0)
Increments the start address of the string by one and decrements its size.
void skipbyte_string( string_t * str )
Implements stringstream_t.skipbyte_stringstream.
#define skipbyte_stringstream( strstream ) do { ++ (strstream)->next ; } while(0)
Skips the next unread byte in the input stream.
void skipbyte_stringstream( stringstream_t * strstream )
Implements stringstream_t.skipbytes_stringstream.
#define skipbytes_stringstream( strstream, size ) do { (strstream)->next += (size) ; } while(0)
Skips the next size unread bytes in the input stream.
void skipbytes_stringstream( stringstream_t * strstream, size_t size )
Implements utf8reader_t.skipbytes_utf8reader.
#define skipbytes_utf8reader( utfread, nrbytes, nrchars ) do { typeof(utfread) _rd1 = (utfread) ; size_t _nrb1 = (nrbytes) ; size_t _size = unreadsize_utf8reader(_rd1) ; if (_size >= _nrb1) { _rd1->next += _nrb1 ; addcolumn_textpos(&_rd1->pos,(nrchars)) ; } } while(0)
Skips next nrbytes bytes.
void skipbytes_utf8reader( utf8reader_t * utfread, size_t nrbytes, size_t nrchars )
Increments the read pointer by nrbytes without reading the bytes.
void skipbytes_utf8scanner( utf8scanner_t * scan, size_t nrbytes )
Skips the next utf-8 encoded character.
uint8_t skipchar_utf8( const uint8_t strstart[/*maxsize_utf8() or big enough*/] )
Implements utf8reader_t.skipchar_utf8reader.
#define skipchar_utf8reader( utfread ) ( __extension__ ({ int _err = 0 ; typeof(utfread) _rd1 = (utfread) ; if (isnext_utf8reader(_rd1)) { uint8_t firstbyte = *(_rd1->next) ; if ('\n' == firstbyte) { incrline_textpos(&_rd1->pos) ; ++ _rd1->next ; } else { uint8_t _sz ; _sz = sizefromfirstbyte_utf8( firstbyte) ; if (_sz > (_rd1->end - _rd1->next)) { _err = EILSEQ ; } else { _rd1->next += _sz + (_sz==0) ; incrcolumn_textpos(&_rd1->pos) ; } } } else { _err = ENODATA ; } _err ; }))
Skips next character.
int skipchar_utf8reader( utf8reader_t * utfread )
Increments offset until next non empty data line is found.
static void skipempty_csvfilereaderparsestate( csvfilereader_parsestate_t * state )
Skips bytes until end of stream or the begin of a valid utf-8 encoding is found.
void skipillegalutf8_strstream( struct stringstream_t * strstream )
Skips characters until beginning of next line.
int skipline_utf8reader( utf8reader_t * utfread )
Skips characters until the last skipped character equals uchar.
int skipuntilafter_utf8scanner( utf8scanner_t * scan, struct filereader_t * frd, char32_t uchar )
Implements stringstream_t.skiputf8_stringstream.
#define skiputf8_stringstream( strstream ) ( __extension__ ({ char32_t _uchar ; nextutf8_stringstream( (strstream), &_uchar ) ; }))
Skips next utf-8 encoded character from strstream.
int skiputf8_stringstream( struct stringstream_t * strstream )
Sleeps relative_time seconds (+nanoseconds).
int sleep_sysclock( sysclock_e clock_type, const struct timevalue_t * relative_time )
Sleeps millisec milliseconds.
int sleepms_sysclock( sysclock_e clock_type, uint32_t millisec )
Makes calling thread to sleep msec milli-seconds.
void sleepms_thread( uint32_t msec )
Implements slist_t.slist_IMPLEMENT.
#define slist_IMPLEMENT( _fsuffix, object_t, name_nextptr ) typedef slist_iterator_t iteratortype##_fsuffix ; typedef object_t * iteratedtype##_fsuffix ; static inline int initfirst##_fsuffix##iterator(slist_iterator_t * iter, slist_t * list) __attribute__ ((always_inline)) ; static inline int free##_fsuffix##iterator(slist_iterator_t * iter) __attribute__ ((always_inline)) ; static inline bool next##_fsuffix##iterator(slist_iterator_t * iter, object_t ** node) __attribute__ ((always_inline)) ; static inline void init##_fsuffix(slist_t * list) __attribute__ ((always_inline)) ; static inline int free##_fsuffix(slist_t * list, struct typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int isempty##_fsuffix(const slist_t * list) __attribute__ ((always_inline)) ; static inline object_t * first##_fsuffix(const slist_t * list) __attribute__ ((always_inline)) ; static inline object_t * last##_fsuffix(const slist_t * list) __attribute__ ((always_inline)) ; static inline object_t * next##_fsuffix(object_t * node) __attribute__ ((always_inline)) ; static inline bool isinlist##_fsuffix(object_t * node) __attribute__ ((always_inline)) ; static inline void insertfirst##_fsuffix(slist_t * list, object_t * new_node) __attribute__ ((always_inline)) ; static inline void insertlast##_fsuffix(slist_t * list, object_t * new_node) __attribute__ ((always_inline)) ; static inline void insertafter##_fsuffix(slist_t * list, object_t * prev_node, object_t * new_node) __attribute__ ((always_inline)) ; static inline int removefirst##_fsuffix(slist_t * list, object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int removeafter##_fsuffix(slist_t * list, object_t * prev_node, object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int removeall##_fsuffix(slist_t * list, struct typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline slist_node_t * asnode##_fsuffix(object_t * object) { static_assert(&((object_t*)0)->name_nextptr == (slist_node_t**)offsetof(object_t, name_nextptr), "correct type") ; return (slist_node_t *) ((uintptr_t)object + offsetof(object_t, name_nextptr)) ; } static inline object_t * asobject##_fsuffix(slist_node_t * node) { return (object_t *) ((uintptr_t)node - offsetof(object_t, name_nextptr)) ; } static inline object_t * asobjectnull##_fsuffix(slist_node_t * node) { return node ? (object_t *) ((uintptr_t)node - offsetof(object_t, name_nextptr)) : 0 ; } static inline void init##_fsuffix(slist_t * list) { init_slist(list) ; } static inline void initsingle##_fsuffix(slist_t * list, object_t * node) { initsingle_slist(list, asnode##_fsuffix(node)) ; } static inline int free##_fsuffix(slist_t * list, struct typeadapt_t * typeadp) { return free_slist(list, offsetof(object_t, name_nextptr), typeadp) ; } static inline int isempty##_fsuffix(const slist_t * list) { return isempty_slist(list) ; } static inline object_t * first##_fsuffix(const slist_t * list) { return asobjectnull##_fsuffix(first_slist(list)) ; } static inline object_t * last##_fsuffix(const slist_t * list) { return asobjectnull##_fsuffix(last_slist(list)) ; } static inline object_t * next##_fsuffix(object_t * node) { return asobject##_fsuffix(next_slist(asnode##_fsuffix(node))) ; } static inline bool isinlist##_fsuffix(object_t * node) { return isinlist_slist(asnode##_fsuffix(node)) ; } static inline void insertfirst##_fsuffix(slist_t * list, object_t * new_node) { insertfirst_slist(list, asnode##_fsuffix(new_node)) ; } static inline void insertlast##_fsuffix(slist_t * list, object_t * new_node) { insertlast_slist(list, asnode##_fsuffix(new_node)) ; } static inline void insertafter##_fsuffix(slist_t * list, object_t * prev_node, object_t * new_node) { insertafter_slist(list, asnode##_fsuffix(prev_node), asnode##_fsuffix(new_node)) ; } static inline int removefirst##_fsuffix(slist_t * list, object_t ** removed_node) { int err = removefirst_slist(list, (slist_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(slist_node_t**)removed_node) ; return err ; } static inline int removeafter##_fsuffix(slist_t * list, object_t * prev_node, object_t ** removed_node) { int err = removeafter_slist(list, asnode##_fsuffix(prev_node), (slist_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(slist_node_t**)removed_node) ; return err ; } static inline int removeall##_fsuffix(slist_t * list, struct typeadapt_t * typeadp) { return removeall_slist(list, offsetof(object_t, name_nextptr), typeadp) ; } static inline int initfirst##_fsuffix##iterator(slist_iterator_t * iter, slist_t * list) { return initfirst_slistiterator(iter, list) ; } static inline int free##_fsuffix##iterator(slist_iterator_t * iter) { return free_slistiterator(iter) ; } static inline bool next##_fsuffix##iterator(slist_iterator_t * iter, object_t ** node) { bool isNext = next_slistiterator(iter, (slist_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(slist_node_t**)node) ; return isNext ; }
Generates interface of single linked list storing elements of type object_t.
void slist_IMPLEMENT( IDNAME _fsuffix, TYPENAME object_t, IDNAME name_nextptr ) ;
Static initializer.
#define slist_INIT { (void*)0 }
Static initializer.
#define slist_iterator_FREE { 0, 0 }
Iterates over elements contained in slist_t.
struct slist_iterator_t
Allows to embed members of slist_node_t into another structure.
#define slist_node_EMBED( name_nextptr ) slist_node_t * name_nextptr
Static initializer.
#define slist_node_INIT { 0 }
Provides the means for linking an object to another of the same type.
struct slist_node_t
Points to last object in a list of objects.
struct slist_t
Implements mutex_t.slock_mutex.
#define slock_mutex( /*mutex_t * */mutex ) (assert(!lock_mutex(mutex))) ;
Same as lock_mutex.
void slock_mutex( mutex_t * mutex )
Implements thrmutex_t.slock_thrmutex.
#define slock_thrmutex( mutex ) (assert(!lock_thrmutex(mutex)))
Calls lock_thrmutex and asserts success.
void slock_thrmutex( thrmutex_t * mutex )
Implements rwlock_t.slockreader_rwlock.
#define slockreader_rwlock( rwlock ) (assert(!lockreader_rwlock(rwlock)))
Asserts that lockreader_rwlock has no error.
void slockreader_rwlock( rwlock_t * rwlock )
Implements rwlock_t.slockwriter_rwlock.
#define slockwriter_rwlock( rwlock ) (assert(!lockwriter_rwlock(rwlock)))
Asserts that lockwriter_rwlock has no error.
void slockwriter_rwlock( rwlock_t * rwlock )
Searches for a node X with key ‘key’ and makes it the new root of the tree.
static int splaykey_splaytree( splaytree_t * tree, const void * key, uint16_t nodeoffset, typeadapt_t * typeadp )
Same as splaykey_splaytree except node is used as key.
static int splaynode_splaytree( splaytree_t * tree, const splaytree_node_t * keynode, /*out*/int * rootcmp, uint16_t nodeoffset, typeadapt_t * typeadp )
Static initializer: After assigning you can call free_splaytree without harm.
#define splaytree_FREE splaytree_INIT( )
Implements splaytree_t.splaytree_IMPLEMENT.
#define splaytree_IMPLEMENT( _fsuffix, object_t, key_t, nodename ) typedef splaytree_iterator_t iteratortype##_fsuffix ; typedef object_t * iteratedtype##_fsuffix ; static inline int initfirst##_fsuffix##iterator(splaytree_iterator_t * iter, splaytree_t * tree, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int initlast##_fsuffix##iterator(splaytree_iterator_t * iter, splaytree_t * tree, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int free##_fsuffix##iterator(splaytree_iterator_t * iter) __attribute__ ((always_inline)) ; static inline bool next##_fsuffix##iterator(splaytree_iterator_t * iter, object_t ** node) __attribute__ ((always_inline)) ; static inline bool prev##_fsuffix##iterator(splaytree_iterator_t * iter, object_t ** node) __attribute__ ((always_inline)) ; static inline void init##_fsuffix(/*out*/splaytree_t * tree) __attribute__ ((always_inline)) ; static inline int free##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline void getinistate##_fsuffix(const splaytree_t * tree, /*out*/object_t ** root) __attribute__ ((always_inline)) ; static inline bool isempty##_fsuffix(const splaytree_t * tree) __attribute__ ((always_inline)) ; static inline int find##_fsuffix(splaytree_t * tree, const key_t key, /*out*/object_t ** found_node, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int insert##_fsuffix(splaytree_t * tree, object_t * new_node, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int remove##_fsuffix(splaytree_t * tree, object_t * node, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int removenodes##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int invariant##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline splaytree_node_t * asnode##_fsuffix(object_t * object) { static_assert(&((object_t*)0)->nodename == (splaytree_node_t*)offsetof(object_t, nodename), "correct type") ; return (splaytree_node_t *) ((uintptr_t)object + offsetof(object_t, nodename)) ; } static inline object_t * asobject##_fsuffix(splaytree_node_t * node) { return (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) ; } static inline object_t * asobjectnull##_fsuffix(splaytree_node_t * node) { return node ? (object_t *) ((uintptr_t)node - offsetof(object_t, nodename)) : 0 ; } static inline void init##_fsuffix(/*out*/splaytree_t * tree) { init_splaytree(tree) ; } static inline int free##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) { return free_splaytree(tree, offsetof(object_t, nodename), typeadp) ; } static inline void getinistate##_fsuffix(const splaytree_t * tree, /*out*/object_t ** root) { splaytree_node_t * rootnode ; getinistate_splaytree(tree, &rootnode) ; *root = asobjectnull##_fsuffix(rootnode) ; } static inline bool isempty##_fsuffix(const splaytree_t * tree) { return isempty_splaytree(tree) ; } static inline int find##_fsuffix(splaytree_t * tree, const key_t key, /*out*/object_t ** found_node, typeadapt_t * typeadp) { int err = find_splaytree(tree, (void*)key, (splaytree_node_t**)found_node, offsetof(object_t, nodename), typeadp) ; if (err == 0) *found_node = asobject##_fsuffix(*(splaytree_node_t**)found_node) ; return err ; } static inline int insert##_fsuffix(splaytree_t * tree, object_t * new_node, typeadapt_t * typeadp) { return insert_splaytree(tree, asnode##_fsuffix(new_node), offsetof(object_t, nodename), typeadp) ; } static inline int remove##_fsuffix(splaytree_t * tree, object_t * node, typeadapt_t * typeadp) { int err = remove_splaytree(tree, asnode##_fsuffix(node), offsetof(object_t, nodename), typeadp) ; return err ; } static inline int removenodes##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) { return removenodes_splaytree(tree, offsetof(object_t, nodename), typeadp) ; } static inline int invariant##_fsuffix(splaytree_t * tree, typeadapt_t * typeadp) { return invariant_splaytree(tree, offsetof(object_t, nodename), typeadp) ; } static inline int initfirst##_fsuffix##iterator(splaytree_iterator_t * iter, splaytree_t * tree, typeadapt_t * typeadp) { return initfirst_splaytreeiterator(iter, tree, offsetof(object_t, nodename), typeadp) ; } static inline int initlast##_fsuffix##iterator(splaytree_iterator_t * iter, splaytree_t * tree, typeadapt_t * typeadp) { return initlast_splaytreeiterator(iter, tree, offsetof(object_t, nodename), typeadp) ; } static inline int free##_fsuffix##iterator(splaytree_iterator_t * iter) { return free_splaytreeiterator(iter) ; } static inline bool next##_fsuffix##iterator(splaytree_iterator_t * iter, object_t ** node) { bool isNext = next_splaytreeiterator(iter, (splaytree_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(splaytree_node_t**)node) ; return isNext ; } static inline bool prev##_fsuffix##iterator(splaytree_iterator_t * iter, object_t ** node) { bool isNext = prev_splaytreeiterator(iter, (splaytree_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(splaytree_node_t**)node) ; return isNext ; }
Generates interface of splaytree_t storing elements of type object_t.
void splaytree_IMPLEMENT( IDNAME _fsuffix, TYPENAME object_t, TYPENAME key_t, IDNAME nodename ) ;
Static initializer.
#define splaytree_INIT( root ) { root }
Static initializer.
#define splaytree_iterator_FREE { 0, 0, 0, 0 }
Iterates over elements contained in splaytree_t.
struct splaytree_iterator_t
Rename lrtree_node_t into splaytree_node_t.
typedef struct lrtree_node_t splaytree_node_t
Implements a splay tree index.
struct splaytree_t
The node in pos (see suffixtree_pos_t.node) is splitted into two nodes.
static int splitnode_suffixtree( suffixtree_t * tree, suffixtree_pos_t * pos )
Static initializer.
#define splitstring_FREE { { string_FREE, string_FREE }, 0 }
Stores two contiguous sub strings.
struct splitstring_t
Returns the square root of an unsigned integer number.
unsigned sqroot_int( unsigned number )
Implements the High School Square Root Algorithm for 32 bit unsigned integer.
uint16_t sqroot_int32( uint32_t number )
Returns the square root from an unsigned 32 bit integer.
uint16_t sqroot_int32( uint32_t number )
Implements the High School Square Root Algorithm for 64 bit unsigned integer.
uint32_t sqroot_int64( uint64_t number )
Returns the square root from an unsigned 64 bit integer.
uint32_t sqroot_int64( uint64_t number )
Remembers last position in tree.
struct binarystack_t * stack
Remembers last position in tree.
struct binarystack_t * stack
Offset of first node relative to start address of this object.
uint32_t start_offset
This function starts (arms) a one shot timer.
int start_systimer( systimer_t timer, struct timevalue_t * relative_time )
This function starts (arms) a periodic timer.
int startinterval_systimer( systimer_t timer, struct timevalue_t * interval_time )
Starts a new syncthread_t and stores it in srun’s initqueue.
int startthread_syncrun( syncrun_t * srun, syncrun_f mainfct, void * initarg )
Starts a new syncthread_t and stores it in srun’s initqueue.
int startthread2_syncrun( syncrun_t * srun, syncrun_f mainfct, uint8_t initargsize, /*out*/void ** initarg )
state[0] holds the result of the first division.
decimal_frombigint_state_t state[7]
Either process_state_TERMINATED or process_state_ABORTED.
process_state_e state
Holds pointer to variables, or init argument or execution state internal to mainfct.
void * state
Current state of window (shown, hidden, destroyed).
uint8_t state
Returns current state of process.
int state_process( process_t * process, /*out*/process_state_e * current_state )
Implements syncthread_t.state_syncthread.
#define state_syncthread( sthread ) ((void*)((sthread)->state))
Returns syncthread_t.state from sthread.
void * state_syncthread( syncthread_t * sthread )
Implements x11window_t.state_x11window.
#define state_x11window( x11win ) ((x11window_state_e)(x11win)->state)
Returns the state of the window as seen by the user.
x11window_state_e state_x11window( const x11window_t * x11win )
Checks condition to be true during compilation.
#define static_assert( C, S ) ((void)(sizeof(char[(C)?1:-1])))
Header of last allocated static memory page.
struct staticpage_t
A list of static memory blocks.
struct { struct dlist_node_t * last ; } staticpagelist
Stops a timer.
int stop_systimer( systimer_t timer )
Additional space used by socket addr version with maximum size.
uint8_t storage[sys_socketaddr_MAXSIZE - sizeof(sys_socketaddr_t)]
Makes string token out of argument.
#define STR( S1 ) STR2(S1)
Implements cstring_t.str_cstring.
#define str_cstring( cstr ) ((char*)(cstr)->chars)
Returns ‘\0’ terminated string.
char * str_cstring( cstring_t * cstr )
Implements errorcontext_t.str_errorcontext.
#define str_errorcontext( errcontext, errnum ) ( __extension__ ({ unsigned _errnum = (unsigned) (errnum) ; (errcontext).strdata + (errcontext).stroffset[ (_errnum > 511 ? 511 : _errnum)] ; }))
Returns the error description of errnum as a null terminated C string.
const uint8_t * str_errorcontext( const errorcontext_t errcontext, int errnum )
Length in bytes of str_start.
size_t str_size
Returns the size of the string this node or leaf matches.
#define STR_SIZE( leaf ) ((leaf)->str_size >> 1)
Start address of matched string.
const uint8_t * str_start
Returns the start address of the string this node or leaf matches.
#define STR_START( leaf ) ((leaf)->str_start)
Used by STR to ensure expansion of arguments.
#define STR2( S1 ) # S1
String table with system error descriptions in english.
uint8_t * strdata
Static initializer.
#define string_field_INIT_EMPTY { string_field_EMPTY, { 0 } }
struct string_field_t
Static initializer.
#define string_FREE { 0, 0 }
Static initializer.
#define string_INIT( strsize, straddr ) { (straddr), (strsize) }
Static initializer.
#define string_INIT_CSTR( cstr ) { (const uint8_t*)(cstr), strlen(cstr) }
Points to memory which contains a constant string.
struct string_t
Implements arraystf_node_t.stringcast_arraystfnode.
#define stringcast_arraystfnode( str ) ( __extension__ ({ struct string_t * _str1 = (str) ; (arraystf_node_t*) (_str1) ; }))
Cast string_t into arraystf_node_t.
arraystf_node_t * stringcast_arraystfnode( struct string_t * str )
The array of noncontinuous parts the string is composed of.
string_t stringpart[2]
Static initializer.
#define stringstream_FREE stringstream_INIT( 0, )
Static initializer.
#define stringstream_INIT( startaddr, endaddr ) { startaddr, endaddr }
This objects streams a string of bytes byte-by-byte.
struct stringstream_t
Table with offset values relative to strdata.
uint16_t * stroffset
Implements filepath_static_t.STRPARAM_filepathstatic.
#define STRPARAM_filepathstatic( fpath ) (fpath)->workdir, (fpath)->filename
This macro returns two string parameter describing path of working directory and filename.
void STRPARAM_filepathstatic( const filepath_static_t * fpath )
Export alignedexpandshift_t into global namespace.
typedef struct alignedexpandshift_t alignedexpandshift_t
Export arraysf_iterator_t, iterator type to iterate of contained nodes.
typedef struct arraysf_iterator_t arraysf_iterator_t
Export arraysf_mwaybranch_t.
typedef struct arraysf_mwaybranch_t arraysf_mwaybranch_t
Export arraysf_node_t.
typedef struct arraysf_node_t arraysf_node_t
Exports arraysf_t.
typedef struct arraysf_t arraysf_t
Export arraystf_iterator_t, iterator type to iterate of contained nodes.
typedef struct arraystf_iterator_t arraystf_iterator_t
Exports <arraystf_mwaybranch_t>i.
typedef struct arraystf_mwaybranch_t arraystf_mwaybranch_t
Export arraystf_node_t.
typedef struct arraystf_node_t arraystf_node_t
Export arraystf_t.
typedef struct arraystf_t arraystf_t
Export bigint_divstate_t into global namespace.
typedef struct bigint_divstate_t bigint_divstate_t
Export bigint_fixed_t.
typedef struct bigint_fixed_t bigint_fixed_t
Export bigint_t.
typedef struct bigint_t bigint_t
Export binarystack_t into global namespace.
typedef struct binarystack_t binarystack_t
Export blockarray_t into global namespace.
typedef struct blockarray_t blockarray_t
Exports convert_wchar_t.
typedef struct convert_wchar_t convert_wchar_t
Export crc32_t into global namespace.
typedef struct crc32_t crc32_t
Export cstring_t.
typedef struct cstring_t cstring_t
Export csvfilereader_t into global namespace.
typedef struct csvfilereader_t csvfilereader_t
Export datablock_t into global namespace.
typedef struct datablock_t datablock_t
Export decimal_divstate_t into global namespace.
typedef struct decimal_divstate_t decimal_divstate_t
Export decimal_frombigint_state_t into global namespace.
typedef struct decimal_frombigint_state_t decimal_frombigint_state_t
Export decimal_frombigint_t into global namespace.
typedef struct decimal_frombigint_t decimal_frombigint_t
Export opaque directory_t to read/write a directory in the file system.
typedef struct directory_t directory_t
Export display_t into global namespace.
typedef struct display_t display_t
Export dlist_iterator_t.
typedef struct dlist_iterator_t dlist_iterator_t
Export dlist_node_t into global namespace.
typedef struct dlist_node_t dlist_node_t
Export dlist_t into global namespace.
typedef struct dlist_t dlist_t
Export errorcontext_t into global namespace.
typedef struct errorcontext_t errorcontext_t
Export exthash_iterator_t into global namespace.
typedef struct exthash_iterator_t exthash_iterator_t
Export exthash_t into global namespace.
typedef struct exthash_t exthash_t
Export filepath_static_t into global namespace.
typedef struct filepath_static_t filepath_static_t
Export filereader_t into global namespace.
typedef struct filereader_t filereader_t
Export type freepage_t into global namespace.
typedef struct freepage_t freepage_t
Export gconfig_t into global namespace.
typedef struct gconfig_t gconfig_t
Export gcontext_t into global namespace.
typedef struct gcontext_t gcontext_t
Export hwcache_t into global namespace.
typedef struct hwcache_t hwcache_t
Exports initqueue_entry_t into global namespace.
typedef struct initqueue_entry_t initqueue_entry_t
Export int_t into global namespace.
typedef struct int_t int_t
Define generic type iobj_it which is only used in the declaration of iobj_t.
typedef struct iobj_it iobj_it
Export iobj_t into global namespace.
typedef struct iobj_t iobj_t
Export iocallback_t.
typedef struct iocallback_t iocallback_t
Exports ioevent_t.
typedef struct ioevent_t ioevent_t
Export iopoll_t into global namespace.
typedef struct iopoll_t iopoll_t
Export ipaddr_list_t.
typedef struct ipaddr_list_t ipaddr_list_t
Export ipaddr_storage_t to allow static allocation of an ipaddr_t.
typedef struct ipaddr_storage_t ipaddr_storage_t
Export ipaddr_t.
typedef struct ipaddr_t ipaddr_t
Exports ipsocket_async_t to asynchronously establish a connection.
typedef struct ipsocket_async_t ipsocket_async_t
Export log_header_t.
typedef struct log_header_t log_header_t
Export interface log_it.
typedef struct log_it log_it
Export log_t.
typedef struct log_t log_t
Export logbuffer_t into global namespace.
typedef struct logbuffer_t logbuffer_t
Exports logwriter_chan_t.
typedef struct logwriter_chan_t logwriter_chan_t
Exports logwriter_t.
typedef struct logwriter_t logwriter_t
Export lrptree_node_t into global namespace.
typedef struct lrptree_node_t lrptree_node_t
Export lrtree_node_t into global namespace.
typedef struct lrtree_node_t lrtree_node_t
Export maincontext_startparam_t.
typedef struct maincontext_startparam_t maincontext_startparam_t
Export maincontext_t.
typedef struct maincontext_t maincontext_t
Export memblock_t.
typedef struct memblock_t memblock_t
Export memstream_t into global namespace.
typedef struct memstream_t memstream_t
Exports mm_impl_t.
typedef struct mm_impl_t mm_impl_t
Export interface mm_it.
typedef struct mm_it mm_it
Export mm_t.
typedef struct mm_t mm_t
Exports mmfile_t.
typedef struct mmfile_t mmfile_t
Export module_t into global namespace.
typedef struct module_t module_t
Export objectcache_impl_t.
typedef struct objectcache_impl_t objectcache_impl_t
Export interface objectcache_it.
typedef struct objectcache_it objectcache_it
Export objectcache_t.
typedef struct objectcache_t objectcache_t
Export <opengl_config_t > into global namespace.
typedef struct opengl_config_t * opengl_config_t
Export opaque type pagecache_block_t into global namespace.
typedef struct pagecache_block_t pagecache_block_t
Export type pagecache_blockmap_t into global namespace.
typedef struct pagecache_blockmap_t pagecache_blockmap_t
Export pagecache_impl_t into global namespace.
typedef struct pagecache_impl_t pagecache_impl_t
Export pagecache_it into global namespace.
typedef struct pagecache_it pagecache_it
Export pagecache_t into global namespace.
typedef struct pagecache_t pagecache_t
Exports patriciatrie_iterator_t into global namespace.
typedef struct patriciatrie_iterator_t patriciatrie_iterator_t
Export patriciatrie_node_t into global namespace.
typedef struct patriciatrie_node_t patriciatrie_node_t
Exports patriciatrie_prefixiter_t into global namespace.
typedef struct patriciatrie_prefixiter_t patriciatrie_prefixiter_t
Exports patriciatrie_t into global namespace.
typedef struct patriciatrie_t patriciatrie_t
Export pixelbuffer_t into global namespace.
typedef struct pixelbuffer_t pixelbuffer_t
Export process_result_t into global namespace.
typedef struct process_result_t process_result_t
Export process_stdio_t into global namespace.
typedef struct process_stdio_t process_stdio_t
Export processcontext_t.
typedef struct processcontext_t processcontext_t
Export ptrblock_t into global namespace.
typedef struct ptrblock_t ptrblock_t
Export queue_iterator_t into global namespace.
typedef struct queue_iterator_t queue_iterator_t
Export queue_page_t into global namespace.
typedef struct queue_page_t queue_page_t
Export queue_t into global namespace.
typedef struct queue_t queue_t
Export redblacktree_iterator_t.
typedef struct redblacktree_iterator_t redblacktree_iterator_t
Export redblacktree_t into global namespace.
typedef struct redblacktree_t redblacktree_t
Exports resourceusage_t.
typedef struct resourceusage_t resourceusage_t
Exports run2queue_entry_t into global namespace.
typedef struct run2queue_entry_t run2queue_entry_t
Export rwlock_t into global namespace.
typedef struct rwlock_t rwlock_t
Export semaphore_t.
typedef struct semaphore_t semaphore_t
Export sha1_hash_t into global namespace.
typedef struct sha1_hash_t sha1_hash_t
Export signalhandler_t into global namespace.
typedef struct signalhandler_t signalhandler_t
Export signalstate_t.
typedef struct signalstate_t signalstate_t
Export slist_iterator_t.
typedef struct slist_iterator_t slist_iterator_t
Exports slist_node_t.
typedef struct slist_node_t slist_node_t
Export slist_t.
typedef struct slist_t slist_t
Export splaytree_iterator_t.
typedef struct splaytree_iterator_t splaytree_iterator_t
Export splaytree_t into global namespace.
typedef struct splaytree_t splaytree_t
Export splitstring_t into global namespace.
typedef struct splitstring_t splitstring_t
Export type staticpage_t into global namespace.
typedef struct staticpage_t staticpage_t
typedef struct string_field_t string_field_t
Export string_t.
typedef struct string_t string_t
Export stringstream_t into global namespace.
typedef struct stringstream_t stringstream_t
Shortcut for suffixtree_addstate_t.
typedef struct suffixtree_addstate_t suffixtree_addstate_t
Shortcut for suffixtree_iterator_t.
typedef struct suffixtree_iterator_t suffixtree_iterator_t
Shortcut for suffixtree_leaf_t.
typedef struct suffixtree_leaf_t suffixtree_leaf_t
Shortcut for suffixtree_node_t.
typedef struct suffixtree_node_t suffixtree_node_t
Shortcut for suffixtree_pos_t.
typedef struct suffixtree_pos_t suffixtree_pos_t
Exports suffixtree_t.
typedef struct suffixtree_t suffixtree_t
Export surface_t into global namespace.
typedef struct surface_t surface_t
Export syncevent_t into global namespace.
typedef struct syncevent_t syncevent_t
Export syncqueue_t into global namespace.
typedef struct syncqueue_t syncqueue_t
Export syncrun_t into global namespace.
typedef struct syncrun_t syncrun_t
Export syncthread_t into global namespace.
typedef struct syncthread_t syncthread_t
Export syncwait_t into global namespace.
typedef struct syncwait_t syncwait_t
Export syncwlist_iterator_t into global namespace.
typedef struct syncwlist_iterator_t syncwlist_iterator_t
Export syncwlist_t into global namespace.
typedef struct syncwlist_t syncwlist_t
Export sysuser_info_t into global namespace.
typedef struct sysuser_info_t sysuser_info_t
Export sysuser_t into global namespace.
typedef struct sysuser_t sysuser_t
Export test_errortimer_t.
typedef struct test_errortimer_t test_errortimer_t
Shortcut for testmm_block_t.
typedef struct testmm_block_t testmm_block_t
Shortcut for testmm_page_t.
typedef struct testmm_page_t testmm_page_t
Exports testmm_t.
typedef struct testmm_t testmm_t
Export testmodule_functable_t into global namespace.
typedef struct testmodule_functable_t testmodule_functable_t
Export textpos_t into global namespace.
typedef struct textpos_t textpos_t
Export thread_t.
typedef struct thread_t thread_t
Export thread_tls_t into global namespace.
typedef struct thread_tls_t thread_tls_t
Export threadcontext_t.
typedef struct threadcontext_t threadcontext_t
Export thrmutex_t into global namespace.
typedef struct thrmutex_t thrmutex_t
Exports timevalue_t.
typedef struct timevalue_t timevalue_t
Export trie_t into global namespace.
typedef struct trie_t trie_t
Export typeadapt_binarykey_t into global namespace.
typedef struct typeadapt_binarykey_t typeadapt_binarykey_t
Export typeadapt_comparator_it into global namespace.
typedef struct typeadapt_comparator_it typeadapt_comparator_it
Export typeadapt_gethash_it into global namespace.
typedef struct typeadapt_gethash_it typeadapt_gethash_it
Export typeadapt_getkey_it into global namespace.
typedef struct typeadapt_getkey_it typeadapt_getkey_it
Export typeadapt_impl_t into global namespace.
typedef struct typeadapt_impl_t typeadapt_impl_t
Export typeadapt_lifetime_it into global namespace.
typedef struct typeadapt_lifetime_it typeadapt_lifetime_it
Export typeadapt_t into global namespace.
typedef struct typeadapt_t typeadapt_t
Exports url_t.
typedef struct url_t url_t
Exports utf8reader_t.
typedef struct utf8reader_t utf8reader_t
Export utf8scanner_t into global namespace.
typedef struct utf8scanner_t utf8scanner_t
Export utf8validator_t into global namespace.
typedef struct utf8validator_t utf8validator_t
Exports valuecache_t.
typedef struct valuecache_t valuecache_t
Exports vm_mappedregions_t, description of all mapped memory.
typedef struct vm_mappedregions_t vm_mappedregions_t
Exports vm_region_t, describes a single virtual memory region.
typedef struct vm_region_t vm_region_t
Internal type used by vm_mappedregions_t.
typedef struct vm_regionsarray_t vm_regionsarray_t
Exports vmpage_t into global namespace.
typedef struct vmpage_t vmpage_t
Exports wait2queue_entry_t into global namespace.
typedef struct wait2queue_entry_t wait2queue_entry_t
Exports waitlist_t.
typedef struct waitlist_t waitlist_t
Exports waitqueue_entry_t into global namespace.
typedef struct waitqueue_entry_t waitqueue_entry_t
Export interface wbuffer_it.
typedef struct wbuffer_it wbuffer_it
Export wbuffer_t.
typedef struct wbuffer_t wbuffer_t
Export window_evh_t into global namespace.
typedef struct window_evh_t window_evh_t
Export window_t into global namespace.
typedef struct window_t window_t
Export windowconfig_t into global namespace.
typedef struct windowconfig_t windowconfig_t
Export wlistentry_t into global namespace.
typedef struct wlistentry_t wlistentry_t
Export x11dblbuffer_t into global namespace.
typedef struct x11dblbuffer_t x11dblbuffer_t
Export x11display_t into global namespace.
typedef struct x11display_t x11display_t
Export x11drawable_t into global namespace.
typedef struct x11drawable_t x11drawable_t
Export x11extension_t into global namespace.
typedef struct x11extension_t x11extension_t
Export x11screen_t into global namespace.
typedef struct x11screen_t x11screen_t
Export x11videomode_iterator_t into global namespace.
typedef struct x11videomode_iterator_t x11videomode_iterator_t
Export x11videomode_t into global namespace.
typedef struct x11videomode_t x11videomode_t
Export x11window_evh_t into global namespace.
typedef struct x11window_evh_t x11window_evh_t
Export x11window_t into global namespace.
typedef struct x11window_t x11window_t
Converts pointer to member of structure to pointer of containing structure.
#define structof( struct_t, member, ptrmember ) ( __extension__ ({ typeof(((struct_t*)0)->member) * _ptr2 ; _ptr2 = (ptrmember) ; (struct_t*) ((uintptr_t)_ptr2 - offsetof(struct_t, member)) ; }))
Subtracts the third from the 2nd parameter and returns the difference in the first.
int sub_bigint( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Subtracts two integers.
static int sub_biginthelper( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Subracts the third from the second parameter and returns the difference in the first.
int sub_decimal( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec )
Implements subtraction of two decimal numbers.
static int sub_decimalhelper( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec )
Computes ldigits[*]-=nextdigit*rdigits[*] and corrects nextdigits with -1 if necessary.
static void submul_biginthelper( bigint_divstate_t * state )
Computes »ldigits[*]-=nextdigit*rdigits[*]« and corrects nextdigit with -1 if necessary.
static void submul_decimalhelper( decimal_divstate_t * state )
Returns address of subnode member.
static inline trie_subnode_t ** subnode_trienodeoffsets( const trie_nodeoffsets_t * offsets, trie_nodedata_t * data )
The string is made a substring of itself.
int substr_string( string_t * str, size_t start_offset, size_t size )
Returns 0 if async connect completed.
int success_ipsocketasync( ipsocket_async_t * ipsockasync )
The string which describes the current suffix.
string_t suffix
Points to node which matches same string with this node except without the first character.
suffixtree_node_t * suffix_link
Static initializer.
#define suffixtree_addstate_INIT( strsize, straddr ) { suffixtree_pos_INIT, string_INIT(strsize,straddr) }
Holds the position in suffixtree_t and the next character to be added.
struct suffixtree_addstate_t
Static initializer.
#define suffixtree_FREE { (void*)0, 0 }
Stores position in suffixtree_t which has to be visited next.
struct suffixtree_iterator_t
Allows to embed all data fields of suffixtree_leaf_t into another structure.
#define suffixtree_leaf_EMBED() suffixtree_node_t * next_child ; const uint8_t * str_start ; size_t str_size
Inherit all data fields from suffixtree_leaf_t.
suffixtree_leaf_EMBED()
A node in suffixtree_t which has no childs.
struct suffixtree_leaf_t
A node in suffixtree_t which has childs.
struct suffixtree_node_t
Static initializer.
#define suffixtree_pos_INIT { 0, NULL, NULL }
Describes a position in suffixtree_t.
struct suffixtree_pos_t
A suffix tree contains a set of connected nodes and a reference to the input text.
struct suffixtree_t
Implements mutex_t.sunlock_mutex.
#define sunlock_mutex( /*mutex_t * */mutex ) (assert(!unlock_mutex(mutex))) ;
Same as unlock_mutex.
void sunlock_mutex( mutex_t * mutex )
Implements thrmutex_t.sunlock_thrmutex.
#define sunlock_thrmutex( mutex ) (assert(!unlock_thrmutex(mutex)))
Calls sunlock_thrmutex and asserts success.
void sunlock_thrmutex( thrmutex_t * mutex )
Implements rwlock_t.sunlockreader_rwlock.
#define sunlockreader_rwlock( rwlock ) (assert(!unlockreader_rwlock(rwlock)))
Asserts that unlockreader_rwlock has no error.
void sunlockreader_rwlock( rwlock_t * rwlock )
Implements rwlock_t.sunlockwriter_rwlock.
#define sunlockwriter_rwlock( rwlock ) (assert(!unlockwriter_rwlock(rwlock)))
Asserts that unlockwriter_rwlock has no error.
void sunlockwriter_rwlock( rwlock_t * rwlock )
Inherits from surface_t by embedding all data fields.
#define surface_EMBED struct opengl_surface_t * glsurface
Static initializer.
#define surface_FREE { 0 }
Static initializer for types which inherit from surface_t with surface_EMBED.
#define surface_FREE_EMBEDDED 0
Wraps a native OpenGL surface (frame buffer).
struct surface_t
The calling thread will sleep until resume_thread is called.
void suspend_thread( void )
Swaps content of two local variables.
#define SWAP( var1, var2 ) { typeof(var1) _temp ; _temp = (var1), (var1) = (var2), (var2) = _temp ; }
Swaps the content of the back and from buffer.
int swapbuffer_eglwindow( eglwindow_t eglwin, struct opengl_display_t * egldisp )
Swaps the content of the fron buffer with the back buffer.
int swapbuffer_window( window_t * win, struct display_t * disp )
Changes the content of the double buffer with the window.
int swapbuffer_x11window( x11window_t * x11win )
Restores memory manager of threadcontext_t.
int switchoff_testmm( void )
Stores current memory manager of threadcontext_t and installs testmm_t.
int switchon_testmm( void )
Switches current user to privileged_sysuser.
int switchtoprivilege_sysuser( sysuser_t * sysusr )
Switches current user to real_sysuser.
int switchtoreal_sysuser( sysuser_t * sysusr )
Static initializer.
#define syncevent_FREE { 0 }
Static initializer.
#define syncevent_INIT( waiting ) { waiting }
Event type stores a pointer to a single waiting syncwait_t.
struct syncevent_t
Static initializer.
#define syncqueue_FREE syncqueue_INIT
Static initializer.
#define syncqueue_INIT { 0, 0 }
Internal type to store zero or more syncthread_t + additional information.
struct syncqueue_t
Thread local syncronous task support.
struct syncrun_t * syncrun
typedef int /*err code ( 0 = = OK )*/ (* syncrun_f) (struct syncthread_t * sthread, uint32_t signalstate)
Static initializer.
#define syncrun_FREE { { syncqueue_FREE }, syncwlist_FREE, { 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }
Inline implementation of maincontext_t.syncrun_maincontext.
#define syncrun_maincontext( ) (tcontext_maincontext()->syncrun)
Returns syncrun_t of current maincontext_t.
struct syncrun_t * syncrun_maincontext( void )
Manages a set of syncthread_t.
struct syncrun_t
Function pointer to syncthread implementation.
typedef int /*err code ( 0 = = OK )*/ (* syncthread_f) (syncthread_t * sthread, uint32_t signalstate)
Static initializer.
#define syncthread_FREE { 0, 0 }
Static initializer.
#define syncthread_INIT( mainfct, state ) { mainfct, state }
A simple function context which is executed in a cooperative way.
struct syncthread_t
Static initializer.
#define syncwait_FREE { syncthread_FREE, 0, 0 }
Describes a syncthread_t waiting for a syncevent_t.
struct syncwait_t
Static initializer.
#define syncwlist_FREE { 0, 0, 0 }
Static initializer.
#define syncwlist_iterator_FREE { 0, 0 }
Offers iteration over content of syncwlist_t.
struct syncwlist_iterator_t
Implements a double linked list of syncevent_t and stores them in a syncqueue_t.
struct syncwlist_t
X window ID.
uint32_t sys_colormap
X window ID.
uint32_t sys_colormap
X window ID.
uint32_t sys_colormap
Implements thread_tls_t.sys_context_threadtls.
#define sys_context_threadtls( ) ( __extension__ ({ int _addr ; sys_context2_threadtls( &_addr) ; }))
Returns threadcontext_t of the current thread.
struct threadcontext_t * sys_context_threadtls( void )
Implements thread_tls_t.sys_context2_threadtls.
#define sys_context2_threadtls( local_var ) (threadcontext_t*) ( (uintptr_t)(local_var) & ~(uintptr_t) (sys_size_threadtls()-1) )
Returns threadcontext_t of the current thread.
struct threadcontext_t * sys_context2_threadtls( void * local_var )
The X11 display handle of type »Display*«.
void * sys_display
X window ID.
uint32_t sys_drawable
X window ID.
uint32_t sys_drawable
X window ID.
uint32_t sys_drawable
Choose Posix file descriptor type.
#define sys_iochannel_FREE ( -1 )
Choose Posix STDERR file descriptor number.
#define sys_iochannel_STDERR STDERR_FILENO
Choose Posix STDIN file descriptor number.
#define sys_iochannel_STDIN STDIN_FILENO
Choose Posix STDOUT file descriptor number.
#define sys_iochannel_STDOUT STDOUT_FILENO
Choose Posix file descriptor type.
#define sys_iochannel_t int
Static initializer for sys_mutex_t.
#define sys_mutex_INIT_DEFAULT PTHREAD_MUTEX_INITIALIZER
Chooses Posix mutex type.
#define sys_mutex_t pthread_mutex_t
Returns the virtual memory page size supported by the underlying system.
uint32_t sys_pagesize_vm( void )
The maximum size in bytes of a file system path.
#define sys_path_MAXSIZE PATH_MAX
Handle to the underlying system event queue.
sys_iochannel_t sys_poll
Static initializer for sys_process_t.
#define sys_process_FREE ( )
Chooses Posix process id.
#define sys_process_t pid_t
Static initializer for sys_semaphore_t.
#define sys_semaphore_FREE ( -1 )
Chooses Posix semaphore handle.
#define sys_semaphore_t int
Implements thread_tls_t.sys_size_threadtls.
#define sys_size_threadtls( ) (512*1024)
Returns the size in bytes of the thread local storage.
size_t sys_size_threadtls( void )
Defined as Posix specific size of IPv6 addresses.
#define sys_socketaddr_MAXSIZE sizeof( struct sockaddr_in6 )
Chooses Posix socket address type.
#define sys_socketaddr_t struct sockaddr
Replaces sqroot_int64 with faster sqrtl (long double version).
#define sys_sqroot_int64 sqrtl
Contains system specific ID of thread.
sys_thread_t sys_thread
Static initializer for sys_thread_t.
#define sys_thread_FREE ( )
Chooses Posix thread type.
#define sys_thread_t pthread_t
Implements thread_tls_t.sys_thread_threadtls.
#define sys_thread_threadtls( ) ((thread_t*)(&sys_context_threadtls()[1]))
Returns current thread_t object.
struct thread_t * sys_thread_threadtls( void )
Static initializer for sys_userid_t.
#define sys_userid_FREE ( (uid_t)(-1) )
Chooses Posix system user id.
#define sys_userid_t uid_t
Interface to hardware system clock.
struct sysclock_t
Static initializer.
#define systimer_FREE sys_iochannel_FREE
Exports systimer_t as alias for sys_iochannel_t.
typedef sys_iochannel_t systimer_t
Context for sysuser_t module.
struct sysuser_t * sysuser
Static initializer.
#define sysuser_FREE { sysuser_id_FREE, sysuser_id_FREE, sysuser_id_FREE }
Static initializer.
#define sysuser_id_FREE sys_userid_FREE
This type is an alias of sys_userid_t.
typedef sys_userid_t sysuser_id_t
Stores information about a sysuser_t.
struct sysuser_info_t
Inline implementation of maincontext_t.sysuser_maincontext.
#define sysuser_maincontext( ) (pcontext_maincontext()->sysuser)
The name of service used during authentication.
#define sysuser_SYS_SERVICE_NAME "passwd"
Offers functionality to manage system user.
struct sysuser_t
Used in unittest_platform_sysuser to test switchtoprivilege_sysuser.
#define sysuser_UNITTEST_PASSWORD "GUEST"
Used in unittest_platform_sysuser to test switchtoprivilege_sysuser.
#define sysuser_UNITTEST_USERNAME "guest"