diff options
author | Martin Willi <martin@strongswan.org> | 2007-02-28 14:04:36 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-02-28 14:04:36 +0000 |
commit | c60c7694d2d8925c5d93ff33d132f561ad89e071 (patch) | |
tree | 9c7957b0749139c5e7c9b008c927e79d69f8e500 /src/libstrongswan/utils/iterator.h | |
parent | a7a5e834e318d0582b6db979b63a5739c0a8244f (diff) | |
download | strongswan-c60c7694d2d8925c5d93ff33d132f561ad89e071.tar.bz2 strongswan-c60c7694d2d8925c5d93ff33d132f561ad89e071.tar.xz |
merged tasking branch into trunk
Diffstat (limited to 'src/libstrongswan/utils/iterator.h')
-rw-r--r-- | src/libstrongswan/utils/iterator.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/iterator.h b/src/libstrongswan/utils/iterator.h index 51a8d6061..02a15c534 100644 --- a/src/libstrongswan/utils/iterator.h +++ b/src/libstrongswan/utils/iterator.h @@ -24,6 +24,19 @@ #ifndef ITERATOR_H_ #define ITERATOR_H_ +#include <library.h> + +/** + * @brief Iterator hook function prototype. + * + * @param param user supplied parameter + * @param in the value the hook receives from the iterator + * @param out the value supplied as a result to the iterator + * @return TRUE to return "out", FALSE to skip this value + */ +typedef bool (iterator_hook_t)(void *param, void *in, void **out); + + typedef struct iterator_t iterator_t; /** @@ -76,8 +89,10 @@ struct iterator_t { * * @param this calling object * @param hook iterator hook which manipulates the iterated value + * @param param user supplied parameter to pass back to the hook */ - void (*set_iterator_hook) (iterator_t *this, void*(*hook)(void*)); + void (*set_iterator_hook) (iterator_t *this, iterator_hook_t *hook, + void *param); /** * @brief Inserts a new item before the given iterator position. |