next up previous contents
Next: Serialisation Up: Generic Lists Previous: Property List Functions   Contents

Recursive List Functions

void    reclist_apply(void *ptr, int ptype, void (*func) ( /* ??? */ ), int type,
                      void *data)

void    reclist_string_apply(Tstring * str, void (*func) ( /* ??? */ ), int type,
                             void *data)

Apply a function to all members of a recursive list that match the given type. The type NULL is wild and applies the function to all members of the recursive list. reclist_list_apply and reclist_string_apply use top level list and string structures respectively. Where func is of the form

void func(void *ptr, int type, void *data)

List   *reclist_list_update(List * list, void *(*func) ( /* ??? */ ), int type,
                            void *data)

Tstring *reclist_string_update(Tstring * str, void *(*func) ( /* ??? */ ),
                               int type, void *data)
Update all members of a recursive list that match the given type creating a new recursive list structure. The type NULL is wild and applies the function to all members of the recursive list. reclist_list_update and reclist_string_update use top level list and string structures respectively. Where func is of the form

void *func(void *ptr, int *type_ptr, void *data)
To allow the type fields of string and list structures to be updated. If func is NULL then elements are copied.

List   *reclist_list_flat(List * list, void *(*func) ( /* ??? */ ), int type,
                          void *data)

List   *reclist_string_flat(Tstring * str, void *(*func) ( /* ??? */ ), int type,
                            void *data)
Update all members of a recursive list that match the given type creating a simple (flat) list structure of type List. The type NULL is wild and applies the function to all members of the recursive list. reclist_list_update and reclist_string_update use top level list and string structures respectively. Where func is of the form

void *func(void *ptr, int *type_ptr, void *data)
To allow the type fields of string and list structures to be updated. If func is NULL then elements are copied.

List   *reclist_list_free(List * list, void (*freefunc) ( /* ??? */ ), int type,
                          void *data)

Tstring *reclist_string_free(Tstring * str, void (*freefunc) ( /* ??? */ ),
                             int type, void *data)
Free recursive lists using the function freefunc to free elements. The function freefunc is of the form

void freefunc(void *ptr, int type)


next up previous contents
Next: Serialisation Up: Generic Lists Previous: Property List Functions   Contents
root 2017-09-20