From d4f88d42725956c3aa6d9c6e83e70729c1a938e8 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 4 Aug 2018 03:56:54 -0400 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- src/internal/sofort_driver_impl.h | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/internal/sofort_driver_impl.h') diff --git a/src/internal/sofort_driver_impl.h b/src/internal/sofort_driver_impl.h index 640aa2d..a7615ad 100644 --- a/src/internal/sofort_driver_impl.h +++ b/src/internal/sofort_driver_impl.h @@ -23,6 +23,7 @@ enum app_tags { struct sfrt_driver_ctx_impl { struct sfrt_common_ctx cctx; struct sfrt_driver_ctx ctx; + struct sfrt_fd_ctx fdctx; const struct sfrt_unit_ctx * euctx; const char * eunit; struct sfrt_error_info ** errinfp; @@ -62,4 +63,46 @@ static inline void sfrt_driver_set_ectx( ictx->eunit = unit; } +static inline int sfrt_driver_fdin(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdin; +} + +static inline int sfrt_driver_fdout(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdout; +} + +static inline int sfrt_driver_fderr(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fderr; +} + +static inline int sfrt_driver_fdlog(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdlog; +} + +static inline int sfrt_driver_fdcwd(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdcwd; +} + +static inline int sfrt_driver_fddst(const struct sfrt_driver_ctx * dctx) +{ + struct sfrt_fd_ctx fdctx; + sfrt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fddst; +} + #endif -- cgit v1.2.3