functions invoked on all linked list items now support up to five additional arguments

This commit is contained in:
Tobias Brunner
2008-04-18 11:48:53 +00:00
parent b1f8fc0cdb
commit ebb036feec
3 changed files with 23 additions and 11 deletions
+13 -3
View File
@@ -45,6 +45,14 @@ typedef struct linked_list_t linked_list_t;
*/
typedef bool (*linked_list_match_t)(void *item, ...);
/**
* Method to be invoked on elements in a linked list (used in invoke_* functions)
*
* @param item current list item
* @param ... user supplied data (only pointers, at most 5)
*/
typedef void (*linked_list_invoke_t)(void *item, ...);
/**
* Class implementing a double linked list.
*
@@ -210,15 +218,17 @@ struct linked_list_t {
* macro, e.g.: list->invoke(list, offsetof(object_t, method));
*
* @param offset offset of the method to invoke on objects
* @param ... user data to supply to called function (limited to 5 arguments)
*/
void (*invoke_offset) (linked_list_t *this, size_t offset);
void (*invoke_offset) (linked_list_t *this, size_t offset, ...);
/**
* Invoke a function on all of the contained objects.
*
* @param offset offset of the method to invoke on objects
* @param function offset of the method to invoke on objects
* @param ... user data to supply to called function (limited to 5 arguments)
*/
void (*invoke_function) (linked_list_t *this, void (*)(void*));
void (*invoke_function) (linked_list_t *this, linked_list_invoke_t function, ...);
/**
* Clones a list and its objects using the objects' clone method.