c-icap-doc
0.1
|
Arrays of name/pointers to objects pairs
More...
Macros | |
#define | ci_ptr_array_value(array, pos) ci_array_value((ci_array_t *)(array), pos) |
Return the value of item at position 'pos' More... | |
#define | ci_ptr_array_new ci_array_new |
Create a new ci_ptr_array_t object. More... | |
#define | ci_ptr_array_destroy(ptr_array) ci_array_destroy((ci_array_t *)(ptr_array)) |
Destroy a ci_ptr_array_t object. More... | |
#define | ci_ptr_array_iterate(ptr_array, data, fn) ci_array_iterate((ci_array_t *)(ptr_array), data, fn) |
Run the function fn for each item of the ci_ptr_array_t object. More... | |
#define | ci_ptr_array_get_item(array, pos) ci_array_get_item((ci_array_t *)(array), pos) |
Get an array item. More... | |
Typedefs | |
typedef ci_array_t | ci_ptr_array_t |
The ci_ptr_array_t objects can store a list of name and pointer to object pairs. More... | |
Functions | |
ci_ptr_array_t * | ci_ptr_array_new2 (size_t items) |
Create and initialize an ci_ptr_array_t object for the given number of items More... | |
void * | ci_ptr_array_search (ci_ptr_array_t *array, const char *name) |
Search in an array for an item with the given name More... | |
const ci_array_item_t * | ci_ptr_array_add (ci_ptr_array_t *ptr_array, const char *name, void *value) |
Add an name/value pair item to the ci_ptr_array_t object. More... | |
const ci_array_item_t * | ci_ptr_array_pop (ci_ptr_array_t *ptr_array) |
Pop and delete the last item of a ci_ptr_array_t object. More... | |
void * | ci_ptr_array_pop_value (ci_ptr_array_t *ptr_array, char *name, size_t name_size) |
Pop and delete the last item of a ci_ptr_array_t object. More... | |
Arrays of name/pointers to objects pairs
#define ci_ptr_array_destroy | ( | ptr_array | ) | ci_array_destroy((ci_array_t *)(ptr_array)) |
Destroy a ci_ptr_array_t object.
Similar to the ci_array_destroy function
#define ci_ptr_array_get_item | ( | array, | |
pos | |||
) | ci_array_get_item((ci_array_t *)(array), pos) |
Get an array item.
Wrapper to the ci_array_get_item() function.
#define ci_ptr_array_iterate | ( | ptr_array, | |
data, | |||
fn | |||
) | ci_array_iterate((ci_array_t *)(ptr_array), data, fn) |
Run the function fn for each item of the ci_ptr_array_t object.
Similar to the ci_array_iterate function
#define ci_ptr_array_new ci_array_new |
Create a new ci_ptr_array_t object.
Similar to the ci_array_new() function.
#define ci_ptr_array_value | ( | array, | |
pos | |||
) | ci_array_value((ci_array_t *)(array), pos) |
Return the value of item at position 'pos'
Return the size of ptr_array
Return the name of item at position 'pos'
The ci_ptr_array_t objects can store a list of name and pointer to object pairs.
It is similar to the ci_array_t object but does not store the value but a pointer to the value.
const ci_array_item_t* ci_ptr_array_add | ( | ci_ptr_array_t * | ptr_array, |
const char * | name, | ||
void * | value | ||
) |
Add an name/value pair item to the ci_ptr_array_t object.
ptr_array | a pointer to the ci_ptr_array_t object |
name | the name part of the name/value pair item to be added |
value | a pointer to the value part of the name/value pair item to be added |
ci_ptr_array_t* ci_ptr_array_new2 | ( | size_t | items | ) |
Create and initialize an ci_ptr_array_t object for the given number of items
items | the maximum aray items |
const ci_array_item_t* ci_ptr_array_pop | ( | ci_ptr_array_t * | ptr_array | ) |
Pop and delete the last item of a ci_ptr_array_t object.
ptr_array | a pointer to the ci_ptr_array_t object |
void* ci_ptr_array_pop_value | ( | ci_ptr_array_t * | ptr_array, |
char * | name, | ||
size_t | name_size | ||
) |
Pop and delete the last item of a ci_ptr_array_t object.
ptr_array | a pointer to the ci_ptr_array_t object |
name | a pointer to a buffer where the name of the poped item will be store, or NULL |
name_size | the size of name buffer |
void* ci_ptr_array_search | ( | ci_ptr_array_t * | array, |
const char * | name | ||
) |
Search in an array for an item with the given name
array | a pointer to the ci_ptr_array_t object |
name | the item to be search for. |