|
YAC 3.21.0
Yet Another Coupler
|


Go to the source code of this file.
Typedefs | |
| typedef int(* | yac_param_factory_ptr) (void **element_ptr, struct yac_param **param_ptr) |
| Function pointer type for creating a default element and associated parameter for a list parameter. | |
| typedef int(* | yac_param_element_get_param_ptr) (void *element, struct yac_param **param_ptr) |
| Function pointer type for creating a param for an existing element. | |
Functions | |
| struct yac_param * | yac_param_list_new (const char *name, void ***list, yac_param_factory_ptr default_factory, yac_param_element_get_param_ptr element_get_param) |
| Create a new list parameter. | |
| typedef int(* yac_param_element_get_param_ptr) (void *element, struct yac_param **param_ptr) |
Function pointer type for creating a param for an existing element.
Called during list param initialisation for each element that already exists in the backing array. If NULL, existing elements have no param.
| [in] | element | Existing element (void *) |
| [out] | param_ptr | Output: param object for this element |
Definition at line 37 of file param_list.h.
| typedef int(* yac_param_factory_ptr) (void **element_ptr, struct yac_param **param_ptr) |
Function pointer type for creating a default element and associated parameter for a list parameter.
The function must allocate and return both a new element (void*) and its associated yac_param pointer. The element is the user data, the parameter is the config param object for that element.
| [out] | element_ptr | Pointer to the new element (void*) |
| [out] | param_ptr | Pointer to the new yac_param* |
Definition at line 23 of file param_list.h.
| struct yac_param * yac_param_list_new | ( | const char * | name, |
| void *** | list, | ||
| yac_param_factory_ptr | default_factory, | ||
| yac_param_element_get_param_ptr | element_get_param ) |
Create a new list parameter.
Ownership of the backing list and list elements always stays with the caller. The constructor only wraps configuration params around the elements.
If element_get_param is NULL, *list must be NULL (no pre-existing elements).
| name | Name of the list parameter |
| list | Pointer to the backing NULL-terminated array |
| default_factory | Factory for new (appended) elements and params |
| element_get_param | Factory to get the param for an already-existing element; may be NULL only when *list is NULL |
Definition at line 134 of file param_list.c.
