diff options
author | midipix <writeonce@midipix.org> | 2024-01-06 09:15:26 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-22 03:49:50 +0000 |
commit | d4473b3be02d429a72347914a6fc7e5688ad98e5 (patch) | |
tree | 138d10289bb4f7b5dc42da466447807591ba1836 /src/internal | |
parent | 8a9ab12c467fe48944272ae9bd073f90854b13f8 (diff) | |
download | slibtool-d4473b3be02d429a72347914a6fc7e5688ad98e5.tar.bz2 slibtool-d4473b3be02d429a72347914a6fc7e5688ad98e5.tar.xz |
slbt_get_archive_meta(): initial implementation.
Diffstat (limited to 'src/internal')
-rw-r--r-- | src/internal/slibtool_ar_impl.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/internal/slibtool_ar_impl.h b/src/internal/slibtool_ar_impl.h index 3dfabe7..13cd6ef 100644 --- a/src/internal/slibtool_ar_impl.h +++ b/src/internal/slibtool_ar_impl.h @@ -2,6 +2,8 @@ #define SLIBTOOL_AR_IMPL_H #include "argv/argv.h" +#include <slibtool/slibtool.h> +#include <slibtool/slibtool_arbits.h> extern const struct argv_option slbt_ar_options[]; @@ -9,4 +11,37 @@ enum ar_tags { TAG_AR_HELP, }; +struct ar_armaps_impl { + struct ar_raw_armap_bsd_32 armap_bsd_32; + struct ar_raw_armap_bsd_64 armap_bsd_64; + struct ar_raw_armap_sysv_32 armap_sysv_32; + struct ar_raw_armap_sysv_64 armap_sysv_64; + struct ar_meta_armap_common_32 armap_common_32; + struct ar_meta_armap_common_64 armap_common_64; + uint64_t armap_nsyms; +}; + +struct slbt_archive_meta_impl { + void * hdrinfov; + char * namestrs; + const char * symstrs; + const char ** symstrv; + struct ar_meta_member_info ** memberv; + struct ar_meta_member_info * members; + struct ar_armaps_impl armaps; + struct slbt_archive_meta armeta; +}; + +static inline struct slbt_archive_meta_impl * slbt_archive_meta_ictx(const struct slbt_archive_meta * meta) +{ + uintptr_t addr; + + if (meta) { + addr = (uintptr_t)meta - offsetof(struct slbt_archive_meta_impl,armeta); + return (struct slbt_archive_meta_impl *)addr; + } + + return 0; +} + #endif |