libdacav 0.9.0
|
This module declares some general use data types. More...
Data Structures | |
struct | dcprm_t |
Pair of callbacks for copy construction and for distruction of a generic item. More... | |
Typedefs | |
typedef void(* | dfree_cb_t )(void *obj) |
Memory free callback function. | |
typedef void *(* | diter_cb_t )(void *udata, void *data) |
Container scan callback function. | |
typedef void *(* | dcreate_cb_t )(void *src) |
Constructor callback function. | |
typedef void *(* | dcopy_cb_t )(const void *src) |
Copy-constructor callback function. | |
typedef int( | dfilter_cb_t )(void *udata, void *data) |
Filter scan callback function. | |
typedef int(* | dcmp_cb_t )(const void *v0, const void *v1) |
Callback for comparation between two generic objects. |
This module declares some general use data types.
typedef int(* dcmp_cb_t)(const void *v0, const void *v1) |
Callback for comparation between two generic objects.
[in] | v0 | The first object to be compared; |
[in] | v1 | The second object to be compared; |
typedef void*(* dcopy_cb_t)(const void *src) |
Copy-constructor callback function.
A type of function to be used for copying stored values. Any implementing function is supposed to return a copy of the parameter object.
[in] | src | The object to be copied. |
typedef void*(* dcreate_cb_t)(void *src) |
Constructor callback function.
A type of function to be used for creating new instances of a certain structure. The parameter is a user context.
[in] | ctx | The user context. |
typedef int( dfilter_cb_t)(void *udata, void *data) |
Filter scan callback function.
This type describes the callback parameter of 'filter' functions. The pattern requires that a container gets scanned, and such a callback gets called for each contained element. The return value of the callback decides if the element should be keeped or removed.
A 'filter' primitive generally requires a udata parameter which is a pointer to generic user defined data. This allows to write reentrant code.
[in] | udata | A pointer to some generic user defined data; |
[in] | data | A pointer to the stored data being considered; |
typedef void(* dfree_cb_t)(void *obj) |
Memory free callback function.
This type describes the callback parameter of destructors. For instance, if you are using allocated 'char *' as key for hash tables, you may use simply the free(3) as key destroyer. Note that free(3) matches the dfree_cb_t data type.
[in] | obj | The object to be freed. |
typedef void*(* diter_cb_t)(void *udata, void *data) |
Container scan callback function.
This type describes the callback parameter of 'foreach' functions. The pattern requires that a container gets scanned, and such a callback gets called for each contained element. The return value of the callback replaces the stored one.
A 'foreach' primitive generally requires a udata parameter which is a pointer to generic user defined data. This allows to write reentrant code.
[in] | udata | A pointer to some generic user defined data; |
[in] | data | A pointer to the stored data being considered; |