From f2e43d1d66a6455febcf06fd740d2369f296954c Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 8 Jan 2016 17:20:59 -0500 Subject: driver: --print-typedefs: initial implementation. --- src/driver/amgc_driver_ctx.c | 9 +++++++++ src/driver/amgc_unit_action.c | 7 +++++++ 2 files changed, 16 insertions(+) (limited to 'src/driver') diff --git a/src/driver/amgc_driver_ctx.c b/src/driver/amgc_driver_ctx.c index 2b33de4..1e92e74 100644 --- a/src/driver/amgc_driver_ctx.c +++ b/src/driver/amgc_driver_ctx.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -202,6 +203,14 @@ int amgc_get_driver_ctx( ctx->actions[nactions].type = AMGC_ACTION_OUTPUT; ctx->actions[nactions++].action = AMGC_LIST_ENUM; break; + + case TAG_PRINT_TYPEDEFS: + ctx->actions[nactions].type = AMGC_ACTION_OUTPUT; + ctx->actions[nactions].action = AMGC_OUTPUT_TYPEDEF; + + if (!strcmp("primary",entry->arg)) + ctx->actions[nactions++].subset = TYPE_ATOMIC; + break; } ctx->ctx.program = program; diff --git a/src/driver/amgc_unit_action.c b/src/driver/amgc_unit_action.c index 04cfb8f..0a07cb9 100644 --- a/src/driver/amgc_unit_action.c +++ b/src/driver/amgc_unit_action.c @@ -4,6 +4,8 @@ /* Released under GPLv2 and GPLv3; see COPYING.APIMAGIC. */ /**********************************************************/ +#include + #include #include "apimagic_driver_impl.h" @@ -25,6 +27,11 @@ int amgc_perform_unit_action( return -1; else return amgc_list_unit_enums(uctx,0,stdout); + + case AMGC_OUTPUT_TYPEDEF: + return amgc_output_unit_entities( + uctx,ENTITY_TYPEDEF,action->subset, + layout,fout); } return -1; -- cgit v1.2.3