summaryrefslogtreecommitdiffhomepage
path: root/include
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 /include
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 'include')
-rw-r--r--include/perk/perk.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h
index d176243..675f437 100644
--- a/include/perk/perk.h
+++ b/include/perk/perk.h
@@ -126,6 +126,15 @@ struct pe_source_version {
const char * commit;
};
+struct pe_fd_ctx {
+ int fdin;
+ int fdout;
+ int fderr;
+ int fdlog;
+ int fdcwd;
+ int fddst;
+};
+
struct pe_error_info {
const struct pe_driver_ctx * edctx;
const struct pe_unit_ctx * euctx;
@@ -166,6 +175,7 @@ struct pe_info_string {
/* driver api */
perk_api int pe_get_driver_ctx (char ** argv, char ** envp, uint32_t flags,
+ const struct pe_fd_ctx *,
struct pe_driver_ctx **);
perk_api void pe_free_driver_ctx (struct pe_driver_ctx *);
@@ -175,8 +185,12 @@ perk_api int pe_get_unit_ctx (const struct pe_driver_ctx *, const cha
perk_api void pe_free_unit_ctx (struct pe_unit_ctx *);
+perk_api int pe_get_driver_fdctx (const struct pe_driver_ctx *, struct pe_fd_ctx *);
+perk_api int pe_set_driver_fdctx (struct pe_driver_ctx *, const struct pe_fd_ctx *);
+
/* utility api */
-perk_api int pe_main (int, char **, char **);
+perk_api int pe_main (int, char **, char **, const struct pe_fd_ctx *);
+
perk_api int pe_output_image_category (const struct pe_driver_ctx *, const struct pe_image_meta *, FILE *);
perk_api int pe_output_image_sections (const struct pe_driver_ctx *, const struct pe_image_meta *, FILE *);
perk_api int pe_output_image_symbols (const struct pe_driver_ctx *, const struct pe_image_meta *, FILE *);