mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-12 23:52:29 +00:00
Support merging many .a files into one .a file
This commit is contained in:
parent
df04ab846a
commit
1e9902af8b
6 changed files with 422 additions and 141 deletions
29
tool/build/lib/ar.h
Normal file
29
tool/build/lib/ar.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_BUILD_LIB_AR_H_
|
||||
#define COSMOPOLITAN_TOOL_BUILD_LIB_AR_H_
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/limits.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct Ar {
|
||||
const char *path;
|
||||
int fd;
|
||||
struct stat st;
|
||||
char *map;
|
||||
size_t offset;
|
||||
const char *filenames;
|
||||
size_t filenames_size;
|
||||
};
|
||||
|
||||
struct ArFile {
|
||||
void *data;
|
||||
size_t size;
|
||||
size_t offset;
|
||||
char name[PATH_MAX];
|
||||
};
|
||||
|
||||
void openar(struct Ar *, const char *);
|
||||
void closear(struct Ar *);
|
||||
bool readar(struct Ar *, struct ArFile *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_TOOL_BUILD_LIB_AR_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue