summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-04 03:56:54 -0400
committermidipix <writeonce@midipix.org>2018-08-04 05:21:02 -0400
commitd4f88d42725956c3aa6d9c6e83e70729c1a938e8 (patch)
treec5b3569b5e4f4872376e924e19e9027e7b4d01a7 /src/internal
parente203594f6b01576630ef72a6ac6872e52f97c4c2 (diff)
downloadsofort-d4f88d42725956c3aa6d9c6e83e70729c1a938e8.tar.bz2
sofort-d4f88d42725956c3aa6d9c6e83e70729c1a938e8.tar.xz
driver, library interfaces: support alternate fd's for input/output/error/log.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/sofort_driver_impl.h43
1 files changed, 43 insertions, 0 deletions
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