summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/slibtool_driver_impl.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index 47c854e..2eb7a14 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -99,6 +99,17 @@ struct slbt_driver_ctx_impl {
struct slbt_error_info erribuf[64];
};
+struct slbt_exec_ctx_impl {
+ int argc;
+ char * args;
+ char * shadow;
+ char * dsoprefix;
+ size_t size;
+ struct slbt_exec_ctx ctx;
+ int fdwrapper;
+ char * vbuffer[];
+};
+
static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct slbt_driver_ctx * dctx)
{
uintptr_t addr;
@@ -139,4 +150,34 @@ static inline int slbt_driver_fdlog(const struct slbt_driver_ctx * dctx)
return fdctx.fdlog;
}
+static inline struct slbt_exec_ctx_impl * slbt_get_exec_ictx(const struct slbt_exec_ctx * ectx)
+{
+ uintptr_t addr;
+
+ addr = (uintptr_t)ectx - offsetof(struct slbt_exec_ctx_impl,ctx);
+ return (struct slbt_exec_ctx_impl *)addr;
+}
+
+static inline int slbt_exec_get_fdwrapper(const struct slbt_exec_ctx * ectx)
+{
+ struct slbt_exec_ctx_impl * ictx;
+ ictx = slbt_get_exec_ictx(ectx);
+ return ictx->fdwrapper;
+}
+
+static inline void slbt_exec_set_fdwrapper(const struct slbt_exec_ctx * ectx, int fd)
+{
+ struct slbt_exec_ctx_impl * ictx;
+ ictx = slbt_get_exec_ictx(ectx);
+ ictx->fdwrapper = fd;
+}
+
+static inline void slbt_exec_close_fdwrapper(const struct slbt_exec_ctx * ectx)
+{
+ struct slbt_exec_ctx_impl * ictx;
+ ictx = slbt_get_exec_ictx(ectx);
+ close(ictx->fdwrapper);
+ ictx->fdwrapper = (-1);
+}
+
#endif