From ec000532ee50c64e66a76114b745f6804901bab9 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 5 Aug 2018 04:29:18 -0400 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- src/internal/ntux_driver_impl.h | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/internal') diff --git a/src/internal/ntux_driver_impl.h b/src/internal/ntux_driver_impl.h index 32e3d1f..e55fdb6 100644 --- a/src/internal/ntux_driver_impl.h +++ b/src/internal/ntux_driver_impl.h @@ -30,6 +30,7 @@ enum app_tags { struct ntux_driver_ctx_impl { struct ntux_common_ctx cctx; struct ntux_driver_ctx ctx; + struct ntux_fd_ctx fdctx; struct __psx_context xctx; const struct ntux_unit_ctx *euctx; const char * eunit; @@ -66,4 +67,46 @@ static inline void ntux_driver_set_ectx( ictx->eunit = unit; } +static inline int ntux_driver_fdin(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdin; +} + +static inline int ntux_driver_fdout(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdout; +} + +static inline int ntux_driver_fderr(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fderr; +} + +static inline int ntux_driver_fdlog(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdlog; +} + +static inline int ntux_driver_fdcwd(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdcwd; +} + +static inline int ntux_driver_fddst(const struct ntux_driver_ctx * dctx) +{ + struct ntux_fd_ctx fdctx; + ntux_get_driver_fdctx(dctx,&fdctx); + return fdctx.fddst; +} + #endif -- cgit v1.2.3