From 7bab5a71cefe37b583b08fec0177fc569f041980 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 6 Jan 2024 09:19:04 +0000 Subject: ar mode: slbt_get_archive_ctx(): initial implementation and integration. --- src/internal/slibtool_driver_impl.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/internal/slibtool_driver_impl.h') diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index 0293308..388e1cf 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -116,6 +116,10 @@ struct slbt_driver_ctx_impl { struct slbt_host_strs ahost; struct slbt_fd_ctx fdctx; struct slbt_obj_list * objlistv; + + const struct slbt_archive_ctx * arctx; + const char * arpath; + char * libname; char * dargs; char ** dargv; @@ -141,6 +145,13 @@ struct slbt_exec_ctx_impl { char * vbuffer[]; }; +struct slbt_archive_ctx_impl { + const char * path; + struct slbt_raw_archive map; + struct slbt_archive_meta * meta; + struct slbt_archive_ctx actx; +}; + static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct slbt_driver_ctx * dctx) { uintptr_t addr; @@ -153,6 +164,19 @@ static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct sl return 0; } +static inline void slbt_driver_set_arctx( + const struct slbt_driver_ctx * dctx, + const struct slbt_archive_ctx * arctx, + const char * arpath) +{ + struct slbt_driver_ctx_impl * ictx; + + + ictx = slbt_get_driver_ictx(dctx); + ictx->arctx = arctx; + ictx->arpath = arpath; +} + static inline char ** slbt_driver_envp(const struct slbt_driver_ctx * dctx) { struct slbt_driver_ctx_impl * ictx; -- cgit v1.2.3