Prepares this process to be a daemon process.
int daemonize_process( process_stdio_t * stdfd/*0 = > /dev/null*/ )
Start address of text data.
const uint8_t * data/*length*/
Points to data in memory.
trie_nodedata_t * data
A memory block which contains the array elements.
struct datablock_t
Stores the number of bytes process so far.
uint64_t datalen
Used in div_decimalhelper to store current state of division computation.
struct decimal_divstate_t
Holds the modulo result of a division of a bigint_t.
struct decimal_frombigint_state_t
Type holding state for conversion from bigint_t into decimal_t.
struct decimal_frombigint_t
Represents a decimal number with at most 1143 decimal digits.
struct decimal_t
Decodes utf-8 encoded bytes beginning from strstart and returns character in uchar.
uint8_t decodechar_utf8( const uint8_t strstart[/*maxsize_utf8() or big enough*/], /*out*/char32_t * uchar )
Returns size of decimal_t needed to represent <s_decimal_powbase>[tableindex].
static inline unsigned decsize_decimalpowbase( unsigned tableindex )
Returns the default screen of x11disp.
struct x11screen_t defaultscreen_x11display( x11display_t * x11disp )
Returns the number of the default screens attached to this display.
uint32_t defaultscreennr_display( const display_t * disp )
Returns the default screen number of x11disp.
uint32_t defaultscreennr_x11display( const x11display_t * x11disp )
Frees allocated memory.
int delete_arraysf( arraysf_t ** array, struct typeadapt_member_t * nodeadp )
Frees allocated memory.
int delete_arraystf( arraystf_t ** array, struct typeadapt_member_t * nodeadp )
Frees any allocated memory and sets (*big) to 0.
int delete_bigint( bigint_t ** big )
Frees any allocated memory and sets (*dec) to 0.
int delete_decimal( decimal_t ** dec )
Closes open directory stream.
int delete_directory( directory_t ** dir )
Deletes a created or copied address.
int delete_ipaddr( ipaddr_t ** addr )
Frees memory of internal list of ipaddr_list_t.
int delete_ipaddrlist( ipaddr_list_t ** addrlist )
Function frees memory and associated resources of object.
int ( * delete_object ) (struct typeadapt_t * typeadp, struct typeadapt_object_t ** object)
Frees single memory page with RELEASE_PAGECACHE.
static int delete_queuepage( queue_page_t ** qpage )
Frees any resources associated with sigstate.
int delete_signalstate( signalstate_t ** sigstate )
Frees all memory allocated for suffixtree_iterator_t object.
static int delete_suffixtreeiterator( suffixtree_iterator_t ** iter )
Frees resources associated with suffixtree_leaf_t.
static int delete_suffixtreeleaf( suffixtree_leaf_t ** leaf )
Frees memory holding system user information.
int delete_sysuserinfo( sysuser_info_t ** usrinfo )
Calls join_thread (if not already called) and deletes resources.
int delete_thread( thread_t ** threadobj )
Frees memory of node and all of its child nodes.
static int delete_trienode( trie_nodedata_t ** node )
Frees allocated memory of subnode.
static int delete_triesubnode( trie_subnode_t ** subnode )
Frees memory of subnode and sets it to 0.
static int delete_triesubnode2( trie_subnode2_t ** subnode )
Frees all resources bound to url.
int delete_url( url_t ** url )
The depth of the tree.
uint8_t depth
Returns shiftleft10p_f for argument decimal_exponent_x.
static shiftleft10p_f determinehshiftleft_decimalhelper( uint32_t shiftcount )
Implements timevalue_t.diffms_timevalue.
#define diffms_timevalue( endtv, starttv ) ( __extension__ ({ timevalue_t * _etv = (endtv) ; timevalue_t * _stv = (starttv) ; (_etv->seconds - _stv->seconds) * 1000 + (_etv->nanosec - _stv->nanosec) / 1000000 ; }))
int64_t diffms_timevalue( timevalue_t * endtv, timevalue_t * starttv )
Returns ptr to digit array.
static inline uint8_t * digit_trienode( trie_node_t * node )
Writes a decimal representation of digit into string str.
static inline void digit2str_decimalhelper( uint8_t * str, uint32_t digit, uint8_t digitsize )
9 decimal digits encoded as integer are stored per digit (uint32_t).
uint32_t digits[/*0..size_allocated-1*/]
The base of a digit in array decimal_t.digits.
#define DIGITSBASE ( (uint32_t)1000000000 )
Implements decimal_t.digitsperint_decimal.
#define digitsperint_decimal( ) ((uint8_t)(9 * bitsperint_decimal()/32))
Returns the number of decimal digits stored internally per integer.
uint8_t digitsperint_decimal( void )
Alias for POSIX specific DIR structure.
struct directory_t
Disables a fpu exception to be silent.
int disable_fpuexcept( fpu_except_e exception_flags )
This signal handler is called for every signal.
static void dispatcher_signalhandler( int signr, siginfo_t * siginfo, void * ucontext )
Checks event queue and dispatches 1 event if avialable.
int dispatchevent_X11( struct x11display_t * x11disp )
Reference to x11display_t.
struct x11display_t* display
Reference to x11display_t.
struct x11display_t* display
Reference to x11display_t.
struct x11display_t* display
Static initializer.
#define display_FREE { x11display_FREE, egldisplay_FREE }
Wraps the OS specific graphics display.
struct display_t
Implements window_t.display_window.
#define display_window( win ) (castfromos_display(display_x11window(os_window(win))))
Returns a pointer to the display_t the window is associated with.
struct display_t * display_window( const window_t * win )
Implements x11screen_t.display_x11screen.
#define display_x11screen( x11screen ) ((x11screen)->display)
Returns the display of the screen of.
struct x11display_t * display_x11screen( const x11screen_t * x11screen )
Implements x11window_t.display_x11window.
#define display_x11window( x11win ) ((x11win)->display)
Returns the display the window is associated with.
struct x11display_t * display_x11window( const x11window_t * x11win )
Implements bigint_t.div_bigint.
#define div_bigint( result, lbig, rbig ) (divmod_bigint(result, 0, lbig, rbig))
Divides dividend lbig by divisor rbig.
int div_bigint( bigint_t *restrict * result, const bigint_t * lbig, const bigint_t * rbig )
Divides parameter ldec by rdec and returns the quotient in the first.
int div_decimal( decimal_t *restrict * result, const decimal_t * ldec, const decimal_t * rdec, uint8_t result_size )
Divides two decimal numbers and returns the positive quotient.
static int div_decimalhelper( decimal_t *restrict result, bool isNegSign, int32_t exponent, const uint8_t lsize, uint32_t * const ldigits, const uint8_t rsize, const uint32_t * const rdigits, const uint8_t result_size )
Divides 3 32 bit integer digits by 2 32 bit integer digits.
static void div3by2digits_biginthelper( bigint_divstate_t * state )
Computes ((dividend * DIGITSBASE + nextdigit) / divisor).
static void div3by2digits_decimalhelper( decimal_divstate_t * state )
Divides parameter ldec by rdivisor and returns quotient in the first.
int divi32_decimal( decimal_t *restrict * result, const decimal_t * ldec, int32_t rdivisor, uint8_t result_size )
Divides decimal number by integer and returns the positive quotient.
static int divi32_decimalhelper( decimal_t *restrict result, bool isNegSign, int32_t exponent, uint8_t lsize, const uint32_t * ldigits, uint32_t divisor, const uint32_t result_size )
Divides lbig by rbig and computes lbig modulo rbig.
int divmod_bigint( bigint_t *restrict * divresult, bigint_t *restrict * modresult, const bigint_t * lbig, const bigint_t * rbig )
Computes ldigits[0..lnrdigits-1] = divresult * rdigits[0..rnrdigits-1] + modresult.
static void divmod_biginthelper( bigint_t *restrict * divresult, bigint_t *restrict * modresult, uint16_t divnrdigits, // number of digits which must be computed const uint16_t modnrdigits, // number of digits of the remainder const int16_t divsign, // sign ([-1,+1]) of divresult const int16_t lsign, // sign ([-1,+1]) of ldigits (which is the sign of modresult) const uint16_t lnrdigits, // the number of digits in array ldigits uint32_t * ldigits, // the array of digits for the left operand const uint16_t rnrdigits, // the number of digits in array rdigits const uint32_t * rdigits ) // the array of digits for the right operand
Divides lbig by divisor of type uint32_t and computes modulo.
int divmodui32_bigint( bigint_t *restrict * divresult, bigint_t *restrict * modresult, const bigint_t * lbig, const uint32_t divisor )
Divides lbig by signed divisor.
static void divmodui32_biginthelper( bigint_t *restrict * divresult, bigint_t *restrict * modresult, uint16_t divnrdigits, const int16_t divsign, const int16_t lsign, uint16_t lnrdigits, const uint32_t * const ldigits, const uint32_t divisor )
Implements bigint_t.divui32_bigint.
#define divui32_bigint( result, lbig, divisor ) (divmodui32_bigint(result, 0, lbig, divisor))
Divides lbig by divisor of type uint32_t.
int divui32_bigint( bigint_t *restrict * result, const bigint_t * lbig, const uint32_t divisor )
Implements dlist_t.dlist_IMPLEMENT.
#define dlist_IMPLEMENT( _fsuffix, object_t, nodeprefix ) typedef dlist_iterator_t iteratortype##_fsuffix ; typedef object_t * iteratedtype##_fsuffix ; static inline int initfirst##_fsuffix##iterator(dlist_iterator_t * iter, dlist_t * list) __attribute__ ((always_inline)) ; static inline int initlast##_fsuffix##iterator(dlist_iterator_t * iter, dlist_t * list) __attribute__ ((always_inline)) ; static inline int free##_fsuffix##iterator(dlist_iterator_t * iter) __attribute__ ((always_inline)) ; static inline bool next##_fsuffix##iterator(dlist_iterator_t * iter, object_t ** node) __attribute__ ((always_inline)) ; static inline bool prev##_fsuffix##iterator(dlist_iterator_t * iter, object_t ** node) __attribute__ ((always_inline)) ; static inline void init##_fsuffix(dlist_t * list) __attribute__ ((always_inline)) ; static inline int free##_fsuffix(dlist_t * list, struct typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline int isempty##_fsuffix(const dlist_t * list) __attribute__ ((always_inline)) ; static inline object_t * first##_fsuffix(const dlist_t * list) __attribute__ ((always_inline)) ; static inline object_t * last##_fsuffix(const dlist_t * list) __attribute__ ((always_inline)) ; static inline object_t * next##_fsuffix(object_t * node) __attribute__ ((always_inline)) ; static inline object_t * prev##_fsuffix(object_t * node) __attribute__ ((always_inline)) ; static inline bool isinlist##_fsuffix(object_t * node) __attribute__ ((always_inline)) ; static inline void insertfirst##_fsuffix(dlist_t * list, object_t * new_node) __attribute__ ((always_inline)) ; static inline void insertlast##_fsuffix(dlist_t * list, object_t * new_node) __attribute__ ((always_inline)) ; static inline void insertafter##_fsuffix(dlist_t * list, object_t * prev_node, object_t * new_node) __attribute__ ((always_inline)) ; static inline void insertbefore##_fsuffix(object_t* next_node, object_t * new_node) __attribute__ ((always_inline)) ; static inline int removefirst##_fsuffix(dlist_t * list, object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int removelast##_fsuffix(dlist_t * list, object_t ** removed_node) __attribute__ ((always_inline)) ; static inline int remove##_fsuffix(dlist_t * list, object_t * node) __attribute__ ((always_inline)) ; static inline void replacenode##_fsuffix(dlist_t * list, object_t * newnode, object_t * oldnode) __attribute__ ((always_inline)) ; static inline int removeall##_fsuffix(dlist_t * list, struct typeadapt_t * typeadp) __attribute__ ((always_inline)) ; static inline void transfer##_fsuffix(dlist_t * tolist, dlist_t * fromlist) __attribute__ ((always_inline)) ; static inline uint16_t nodeoffset##_fsuffix(void) __attribute__ ((always_inline)) ; static inline uint16_t nodeoffset##_fsuffix(void) { static_assert(UINT16_MAX > (uintptr_t) & (((object_t*)0)->nodeprefix next), "offset fits in uint16_t") ; return (uint16_t) (uintptr_t) & (((object_t*)0)->nodeprefix next) ; } static inline dlist_node_t * asnode##_fsuffix(object_t * object) { static_assert(&(((object_t*)0)->nodeprefix next) == (dlist_node_t**)((uintptr_t)nodeoffset##_fsuffix()), "correct type") ; static_assert(&(((object_t*)0)->nodeprefix prev) == (dlist_node_t**)(nodeoffset##_fsuffix() + sizeof(dlist_node_t*)), "correct type and offset") ; return (dlist_node_t *) ((uintptr_t)object + nodeoffset##_fsuffix()) ; } static inline object_t * asobject##_fsuffix(dlist_node_t * node) { return (object_t *) ((uintptr_t)node - nodeoffset##_fsuffix()) ; } static inline object_t * asobjectnull##_fsuffix(dlist_node_t * node) { return node ? (object_t *) ((uintptr_t)node - nodeoffset##_fsuffix()) : 0 ; } static inline void init##_fsuffix(dlist_t * list) { init_dlist(list) ; } static inline int free##_fsuffix(dlist_t * list, struct typeadapt_t * typeadp) { return free_dlist(list, nodeoffset##_fsuffix(), typeadp) ; } static inline int isempty##_fsuffix(const dlist_t * list) { return isempty_dlist(list) ; } static inline object_t * first##_fsuffix(const dlist_t * list) { return asobjectnull##_fsuffix(first_dlist(list)) ; } static inline object_t * last##_fsuffix(const dlist_t * list) { return asobjectnull##_fsuffix(last_dlist(list)) ; } static inline object_t * next##_fsuffix(object_t * node) { return asobject##_fsuffix(next_dlist(asnode##_fsuffix(node))) ; } static inline object_t * prev##_fsuffix(object_t * node) { return asobject##_fsuffix(prev_dlist(asnode##_fsuffix(node))) ; } static inline bool isinlist##_fsuffix(object_t * node) { return isinlist_dlist(asnode##_fsuffix(node)) ; } static inline void insertfirst##_fsuffix(dlist_t * list, object_t * new_node) { insertfirst_dlist(list, asnode##_fsuffix(new_node)) ; } static inline void insertlast##_fsuffix(dlist_t * list, object_t * new_node) { insertlast_dlist(list, asnode##_fsuffix(new_node)) ; } static inline void insertafter##_fsuffix(dlist_t * list, object_t * prev_node, object_t * new_node) { insertafter_dlist(list, asnode##_fsuffix(prev_node), asnode##_fsuffix(new_node)) ; } static inline void insertbefore##_fsuffix(object_t * next_node, object_t * new_node) { insertbefore_dlist(asnode##_fsuffix(next_node), asnode##_fsuffix(new_node)) ; } static inline int removefirst##_fsuffix(dlist_t * list, object_t ** removed_node) { int err = removefirst_dlist(list, (dlist_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(dlist_node_t**)removed_node) ; return err ; } static inline int removelast##_fsuffix(dlist_t * list, object_t ** removed_node) { int err = removelast_dlist(list, (dlist_node_t**)removed_node) ; if (!err) *removed_node = asobject##_fsuffix(*(dlist_node_t**)removed_node) ; return err ; } static inline int remove##_fsuffix(dlist_t * list, object_t * node) { return remove_dlist(list, asnode##_fsuffix(node)) ; } static inline void replacenode##_fsuffix(dlist_t * list, object_t * newnode, object_t * oldnode) { replacenode_dlist(list, asnode##_fsuffix(newnode), asnode##_fsuffix(oldnode)) ; } static inline int removeall##_fsuffix(dlist_t * list, struct typeadapt_t * typeadp) { return removeall_dlist(list, nodeoffset##_fsuffix(), typeadp) ; } static inline void transfer##_fsuffix(dlist_t * tolist, dlist_t * fromlist) { transfer_dlist(tolist, fromlist) ; } static inline int initfirst##_fsuffix##iterator(dlist_iterator_t * iter, dlist_t * list) { return initfirst_dlistiterator(iter, list) ; } static inline int initlast##_fsuffix##iterator(dlist_iterator_t * iter, dlist_t * list) { return initlast_dlistiterator(iter, list) ; } static inline int free##_fsuffix##iterator(dlist_iterator_t * iter) { return free_dlistiterator(iter) ; } static inline bool next##_fsuffix##iterator(dlist_iterator_t * iter, object_t ** node) { bool isNext = next_dlistiterator(iter, (dlist_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(dlist_node_t**)node) ; return isNext ; } static inline bool prev##_fsuffix##iterator(dlist_iterator_t * iter, object_t ** node) { bool isNext = prev_dlistiterator(iter, (dlist_node_t**)node) ; if (isNext) *node = asobject##_fsuffix(*(dlist_node_t**)node) ; return isNext ; }
Generates interface of double linked list storing elements of type object_t.
void dlist_IMPLEMENT( IDNAME _fsuffix, TYPENAME object_t, IDNAME nodeprefix ) ;
Static initializer.
#define dlist_INIT { (void*)0 }
Static initializer.
#define dlist_INIT_LAST( lastnode ) { (lastnode) }
Static initializer.
#define dlist_iterator_FREE { 0, 0 }
Iterates over elements contained in dlist_t.
struct dlist_iterator_t
Static initializer.
#define dlist_node_INIT { 0, 0 }
Provides the means for linking an object to two others of the same type.
struct dlist_node_t
Double linked circular list.
struct dlist_t
Tries a reverse mapping from a binary ip address into its dns name representation.
int dnsname_ipaddr( const ipaddr_t * addr, cstring_t * dns_name )
Tries a reverse mapping from a binary ip address into its dns name representation.
int dnsnameace_ipaddr( const ipaddr_t * addr, cstring_t * dns_name )
Writes a simple ascii representation of all nodes into a cstring_t.
int dump_suffixtree( suffixtree_t * tree, struct cstring_t * cstr )