From abf92311681c10ed589ac05f0f2b451e01fbc63e Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 4 Aug 2018 12:37:44 -0400 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- include/apimagic/apimagic.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/apimagic/apimagic.h b/include/apimagic/apimagic.h index 57a24fa..6c75bdd 100644 --- a/include/apimagic/apimagic.h +++ b/include/apimagic/apimagic.h @@ -90,6 +90,15 @@ struct amgc_source_version { const char * commit; }; +struct amgc_fd_ctx { + int fdin; + int fdout; + int fderr; + int fdlog; + int fdcwd; + int fddst; +}; + struct amgc_action { enum amgc_action_type type; int action; @@ -188,6 +197,7 @@ struct amgc_layout { /* driver api */ amgc_api int amgc_get_driver_ctx (char **, char **, uint32_t, + const struct amgc_fd_ctx *, struct amgc_driver_ctx **); amgc_api void amgc_free_driver_ctx (struct amgc_driver_ctx *); @@ -198,11 +208,14 @@ amgc_api int amgc_get_unit_ctx (const struct amgc_driver_ctx *, amgc_api void amgc_free_unit_ctx (struct amgc_unit_ctx *); +amgc_api int amgc_get_driver_fdctx (const struct amgc_driver_ctx *, struct amgc_fd_ctx *); +amgc_api int amgc_set_driver_fdctx (struct amgc_driver_ctx *, const struct amgc_fd_ctx *); + /* driver helper api */ amgc_api int amgc_lang_std_from_string (const char *); /* utility api */ -amgc_api int amgc_main (int, char **, char **); +amgc_api int amgc_main (int, char **, char **, const struct amgc_fd_ctx *); amgc_api int amgc_list_unit_defines (const struct amgc_unit_ctx *, const struct amgc_layout *, FILE *); amgc_api int amgc_list_unit_enums (const struct amgc_unit_ctx *, const struct amgc_layout *, FILE *); amgc_api int amgc_list_unit_typedefs (const struct amgc_unit_ctx *, const struct amgc_layout *, FILE *); -- cgit v1.2.3