summaryrefslogtreecommitdiff
path: root/src/internal
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 /src/internal
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 'src/internal')
-rw-r--r--src/internal/apimagic_driver_impl.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/internal/apimagic_driver_impl.h b/src/internal/apimagic_driver_impl.h
index 44268e0..a50a2ec 100644
--- a/src/internal/apimagic_driver_impl.h
+++ b/src/internal/apimagic_driver_impl.h
@@ -31,6 +31,7 @@ enum app_tags {
struct amgc_driver_ctx_impl {
struct amgc_common_ctx cctx;
struct amgc_driver_ctx ctx;
+ struct amgc_fd_ctx fdctx;
struct amgc_action * actions;
struct compilation_env_t ccenv;
int fdtmpin;
@@ -80,4 +81,46 @@ static inline void amgc_driver_set_ectx(
ictx->eunit = unit;
}
+static inline int amgc_driver_fdin(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdin;
+}
+
+static inline int amgc_driver_fdout(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdout;
+}
+
+static inline int amgc_driver_fderr(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fderr;
+}
+
+static inline int amgc_driver_fdlog(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdlog;
+}
+
+static inline int amgc_driver_fdcwd(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdcwd;
+}
+
+static inline int amgc_driver_fddst(const struct amgc_driver_ctx * dctx)
+{
+ struct amgc_fd_ctx fdctx;
+ amgc_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fddst;
+}
+
#endif