summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-30 20:15:20 -0500
committermidipix <writeonce@midipix.org>2016-01-31 12:43:50 -0500
commit0c91ec9d3ffdcc3a978eaa3bc02470462d34df7a (patch)
tree80dfa07bdd841d63d13f8871b31cc32922b5d5a3 /src/output
parentca3de486debc160722d02cbd969a7796894ecd56 (diff)
downloadapimagic-0c91ec9d3ffdcc3a978eaa3bc02470462d34df7a.tar.bz2
apimagic-0c91ec9d3ffdcc3a978eaa3bc02470462d34df7a.tar.xz
driver: --print-structs and --print-unions: initial integration.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/amgc_output_compound.c28
-rw-r--r--src/output/amgc_output_entities.c6
2 files changed, 34 insertions, 0 deletions
diff --git a/src/output/amgc_output_compound.c b/src/output/amgc_output_compound.c
index 07bd730..fc95af7 100644
--- a/src/output/amgc_output_compound.c
+++ b/src/output/amgc_output_compound.c
@@ -346,3 +346,31 @@ int amgc_output_union(
else
return -1;
}
+
+int amgc_output_unit_structs(
+ const struct amgc_unit_ctx * uctx,
+ const struct amgc_layout * layout,
+ FILE * fout)
+{
+ const struct amgc_entity * aentity;
+
+ for (aentity=uctx->entities->structs; aentity->entity; aentity++)
+ if (output_compound_entity(uctx,aentity,layout,fout))
+ return -1;
+
+ return 0;
+}
+
+int amgc_output_unit_unions(
+ const struct amgc_unit_ctx * uctx,
+ const struct amgc_layout * layout,
+ FILE * fout)
+{
+ const struct amgc_entity * aentity;
+
+ for (aentity=uctx->entities->unions; aentity->entity; aentity++)
+ if (output_compound_entity(uctx,aentity,layout,fout))
+ return -1;
+
+ return 0;
+}
diff --git a/src/output/amgc_output_entities.c b/src/output/amgc_output_entities.c
index 9d8d017..c1618c2 100644
--- a/src/output/amgc_output_entities.c
+++ b/src/output/amgc_output_entities.c
@@ -40,6 +40,12 @@ int amgc_output_unit_entities(
case ENTITY_TYPEDEF:
return output_typedefs(uctx,subset,layout,fout);
+
+ case ENTITY_STRUCT:
+ return amgc_output_unit_structs(uctx,layout,fout);
+
+ case ENTITY_UNION:
+ return amgc_output_unit_unions(uctx,layout,fout);
}
return -1;