-void afb_config_dump(struct afb_config *config)
-{
- struct afb_config_list *l;
- struct enumdesc *e;
- char **v;
-
-#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 B(x) PF(x);P("%s",config->x?"yes":"no");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++);if(e->name){PF(x);P("%s",e->name);PE;}else{D(x);}
-#define V(x) P("-- %15s:", #x);for(v=config->x;v&&*v;v++)P(" %s",*v); PE;
-
- P("---BEGIN-OF-CONFIG---\n");
- S(console)
- S(rootdir)
- S(roothttp)
- S(rootbase)
- S(rootapi)
- S(workdir)
- S(uploaddir)
- S(token)
- S(name)
-
- L(aliases)
- L(dbus_clients)
- L(dbus_servers)
- L(ws_clients)
- L(ws_servers)
- L(so_bindings)
- L(ldpaths)
- L(weak_ldpaths)
- L(calls)
-
- V(exec)
-
- D(httpdPort)
- D(cacheTimeout)
- D(apiTimeout)
- D(cntxTimeout)
- D(nbSessionMax)
-
- E(mode,mode_desc)
- E(tracereq,tracereq_desc)
- E(traceditf,traceditf_desc)
- E(tracesvc,tracesvc_desc)
- E(traceevt,traceevt_desc)
-
- B(no_ldpaths)
- B(noHttpd)
- B(background)
- B(monitoring)
- B(random_token)
- P("---END-OF-CONFIG---\n");
-
-#undef V
-#undef E
-#undef L
-#undef B
-#undef H
-#undef D
-#undef S
-#undef PE
-#undef PF
-#undef P
-#undef NN
-}
-
-static void on_environment_list(struct afb_config_list **to, const char *name)
-{
- char *value = getenv(name);
-
- if (value)
- list_add(to, value);
-}
-
-static void on_environment_enum(int *to, const char *name, struct enumdesc *desc)
-{
- char *value = getenv(name);