summaryrefslogtreecommitdiffhomepage
path: root/include
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 /include
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 'include')
-rw-r--r--include/sofort/sofort.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/sofort/sofort.h b/include/sofort/sofort.h
index 76aeeca..1c1dee2 100644
--- a/include/sofort/sofort.h
+++ b/include/sofort/sofort.h
@@ -70,6 +70,15 @@ struct sfrt_source_version {
const char * commit;
};
+struct sfrt_fd_ctx {
+ int fdin;
+ int fdout;
+ int fderr;
+ int fdlog;
+ int fdcwd;
+ int fddst;
+};
+
struct sfrt_error_info {
const struct sfrt_driver_ctx * edctx;
const struct sfrt_unit_ctx * euctx;
@@ -106,6 +115,7 @@ struct sfrt_unit_ctx {
/* driver api */
sfrt_api int sfrt_get_driver_ctx (char **, char **, uint32_t,
+ const struct sfrt_fd_ctx *,
struct sfrt_driver_ctx **);
sfrt_api void sfrt_free_driver_ctx (struct sfrt_driver_ctx *);
@@ -115,8 +125,11 @@ sfrt_api int sfrt_get_unit_ctx (const struct sfrt_driver_ctx *, const c
sfrt_api void sfrt_free_unit_ctx (struct sfrt_unit_ctx *);
+sfrt_api int sfrt_get_driver_fdctx (const struct sfrt_driver_ctx *, struct sfrt_fd_ctx *);
+sfrt_api int sfrt_set_driver_fdctx (struct sfrt_driver_ctx *, const struct sfrt_fd_ctx *);
+
/* utility api */
-sfrt_api int sfrt_main (int, char **, char **);
+sfrt_api int sfrt_main (int, char **, char **, const struct sfrt_fd_ctx *);
sfrt_api int sfrt_output_dummy (const struct sfrt_common_ctx *, FILE *); /* dummy */
sfrt_api int sfrt_output_name (const struct sfrt_unit_ctx *, FILE *); /* dummy */
sfrt_api int sfrt_output_address (const struct sfrt_unit_ctx *, FILE *); /* dummy */