summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-30 19:27:50 -0500
committermidipix <writeonce@midipix.org>2016-01-30 19:27:50 -0500
commitd1ebf813bf5f1fd7611bfa37dddfc779649e3668 (patch)
treee7e088b75072d0f171c5a0f85fecaba722bd451c /src/output
parent397226a5fb4a7b258ad4796d17628476bcbaf4f7 (diff)
downloadapimagic-d1ebf813bf5f1fd7611bfa37dddfc779649e3668.tar.bz2
apimagic-d1ebf813bf5f1fd7611bfa37dddfc779649e3668.tar.xz
amgc_output_compound(): validate input type, wrap around output_compound_entity().
Diffstat (limited to 'src/output')
-rw-r--r--src/output/amgc_output_compound.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/output/amgc_output_compound.c b/src/output/amgc_output_compound.c
index bbc85d9..02923b4 100644
--- a/src/output/amgc_output_compound.c
+++ b/src/output/amgc_output_compound.c
@@ -271,7 +271,7 @@ static int output_compound(
return 0;
}
-int amgc_output_compound(
+static int output_compound_entity(
const struct amgc_unit_ctx * uctx,
const struct amgc_entity * aentity,
const struct amgc_layout * layout,
@@ -298,3 +298,19 @@ int amgc_output_compound(
return 0;
}
+
+int amgc_output_compound(
+ const struct amgc_unit_ctx * uctx,
+ const struct amgc_entity * aentity,
+ const struct amgc_layout * layout,
+ FILE * fout)
+{
+ union entity_t const * entity;
+
+ entity = aentity->entity;
+
+ if ((entity->kind == ENTITY_STRUCT) || (entity->kind == ENTITY_UNION))
+ return output_compound_entity(uctx,aentity,layout,fout);
+ else
+ return -1;
+}