From a85d3ea1cc6fc5f9e011a1b29e93c776da108a0b Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 21 Jul 2018 20:32:45 -0400 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- include/perk/perk.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include/perk/perk.h') 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 *); -- cgit v1.2.3