From a82cc2f34bddae9b79e582a3bcc6b2c9cbb5009b Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 27 Jun 2018 03:51:35 +0000 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- src/internal/slibtool_driver_impl.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/internal/slibtool_driver_impl.h') diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index 2f2302a..ef67bb8 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -83,6 +83,7 @@ struct slbt_driver_ctx_impl { struct slbt_driver_ctx ctx; struct slbt_host_strs host; struct slbt_host_strs ahost; + struct slbt_fd_ctx fdctx; char * libname; char ** targv; char ** cargv; @@ -104,4 +105,32 @@ static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct sl return 0; } +static inline int slbt_driver_fdin(const struct slbt_driver_ctx * dctx) +{ + struct slbt_fd_ctx fdctx; + slbt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdin; +} + +static inline int slbt_driver_fdout(const struct slbt_driver_ctx * dctx) +{ + struct slbt_fd_ctx fdctx; + slbt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdout; +} + +static inline int slbt_driver_fderr(const struct slbt_driver_ctx * dctx) +{ + struct slbt_fd_ctx fdctx; + slbt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fderr; +} + +static inline int slbt_driver_fdlog(const struct slbt_driver_ctx * dctx) +{ + struct slbt_fd_ctx fdctx; + slbt_get_driver_fdctx(dctx,&fdctx); + return fdctx.fdlog; +} + #endif -- cgit v1.2.3