Change interface for enumerator_create_filter() callback
This avoids the unportable 5 pointer hack, but requires enumerating in the callback.
This commit is contained in:
@@ -184,16 +184,22 @@ METHOD(attribute_provider_t, release_address, bool,
|
||||
return found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter mapping attribute_t to enumerated type/value arguments
|
||||
*/
|
||||
static bool attr_filter(void *data, attribute_t **attr,
|
||||
configuration_attribute_type_t *type,
|
||||
void *in, chunk_t *value)
|
||||
CALLBACK(attr_filter, bool,
|
||||
void *data, enumerator_t *orig, va_list args)
|
||||
{
|
||||
*type = (*attr)->type;
|
||||
*value = (*attr)->value;
|
||||
return TRUE;
|
||||
attribute_t *attr;
|
||||
configuration_attribute_type_t *type;
|
||||
chunk_t *value;
|
||||
|
||||
VA_ARGS_VGET(args, type, value);
|
||||
|
||||
if (orig->enumerate(orig, &attr))
|
||||
{
|
||||
*type = attr->type;
|
||||
*value = attr->value;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +209,7 @@ CALLBACK(create_nested, enumerator_t*,
|
||||
pool_t *pool, void *this)
|
||||
{
|
||||
return enumerator_create_filter(array_create_enumerator(pool->attrs),
|
||||
(void*)attr_filter, NULL, NULL);
|
||||
attr_filter, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user