From 5d46be2ef1d419ac006be29bd894a30e2cf94ad9 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 27 Jan 2024 20:18:57 +0000 Subject: archiver output api: added slbt_ar_output_arname(). --- src/internal/slibtool_driver_impl.h | 12 ++++++++++++ 1 file changed, 12 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 b1a07f7..2008324 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -157,6 +157,18 @@ struct slbt_archive_ctx_impl { struct slbt_archive_ctx actx; }; +static inline struct slbt_archive_ctx_impl * slbt_get_archive_ictx(const struct slbt_archive_ctx * actx) +{ + uintptr_t addr; + + if (actx) { + addr = (uintptr_t)actx - offsetof(struct slbt_archive_ctx_impl,actx); + return (struct slbt_archive_ctx_impl *)addr; + } + + return 0; +} + static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct slbt_driver_ctx * dctx) { uintptr_t addr; -- cgit v1.2.3