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. --- src/internal/apimagic_driver_impl.h | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/internal') 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 -- cgit v1.2.3