Migrate all enumerators to venumerate() interface change

This commit is contained in:
Tobias Brunner
2017-05-26 13:56:44 +02:00
parent 16bffa8b55
commit 95a63bf281
68 changed files with 851 additions and 560 deletions
@@ -122,9 +122,14 @@ typedef struct {
endecode_test_t *next;
} endecode_enum_t;
static bool endecode_enumerate(endecode_enum_t *this, vici_type_t *type,
char **name, chunk_t *data)
METHOD(enumerator_t, endecode_enumerate, bool,
endecode_enum_t *this, va_list args)
{
vici_type_t *type;
chunk_t *data;
char **name;
VA_ARGS_VGET(args, type, name, data);
if (this->next)
{
*type = this->next->type;
@@ -149,7 +154,8 @@ static enumerator_t *endecode_create_enumerator(endecode_test_t *test)
INIT(enumerator,
.public = {
.enumerate = (void*)endecode_enumerate,
.enumerate = enumerator_enumerate_default,
.venumerate = _endecode_enumerate,
.destroy = (void*)free,
},
.next = test,
+8 -2
View File
@@ -135,11 +135,16 @@ typedef struct {
} parse_enumerator_t;
METHOD(enumerator_t, parse_enumerate, bool,
parse_enumerator_t *this, vici_type_t *out, char **name, chunk_t *value)
parse_enumerator_t *this, va_list args)
{
vici_type_t *out;
chunk_t *value;
char **name;
uint8_t type;
chunk_t data;
VA_ARGS_VGET(args, out, name, value);
if (!this->reader->remaining(this->reader) ||
!this->reader->read_uint8(this->reader, &type))
{
@@ -218,7 +223,8 @@ METHOD(vici_message_t, create_enumerator, enumerator_t*,
INIT(enumerator,
.public = {
.enumerate = (void*)_parse_enumerate,
.enumerate = enumerator_enumerate_default,
.venumerate = _parse_enumerate,
.destroy = _parse_destroy,
},
.reader = bio_reader_create(this->encoding),