+typedef struct config_key {
+ const char *name;
+ bool in_db;
+ bool prefix;
+ bool (*validate)(const char *);
+} config_key_info_t;
+
+static struct config_key
+config_key_table[] = {
+ {"index.decrypt", true, false, NULL},
+ {"index.header.", true, true, validate_field_name},
+ {"query.", true, true, NULL},
+};
+
+static config_key_info_t *
+_config_key_info (const char *item)
+{
+ for (size_t i = 0; i < ARRAY_SIZE (config_key_table); i++) {
+ if (config_key_table[i].prefix &&
+ strncmp (item, config_key_table[i].name,
+ strlen(config_key_table[i].name)) == 0)
+ return config_key_table+i;
+ if (strcmp (item, config_key_table[i].name) == 0)
+ return config_key_table+i;
+ }
+ return NULL;
+}
+