summaryrefslogtreecommitdiffhomepage
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-07-21 20:32:45 -0400
committermidipix <writeonce@midipix.org>2018-07-24 12:05:30 -0400
commita85d3ea1cc6fc5f9e011a1b29e93c776da108a0b (patch)
tree7ec1521f26e854f95dae3adfaf7d636d67119dbd /src/internal
parent4323e6e27b9019e0209a348da02b4ca53e58f4c8 (diff)
downloadperk-a85d3ea1cc6fc5f9e011a1b29e93c776da108a0b.tar.bz2
perk-a85d3ea1cc6fc5f9e011a1b29e93c776da108a0b.tar.xz
driver, library interfaces: support alternate fd's for input/output/error/log.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/perk_driver_impl.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h
index 4a4d231..b17b7be 100644
--- a/src/internal/perk_driver_impl.h
+++ b/src/internal/perk_driver_impl.h
@@ -32,6 +32,7 @@ enum app_tags {
struct pe_driver_ctx_impl {
struct pe_common_ctx cctx;
struct pe_driver_ctx ctx;
+ struct pe_fd_ctx fdctx;
const struct pe_unit_ctx * euctx;
const char * eunit;
struct pe_error_info ** errinfp;
@@ -73,4 +74,46 @@ static inline void pe_driver_set_ectx(
ictx->eunit = unit;
}
+static inline int pe_driver_fdin(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdin;
+}
+
+static inline int pe_driver_fdout(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdout;
+}
+
+static inline int pe_driver_fderr(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fderr;
+}
+
+static inline int pe_driver_fdlog(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdlog;
+}
+
+static inline int pe_driver_fdcwd(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fdcwd;
+}
+
+static inline int pe_driver_fddst(const struct pe_driver_ctx * dctx)
+{
+ struct pe_fd_ctx fdctx;
+ pe_get_driver_fdctx(dctx,&fdctx);
+ return fdctx.fddst;
+}
+
#endif