The read file content mapped to memory.
mmfile_t file
The file from which is read.
sys_iochannel_t file
Static initializer.
#define file_FREE sys_iochannel_FREE
Export file_t, alias for sys_iochannel_t.
typedef sys_iochannel_t file_t
Number of open files.
size_t file_usage
Offset into file where the next read operation begins.
off_t fileoffset
Allocates static memory for a working directory and filename combination.
struct filepath_static_t
Static initializer.
#define filereader_FREE { 0, 0, 0, 0, 0, 0, sys_iochannel_FREE, { {0, 0}, {0, 0} } }
Names type filereader_t.mmfile.
typedef typeof( ((filereader_t*)0)->mmfile[0] ) filereader_mmfile_t
The sum of the size the two allocated buffers.
#define filereader_SYS_BUFFER_SIZE ( 4*4096 )
Reads file data into internal memory buffers.
struct filereader_t
The size of the io-stream file refers to.
off_t filesize
Returns the filesize of a file with path »file_path«.
int filesize_directory( const directory_t * dir/*0 = > current working directory*/, const char * file_path, /*out*/off_t * file_size )
Searches for a node with equal key.
int find_exthash( exthash_t * htable, const void * key, /*out*/exthash_node_t ** found_node )
Searches for a node with equal key.
int find_patriciatrie( patriciatrie_t * tree, size_t keylength, const uint8_t searchkey[keylength], /*out*/patriciatrie_node_t ** found_node )
Searches for a node with equal key.
int find_redblacktree( redblacktree_t * tree, const void * key, /*out*/redblacktree_node_t ** found_node )
Searches for a node with equal key.
int find_splaytree( splaytree_t * tree, const void * key, /*out*/splaytree_node_t ** found_node, uint16_t nodeoffset, typeadapt_t * typeadp )
Finds byte in string.
const uint8_t * findbyte_string( const string_t * str, uint8_t byte )
Implements stringstream_t.findbyte_stringstream.
#define findbyte_stringstream( strstream, byte ) ( __extension__({ typeof(strstream) _strstream = (strstream) ; memchr(next_stringstream(_strstream), (uint8_t)(byte), size_stringstream(_strstream)) ; }))
Finds byte in string stream.
const uint8_t * findbyte_stringstream( const struct string_t * strstream, uint8_t byte )
Find empty pageblock_block_t on freelist and return it in freeblock.
static inline int findfreeblock_pagecacheimpl( pagecache_impl_t * pgcache, pagesize_e pgsize, pagecache_block_t ** freeblock )
Finds node in trie who matches the given key fully or partially.
static int findnode_trie( trie_t * trie, uint16_t keylen, const uint8_t key[keylen], /*out*/trie_findresult_t * result )
Searches for unicode character in utf8 encoded stringstream.
const uint8_t * findutf8_stringstream( const struct stringstream_t * strstream, char32_t uchar )
Points to start of list.
struct addrinfo * first
Points to first array of vm_region_t.
vm_regionsarray_t * first_array
Implements dlist_t.first_dlist.
#define first_dlist( list ) ((list)->last ? (list)->last->next : (struct dlist_node_t*)0)
Returns the first element in the list.
struct dlist_node_t * first_dlist( dlist_t * list )
Implements queue_t.first_queue.
#define first_queue( queue, nodesize ) ( __extension__ ({ typeof(queue) _qu = (queue) ; uint16_t _ns = (nodesize) ; void * _node = 0 ; queue_page_t * _first ; if (_qu->last) { _first = (queue_page_t*) ((queue_page_t*)_qu->last)->next ; if ((_first->end_offset - _first->start_offset) >= _ns) { _node = (uint8_t*)_first + _first->start_offset ; } } _node ; }))
Returns the first element or 0.
void * first_queue( const queue_t * queue, uint16_t nodesize )
Implements slist_t.first_slist.
#define first_slist( list ) ((list)->last ? next_slist((list)->last) : 0)
Returns the first element in the list.
struct slist_node_t * first_slist( const slist_t * list )
Returns the 18 most significant decimal digits with correct sign.
int64_t first18digits_decimal( decimal_t * dec, int32_t * decimal_exponent )
Returns the 9 most significant decimal digits with correct sign.
int32_t first9digits_decimal( decimal_t * dec, int32_t * decimal_exponent )
Implements bigint_t.firstdigit_bigint.
#define firstdigit_bigint( big ) ((big)->sign_and_used_digits ? big->digits[nrdigits_bigint(big)-1] : 0)
Returns most significant digit of the number.
uint32_t firstdigit_bigint( const bigint_t * big )
Additional flags inidicating ownership of system objects.
uint8_t flags
Implements x11window_t.flags_x11window.
#define flags_x11window( x11win ) ((x11window_flags_e)(x11win)->flags)
Returns flags which indicate ownership state of system resources.
x11window_flags_e flags_x11window( const x11window_t * x11win )
Flushes logbuffer_t in chan.
static void flush_logwriterchan( logwriter_chan_t * chan )
Writes content of buffer to configured file descriptor and clears log buffer.
void ( * flushbuffer ) (void * log, uint8_t channel)
See FLUSHBUFFER_LOG.
#define FLUSHBUFFER_ERRLOG( ) FLUSHBUFFER_LOG(log_channel_ERR)
Writes content of buffer to STDERR or configured file descriptor and clears log buffer.
void flushbuffer_logwriter( logwriter_t * lgwrt, uint8_t channel )
Iterates over all elements from first to last stored in a container.
#define foreach( _fsuffix, varname, ... ) for (iteratedtype##_fsuffix varname;;) for (iteratortype##_fsuffix iter_##varname ; 0 == initfirst##_fsuffix##iterator(& iter_##varname, __VA_ARGS__); (__extension__({ (void)free##_fsuffix##iterator(&iter_##varname); break/*breaks outermost loop*/; }))) while (next##_fsuffix##iterator(&iter_##varname, &varname))
Iterates over all elements from last to first stored in a container.
#define foreachReverse( _fsuffix, varname, ... ) for (iteratedtype##_fsuffix varname;;) for (iteratortype##_fsuffix iter_##varname ; 0 == initlast##_fsuffix##iterator(& iter_##varname, __VA_ARGS__) ; (__extension__({ (void)free##_fsuffix##iterator(&iter_##varname) ; break/*breaks outermost loop*/; }))) while (prev##_fsuffix##iterator(&iter_##varname, &varname))
This function call returns twice.
static int fork_process( /*out*/pid_t * pid )
Writes formatted float or double field.
static int format_floatdouble_stringfield( const string_field_t * field, string_t * str )
Writes formatted 32 bit integer field.
static int format_i32_stringfield( const string_field_t * field, string_t * str )
Writes formatted 64 bit integer field.
static int format_i64_stringfield( const string_field_t * field, string_t * str )
Writes formatted output to string_t.
int format_string( struct string_t * str, /*out*/size_t * nr_of_fully_written_fields, int dummy )
Writes formatted string field.
static int format_string_stringfield( const string_field_t * field, string_t * str )
Implements url_t.fragment_url.
#define fragment_url( url ) getpart_url(url, url_part_FRAGMENT)
Returns the anchor/fragment part of the url.
const char * fragment_url( const url_t * url )
This is the geometry of window including the window manager frame in screen coordinates.
int frame_x11window( const x11window_t * x11win, /*out*/int32_t * screen_x, /*out*/int32_t * screen_y, /*out*/uint32_t * width, /*out*/uint32_t * height )
Frees an iterator for arraysf_t.
int free_arraysfiterator( arraysf_iterator_t * iter )
Frees an iterator for an arraystf_t.
int free_arraystfiterator( arraystf_iterator_t * iter )
Frees memory resources held by stack.
int free_binarystack( binarystack_t * stack )
Frees all memory blocks.
int free_blockarray( blockarray_t * barray )
Implements convert_wchar_t.free_convertwchar as a no op.
#define free_convertwchar( conv ) (0)
Frees resources associated with convert_wchar_t.
extern int free_convertwchar( convert_wchar_t * conv )
Frees any allocated memory associated with type cstring_t.
int free_cstring( cstring_t * cstr )
Closes file and frees memory for parsed values.
int free_csvfilereader( csvfilereader_t * csvfile )
Frees all resources associated wth the display.
int free_display( display_t * disp )
Frees all resources.
int free_dlist( dlist_t * list, uint16_t nodeoffset, struct typeadapt_t * typeadp/*0 = >no free called*/ )
Implements dlist_iterator_t.free_dlistiterator.
#define free_dlistiterator( iter ) (((iter)->next = 0), 0)
Frees an iterator for dlist_t.
int free_dlistiterator( dlist_iterator_t * iter )
Implements eglconfig_t.free_eglconfig.
#define free_eglconfig( eglconf ) (*(eglconf) = eglconfig_FREE, 0)
Frees any associated resources.
int free_eglconfig( eglconfig_t * eglconf )
Frees all associated resources with this context.
int free_eglcontext( eglcontext_t * eglcont, struct opengl_display_t * egldisp )
Frees all associated resources with a display.
int free_egldisplay( egldisplay_t * egldisp )
Frees all associated resources with eglpbuf.
int free_eglpbuffer( eglpbuffer_t * eglpbuf, struct opengl_display_t * egldisp )
Frees resources allocated by eglwin window surface.
int free_eglwindow( eglwindow_t * eglwin, struct opengl_display_t * egldisp )
Frees memory block with error.
#define FREE_ERR_MM( errtimer, mblock ) ( __extension__ ({ err = FREE_MM(mblock) ; if (! err) err = process_testerrortimer(errtimer) ; err ; }))
Sets members of errcontext to 0.
int free_errorcontext( errorcontext_t * errcontext )
Calls removenodes_exthash and frees the hash table memory.
int free_exthash( exthash_t * htable )
Implements exthash_iterator_t.free_exthashiterator.
#define free_exthashiterator( iter ) ((iter)->next = 0, 0)
Frees an iterator of exthash_t.
int free_exthashiterator( exthash_iterator_t * iter )
Closes an opened file and frees held resources.
int free_file( file_t * fileobj )
Closes file and frees allocated buffers.
int free_filereader( filereader_t * frd )
Implements gconfig_t.free_gconfig.
#define free_gconfig( gconf ) (*(gconf) = (gconfig_t) gconfig_FREE, 0)
Frees any memory associated with a configuration.
int free_gconfig( gconfig_t * gconf )
Frees graphic context cont and associated resources (frame buffers).
int free_gcontext( gcontext_t * cont, struct display_t * disp )
Frees the OpenGL part of the graphic display in an OS specific way.
#define FREE_GLWINDOW( win, disp ) free_eglwindow(&gl_window(win), gl_display(disp))
Implements iobj_t.free_iobj.
#define free_iobj( iobj ) do { typeof(iobj) _obj = (iobj) ; _obj->object = 0 ; _obj->iimpl = 0 ; } while (0)
Generic free operation.
void free_iobj( iobj_t * iobj )
Closes the I/O channel (file descriptor).
int free_iochannel( iochannel_t * ioc )
Frees Linux epoll object.
int free_iopoll( iopoll_t * iopoll )
Frees system event queue.
int free_iopoll( iopoll_t * iopoll )
Closes communication channel and frees system resources.
int free_ipsocket( /*out*/ipsocket_t * ipsock )
Closes socket and frees all resources.
int free_ipsocketasync( ipsocket_async_t * ipsockasync )
Clears all members.
int free_logbuffer( logbuffer_t * logbuf )
Frees resources and frees memory of log object.
int free_logwriter( logwriter_t * lgwrt )
Frees global context.
int free_maincontext( void )
Frees memory block.
#define FREE_MM( mblock ) mfree_mm(mm_maincontext(), mblock)
Frees all mapped memory and closes the file.
int free_mmfile( mmfile_t * mfile )
Frees all memory managed by this manager.
int free_mmimpl( mm_impl_t * mman )
Unmaps a binary blob from memory.
int free_module( module_t * mod )
Implement mutex_t.free_mutex as a no op if !defined(KONFIG_SUBSYS_THREAD)
#define free_mutex( mutex ) (0)
Frees resources of mutex which is not in use.
int free_mutex( mutex_t * mutex )
Frees objectcache_impl_t and all contained objects.
int free_objectcacheimpl( objectcache_impl_t * objectcache )
Frees the OpenGL part of the graphic display in an OS specific way.
#define FREE_OPENGL( disp ) free_egldisplay(&(disp)->gldisplay)
Frees the graphic display in an OS specific way.
#define FREE_OSDISPLAY( disp ) free_x11display(&(disp)->osdisplay)
Frees oswindow in an OS specific way.
#define FREE_OSWINDOW( oswindow ) free_x11window(oswindow)
Frees pagecache_block_t.pageblock but keeps empty block structure.
static int free_pagecacheblock( pagecache_block_t * block, pagecache_blockmap_t * blockmap )
Frees allocated hash table.
int free_pagecacheblockmap( pagecache_blockmap_t * blockmap )
Frees all allocated memory pages even if they are in use.
int free_pagecacheimpl( pagecache_impl_t * pgcache )
Frees all resources.
int free_patriciatrie( patriciatrie_t * tree )
Implements patriciatrie_iterator_t.free_patriciatrieiterator as NOP.
#define free_patriciatrieiterator( iter ) ((iter)->next = 0, 0)
Frees an iterator of patriciatrie_t.
int free_patriciatrieiterator( patriciatrie_iterator_t * iter )
Implements patriciatrie_prefixiter_t.free_patriciatrieprefixiter as NOP.
#define free_patriciatrieprefixiter( iter ) ((iter)->next = 0, 0)
Frees an prefix iterator of patriciatrie_t.
int free_patriciatrieprefixiter( patriciatrie_iterator_t * iter )
Frees all associated resources.
int free_pixelbuffer( pixelbuffer_t * pbuf, struct display_t * disp )
Frees resource associated with a process.
int free_process( process_t * process )
Frees resources associated with processcontext_t.
int free_processcontext( processcontext_t * pcontext )
Closes if devnull if necessary.
static int free_processstdio2( process_stdfd2_t * stdfd2 )
Free all memory pages even if they are not empty.
int free_queue( queue_t * queue )
Implements queue_iterator_t.free_queueiterator.
#define free_queueiterator( iter ) (*(iter) = (queue_iterator_t) queue_iterator_FREE, 0)
Frees an iterator of queue_t.
int free_queueiterator( queue_iterator_t * iter )
Frees all resources.
int free_redblacktree( redblacktree_t * tree )
Implements redblacktree_iterator_t.free_redblacktreeiterator as NOP.
#define free_redblacktreeiterator( iter ) ((iter)->next = 0, 0)
Frees an iterator of redblacktree_t.
int free_redblacktreeiterator( redblacktree_iterator_t * iter )
Frees any memory which may be used to store the usage information.
int free_resourceusage( resourceusage_t * usage )
Frees mutex.
int free_rwlock( rwlock_t * rwlock )
Wakes up any waiting threads and frees the associated resources.
int free_semaphore( semaphore_t * semaobj )
Frees all resources associated with signalwait.
int free_signalwait( signalwait_t * signalwait )
Frees all resources associated with signalwait.
int free_signalwait( signalwait_t * signalwait )
Frees memory of all contained objects.
int free_slist( slist_t * list, uint16_t nodeoffset, struct typeadapt_t * typeadp/*0 = >no free called*/ )
Implements slist_t.free_slistiterator.
#define free_slistiterator( iter ) ((iter)->next = 0, 0)
Frees an iterator of slist_t.
int free_slistiterator( slist_iterator_t * iter )
Frees all resources.
int free_splaytree( splaytree_t * tree, uint16_t nodeoffset, typeadapt_t * typeadp )
Implements splaytree_iterator_t.free_splaytreeiterator as NOP.
#define free_splaytreeiterator( iter ) ((iter)->next = 0, 0)
Frees an iterator of splaytree_t.
int free_splaytreeiterator( splaytree_iterator_t * iter )
Sets all data members to 0.
void free_splitstring( splitstring_t * spstr )
Sets string to string_FREE.
void free_string( string_t * str )
Implements stringstream_t.free_stringstream.
#define free_stringstream( strstream ) ((void)(*(strstream) = (stringstream_t) stringstream_FREE))
Resets stringstream to null string.
void free_stringstream( stringstream_t * strstream )
Frees all memory of the allocated nodes.
int free_suffixtree( suffixtree_t * tree )
Frees all allocated memory pages and clears syncqueue.
int free_syncqueue( syncqueue_t * syncqueue )
Frees all queues and removed any stored syncthread_t.
int free_syncrun( syncrun_t * srun )
Implements syncthread_t.free_syncthread.
#define free_syncthread( sthread ) ((void)(*(sthread) = (syncthread_t) syncthread_FREE))
Sets all members to 0.
void free_syncthread( syncthread_t * sthread )
Marks all listed nodes as free and removes them from the queue.
int free_syncwlist( syncwlist_t * wlist, struct syncqueue_t * queue )
Implements syncwlist_iterator_t.free_syncwlistiterator.
#define free_syncwlistiterator( iter ) (*(iter) = (syncwlist_iterator_t) syncwlist_iterator_FREE, 0)
Frees an iterator of syncwlist_t.
int free_syncwlistiterator( syncwlist_iterator_t * iter )
Frees any resources associated with the timer.
int free_systimer( systimer_t * timer )
Implement sysuser_t.free_sysuser as noop if !defined(KONFIG_SUBSYS_SYSUSER)
#define free_sysuser( sysuser ) ((*(sysuser)) = (sysuser_t) sysuser_FREE, 0)
Clears sysusr and resets system user ids.
int free_sysuser( sysuser_t * sysusr )
Implements test_errortimer_t.free_testerrortimer.
#define free_testerrortimer( errtimer ) ((void)(*(errtimer) = (test_errortimer_t) test_errortimer_FREE))
Sets errtimer to test_errortimer_FREE.
void free_testerrortimer( test_errortimer_t * errtimer )
Frees all memory managed by this manager.
int free_testmm( testmm_t * mman )
Implements textpos_t.free_textpos.
#define free_textpos( txtpos ) ((void)(*(txtpos) = (textpos_t)textpos_FREE))
Sets pos to textpos_FREE.
void free_textpos( textpos_t * txtpos )
Closes file and frees memory of textresource_t.
static int free_textresourcereader( textresource_reader_t * reader )
Frees all resources bound to this object.
int free_threadcontext( threadcontext_t * tcontext )
Changes protection of memory to normal and frees it.
int free_threadtls( thread_tls_t * tls )
Checks that no one is waiting and sets mutex to thrmutex_FREE.
int free_thrmutex( thrmutex_t * mutex )
Frees all nodes and their associated memory.
int free_trie( trie_t * trie )
Sets all fields to 0.
int free_typeadaptimpl( typeadapt_impl_t * typeadp )
Implements utf8reader_t.free_utf8reader.
int free_utf8reader( utf8reader_t * utfread )
Sets all internal members to 0.
int free_utf8reader( utf8reader_t * utfread )
Sets all data members to 0 and releases any acquired buffers from frd.
int free_utf8scanner( utf8scanner_t * scan, struct filereader_t * frd )
Implements utf8validator_t.free_utf8validator.
#define free_utf8validator( utf8validator ) ( __extension__ ({ int _err ; utf8validator_t * _v ; _v = (utf8validator) ; _err = _v->size_of_prefix ? EILSEQ : 0 ; _v->size_of_prefix = 0 ; _err ; }))
Clear data members and checks that there is no internal prefix stored.
int free_utf8validator( utf8validator_t * utf8validator )
Clears values of valuecache.
int free_valuecache( valuecache_t * valuecache )
Free internal memory cache used to store all vm_region_t objects.
int free_vmmappedregions( vm_mappedregions_t * mappedregions )
Invalidates virtual memory address range
int free_vmpage( vmpage_t * vmpage )
Wakes up all waiting threads and frees all resources.
int free_waitlist( waitlist_t * wlist )
Frees win and its associated resources like native windows.
int free_window( window_t * win )
Frees and deallocates the double buffer associated with a window.
int free_x11dblbuffer( x11dblbuffer_t * dblbuf )
Closes display connection and frees all resources.
int free_x11display( x11display_t * x11disp )
Frees the iterator and the associated list of all videomodes.
int free_x11videomodeiterator( x11videomode_iterator_t * xvidit )
Frees all associated resources in case w11window_t.flags inidcates ownership.
int free_x11window( x11window_t * x11win )
Calls free_testmm with object pointer from mm_t.
int freeasmm_testmm( struct mm_t * testmm )
Frees pageblock_block_t and removes it from freelist and blocklist.
static inline int freeblock_pagecacheimpl( pagecache_impl_t * pgcache, pagecache_block_t * block )
The number of free bytes of memory block blockstart points to.
uint32_t freeblocksize
Frees internal buffer.
static int freebuffer_logwriter( memblock_t * buffer )
Frees iobj.
#define FREEIOBJ( module, objtype_t, iobj, staticiobj ) int err ; int err2 ; objtype_t * delobj = (objtype_t*) (iobj).object ; if ((iobj).object != (staticiobj).object) { assert( interface_##module() == (iobj).iimpl) ; (iobj) = (staticiobj) ; err = free_##module(delobj) ; memblock_t memobject = memblock_INIT( sizeof(objtype_t), (uint8_t*)delobj) ; err2 = FREESTATIC_PAGECACHE(&memobject) ; if (err2) err = err2 ; return err ; } return 0 ;
Index into pagecache_impl_t.freeblocklist.
uint8_t freelistidx
Same as free_threadtls but calls no other functions of C-kern system.
int freemain_threadtls( thread_tls_t * tls )
Frees memory of object type suffixtree_iterator_t.
static int freenode_suffixtreeiteratoradapter( suffixtreeiterator_adapter_t * typeadp, suffixtree_iterator_t ** iter )
Frees object.
#define FREEOBJECT( module, objtype_t, object ) int err ; int err2 ; objtype_t * delobj = (object) ; if (delobj != (0)) { (object) = (0) ; err = free_##module(delobj) ; err2 = freestatic_maincontext( sizeof(objtype_t)) ; if (err2) err = err2 ; return err ; } return 0 ;
Implements errorcontext_t.freeonce_errorcontext.
#define freeonce_errorcontext( error ) (0)
Called from maincontext_t.free_maincontext.
int freeonce_errorcontext( errorcontext_t * error )
Called from maincontext_t.free_maincontext.
int freeonce_locale( void )
Implement free as a no op if !defined(KONFIG_SUBSYS_THREAD)
#define freeonce_signalhandler( ) (0)
Restores default signal configuration.
int freeonce_signalhandler( void )
Implement free as a no op if defined KONFIG_USERINTERFACE_X11.
#define freeonce_X11( ) (0)
Does nothing at the moment.
int freeonce_X11( void )
Header of free page located in pagecache_block_t.pageblock.
struct freepage_t
Frees resources of pagecache_block_t stored in pagecache_block_t.pageblock.
static inline int freepageblock_pagecacheblock( vmpage_t * pageblock )
List of free pages.
dlist_t freepagelist
Frees any resources allocated with the single object of type unittest_t.
int freesingleton_unittest( void )
Returns the number of unused bytes.
static inline uint32_t freesize_blockheader( blockheader_t * header )
Frees static memory.
int ( * freestatic ) (pagecache_t * pgcache, struct memblock_t * memblock)
Frees size bytes of last allocated memory.
int freestatic_maincontext( uint8_t size )
Implements pagecache_t.freestatic_pagecache.
#define freestatic_pagecache( pgcache, memblock ) ((pgcache).iimpl->freestatic((pgcache).object, (memblock)))
Calls pgcache->iimpl->freestatic with pgcache->object as first parameter.
int freestatic_pagecache( const pagecache_t pgcache, struct memblock_t * memblock )
Frees static block of memory and clears memblock.
#define FREESTATIC_PAGECACHE( memblock ) (freestatic_pagecache(pagecache_maincontext(), (memblock)))
Frees static memory.
int freestatic_pagecacheimpl( pagecache_impl_t * pgcache, struct memblock_t * memblock )
Calls free_pagecacheimpl with for object pointer in pagecache_t.
int freethread_pagecacheimpl( struct pagecache_t * pagecache )