1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <assert.h>
5 
6 #include <libconflate/conflate.h>
7 #include "conflate_internal.h"
8 
9 /** \private */
10 struct command_def {
11     char *name;
12     char *description;
13     conflate_mgmt_cb_t cb;
14     struct command_def *next;
15 };
16 
17 struct command_def *commands = NULL;
18 
19 void* run_conflate(void *arg);
20 
conflate_init_form(conflate_form_result *r)21 void conflate_init_form(conflate_form_result *r)
22 {
23     (void)r;
24 }
25 
conflate_next_fieldset(conflate_form_result *r)26 void conflate_next_fieldset(conflate_form_result *r) {
27     (void)r;
28     assert(0);
29 }
30 
conflate_add_field(conflate_form_result *r, const char *k, const char *v)31 void conflate_add_field(conflate_form_result *r, const char *k, const char *v) {
32     (void)r;
33     (void)k;
34     (void)v;
35     assert(0);
36 }
37 
conflate_add_field_multi(conflate_form_result *r, const char *k, const char **v)38 void conflate_add_field_multi(conflate_form_result *r, const char *k,
39                               const char **v) {
40     (void)r;
41     (void)k;
42     (void)v;
43     assert(0);
44 }
45 
run_conflate(void *arg)46 void* run_conflate(void *arg) {
47     (void)arg;
48     assert(0);
49     return NULL;
50 }
51 
52 /* ------------------------------------------------------------------------ */
53 
conflate_register_mgmt_cb(const char *cmd, const char *desc, conflate_mgmt_cb_t cb)54 void conflate_register_mgmt_cb(const char *cmd, const char *desc,
55                                conflate_mgmt_cb_t cb)
56 {
57     struct command_def *c = calloc(1, sizeof(struct command_def));
58     assert(c);
59 
60     c->name = safe_strdup(cmd);
61     c->description = safe_strdup(desc);
62     c->cb = cb;
63     c->next = commands;
64 
65     commands = c;
66 }
67