summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-06 14:05:29 -0500
committermidipix <writeonce@midipix.org>2016-01-06 14:05:29 -0500
commit2e879cef83189bf50789ea3e3d144738222e828c (patch)
treed52a47d89815a2636ced615d3990cdb962cc63fa /src/output
parentd27fb44885209a32848465e1abe5fd76f26c780e (diff)
downloadapimagic-2e879cef83189bf50789ea3e3d144738222e828c.tar.bz2
apimagic-2e879cef83189bf50789ea3e3d144738222e828c.tar.xz
amgc_list_unit_enums(): initial implementation and integration.
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;
+}