diff options
Diffstat (limited to 'src/libimcv/ita/ita_attr_settings.c')
-rw-r--r-- | src/libimcv/ita/ita_attr_settings.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/libimcv/ita/ita_attr_settings.c b/src/libimcv/ita/ita_attr_settings.c index c7c968a26..b0907789e 100644 --- a/src/libimcv/ita/ita_attr_settings.c +++ b/src/libimcv/ita/ita_attr_settings.c @@ -262,22 +262,29 @@ METHOD(ita_attr_settings_t, add, void, this->list->insert_last(this->list, entry); } -/** - * Enumerate name/value pairs - */ -static bool entry_filter(void *null, entry_t **entry, char **name, - void *i2, chunk_t *value) +CALLBACK(entry_filter, bool, + void *null, enumerator_t *orig, va_list args) { - *name = (*entry)->name; - *value = (*entry)->value; - return TRUE; + entry_t *entry; + chunk_t *value; + char **name; + + VA_ARGS_VGET(args, name, value); + + while (orig->enumerate(orig, &entry)) + { + *name = entry->name; + *value = entry->value; + return TRUE; + } + return FALSE; } METHOD(ita_attr_settings_t, create_enumerator, enumerator_t*, private_ita_attr_settings_t *this) { return enumerator_create_filter(this->list->create_enumerator(this->list), - (void*)entry_filter, NULL, NULL); + entry_filter, NULL, NULL); } /** |