13static const char *type_to_group(
const char *name)
15 if (strcmp(name,
"uint") == 0)
20static void dump_schema(FILE *f,
const struct ec_node_type *type)
22 fprintf(f,
"@addtogroup ecoli_node_%s\n", type_to_group(type->name));
24 fprintf(f,
"<b>Configuration Schema</b>\n\n");
26 if (type->schema == NULL) {
27 fprintf(f,
"No configuration schema.\n");
37int main(
int argc,
char **argv)
40 const char *dir, *stamp;
45 errx(EXIT_FAILURE,
"invalid arguments. usage: %s DIR STAMP_FILE", argv[0]);
51 snprintf(fname,
sizeof(fname),
"%s/node-%s-schema.md", dir, type->name);
52 printf(
"generating %s ...\n", fname);
53 f = fopen(fname,
"w");
55 errx(EXIT_FAILURE,
"failed to create file: %s", fname);
60 f = fopen(stamp,
"w");
62 errx(EXIT_FAILURE,
"failed to created stamp file: %s", stamp);
void ec_config_schema_dump(FILE *out, const struct ec_config_schema *schema, const char *name)
struct ec_node_type_list node_type_list