summaryrefslogtreecommitdiffhomepage
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to 'src/output')
-rw-r--r--src/output/amgc_output_enum.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/output/amgc_output_enum.c b/src/output/amgc_output_enum.c
index be399df..3c8288b 100644
--- a/src/output/amgc_output_enum.c
+++ b/src/output/amgc_output_enum.c
@@ -149,3 +149,26 @@ int amgc_output_unit_enums(
return 0;
}
+
+int amgc_list_unit_enums(
+ const struct amgc_unit_ctx * uctx,
+ const struct amgc_layout * layout,
+ FILE * fout)
+{
+ const struct amgc_entity * aentity;
+
+ if (layout && layout->header && (fputs(layout->header,fout) < 0))
+ return -1;
+
+ for (aentity=uctx->entities->enums; aentity->entity; aentity++)
+ if ((fprintf(fout,"enum %s;\n",
+ aentity->entity && aentity->entity->base.symbol
+ ? aentity->entity->base.symbol->string
+ : aentity->altname) < 0))
+ return -1;
+
+ if (layout && layout->footer && (fputs(layout->footer,fout) < 0))
+ return -1;
+
+ return 0;
+}