summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-04 12:37:44 -0400
committermidipix <writeonce@midipix.org>2018-08-05 03:22:20 -0400
commitabf92311681c10ed589ac05f0f2b451e01fbc63e (patch)
tree12be9fc344e500330f4b2876406b91d858a94433 /include
parent0dfdcbb2bd0295ccfc2da2ce2e8efe6997b45a2c (diff)
downloadapimagic-abf92311681c10ed589ac05f0f2b451e01fbc63e.tar.bz2
apimagic-abf92311681c10ed589ac05f0f2b451e01fbc63e.tar.xz
driver, library interfaces: support alternate fd's for input/output/error/log.
Diffstat (limited to 'include')
-rw-r--r--include/apimagic/apimagic.h15
1 files changed, 14 insertions, 1 deletions
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 *);