+/*******************************************************************************
+ * Config reply callbacks
+ *******************************************************************************/
+
+static char *config_last_key = NULL;
+
+static int config_string_cb(void *params, const unsigned char *val, size_t len) {
+ char *str = scalloc(len + 1, 1);
+ strncpy(str, (const char *)val, len);
+ if (strcmp(config_last_key, "config") == 0) {
+ fprintf(stdout, "%s", str);
+ }
+ free(str);
+ return 1;
+}
+
+static int config_start_map_cb(void *params) {
+ return 1;
+}
+
+static int config_end_map_cb(void *params) {
+ return 1;
+}
+
+static int config_map_key_cb(void *params, const unsigned char *keyVal, size_t keyLen) {
+ config_last_key = scalloc(keyLen + 1, 1);
+ strncpy(config_last_key, (const char *)keyVal, keyLen);
+ return 1;
+}
+
+static yajl_callbacks config_callbacks = {
+ .yajl_string = config_string_cb,
+ .yajl_start_map = config_start_map_cb,
+ .yajl_map_key = config_map_key_cb,
+ .yajl_end_map = config_end_map_cb,
+};
+