+void afb_config_dump(struct afb_config *config)
+{
+ struct afb_config_list *l;
+ struct enumdesc *e;
+
+#define NN(x) (x)?:""
+#define P(...) fprintf(stderr, __VA_ARGS__)
+#define PF(x) P("-- %15s: ", #x)
+#define PE P("\n")
+#define S(x) PF(x);P("%s",NN(config->x));PE;
+#define D(x) PF(x);P("%d",config->x);PE;
+#define H(x) PF(x);P("%x",config->x);PE;
+#define L(x) PF(x);l=config->x;if(l){P("%s\n",NN(l->value));for(l=l->next;l;l=l->next)P("-- %15s %s\n","",NN(l->value));}else PE;
+#define E(x,d) for(e=d;e->name&&e->value!=config->x;e++);PF(x);if(e->name)P("%s",e->name);else P("%d",config->x);PE;
+
+ P("-- BEGIN OF CONFIG --\n");
+ S(console)
+ S(rootdir)
+ S(roothttp)
+ S(rootbase)
+ S(rootapi)
+ S(sessiondir)
+ S(token)
+
+ L(aliases)
+ L(dbus_clients)
+ L(dbus_servers)
+ L(ws_clients)
+ L(ws_servers)
+ L(so_bindings)
+ L(ldpaths)
+
+ D(httpdPort)
+ D(background)
+ D(readyfd)
+ D(cacheTimeout)
+ D(apiTimeout)
+ D(cntxTimeout)
+ D(nbSessionMax)
+ E(mode,mode_desc)
+ E(tracereq,tracereq_desc)
+ P("-- END OF CONFIG --\n");
+
+#undef E
+#undef L
+#undef H
+#undef D
+#undef S
+#undef PE
+#undef PF
+#undef P
+#undef NN
+}
+