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:
@@ -163,17 +163,23 @@ METHOD(credential_factory_t, create, void*,
|
||||
return construct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter function for builder enumerator
|
||||
*/
|
||||
static bool builder_filter(void *null, entry_t **entry, credential_type_t *type,
|
||||
void *dummy1, int *subtype)
|
||||
CALLBACK(builder_filter, bool,
|
||||
void *null, enumerator_t *orig, va_list args)
|
||||
{
|
||||
if ((*entry)->final)
|
||||
entry_t *entry;
|
||||
credential_type_t *type;
|
||||
int *subtype;
|
||||
|
||||
VA_ARGS_VGET(args, type, subtype);
|
||||
|
||||
while (orig->enumerate(orig, &entry))
|
||||
{
|
||||
*type = (*entry)->type;
|
||||
*subtype = (*entry)->subtype;
|
||||
return TRUE;
|
||||
if (entry->final)
|
||||
{
|
||||
*type = entry->type;
|
||||
*subtype = entry->subtype;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -184,7 +190,7 @@ METHOD(credential_factory_t, create_builder_enumerator, enumerator_t*,
|
||||
this->lock->read_lock(this->lock);
|
||||
return enumerator_create_filter(
|
||||
this->constructors->create_enumerator(this->constructors),
|
||||
(void*)builder_filter, this->lock, (void*)this->lock->unlock);
|
||||
builder_filter, this->lock, (void*)this->lock->unlock);
|
||||
}
|
||||
|
||||
METHOD(credential_factory_t, destroy, void,
|
||||
|
||||
Reference in New Issue
Block a user