/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "strescape.h"
#include "dsync-serializer.h"
#include "dsync-deserializer.h"
struct dsync_deserializer {
const char *name;
const char *const *required_fields;
const char *const *keys;
unsigned int *required_field_indexes;
unsigned int required_field_count;
};
struct dsync_deserializer_decoder {
const char *const *values;
unsigned int values_count;
};
unsigned int *idx_r)
{
unsigned int i;
*idx_r = i;
return TRUE;
}
}
return FALSE;
}
const char *header_line,
struct dsync_deserializer **deserializer_r,
const char **error_r)
{
const char **dup_required_fields;
unsigned int i, required_count;
*deserializer_r = NULL;
required_fields == NULL ? 0 :
for (i = 0; i < required_count; i++) {
dup_required_fields[i] =
&deserializer->required_field_indexes[i])) {
"Header missing required field %s",
required_fields[i]);
pool_unref(&pool);
return -1;
}
}
return 0;
}
{
*_deserializer = NULL;
}
const char *input,
struct dsync_deserializer_decoder **decoder_r,
const char **error_r)
{
unsigned int i;
char **values;
/* fix NULLs */
/* NULL? */
else
values[i] += 1;
}
}
decoder->values_count = i;
/* see if all required fields exist */
for (i = 0; i < deserializer->required_field_count; i++) {
deserializer->required_fields[i]);
pool_unref(&pool);
return -1;
}
}
return 0;
}
static bool
{
unsigned int i;
*idx_r = i;
return TRUE;
}
}
return FALSE;
}
{
unsigned int idx;
return FALSE;
} else {
}
}
const char *
const char *key)
{
const char *value;
i_panic("dsync_deserializer_decode_get() "
"used for non-required key %s", key);
}
return value;
}
const char *
{
}
{
}