diff options
author | midipix <writeonce@midipix.org> | 2016-01-06 14:05:29 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-01-06 14:05:29 -0500 |
commit | 2e879cef83189bf50789ea3e3d144738222e828c (patch) | |
tree | d52a47d89815a2636ced615d3990cdb962cc63fa /src/output | |
parent | d27fb44885209a32848465e1abe5fd76f26c780e (diff) | |
download | apimagic-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.c | 23 |
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; +} |