archive.h (769B)
1 /* ar archive reading: symbol table and member extraction */ 2 3 #ifndef ARUU_TCUTIL_ARCHIVE_H 4 #define ARUU_TCUTIL_ARCHIVE_H 5 6 #include <stdint.h> 7 #include <stdio.h> 8 9 #include "../table.h" 10 11 struct Vector; 12 13 struct ArContent { 14 void *obj; 15 size_t size; 16 uint32_t file_offset; 17 char name[16]; 18 }; 19 20 struct ArSymbol { 21 struct ArContent *content; 22 }; 23 24 struct Archive { 25 FILE *fp; 26 uint32_t symbol_count; 27 struct ArSymbol *symbols; 28 struct Table symbol_table; 29 struct Vector *contents; /* <struct arcontent*> */ 30 }; 31 32 struct Archive *load_archive(const char *filename); 33 void *load_archive_content( 34 struct Archive *ar, struct ArSymbol *symbol, void *(*load)(FILE *, const char *, size_t) 35 ); 36 37 #endif /* ARUU_TCUTIL_ARCHIVE_H */