]>
Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | /* archive file definition for GNU software */ |
2 | ||
3 | /* So far this is correct for BSDish archives. Don't forget that | |
4 | files must begin on an even byte boundary. */ | |
5 | ||
6 | #ifndef __GNU_AR_H__ | |
7 | #define __GNU_AR_H__ | |
8 | ||
9 | /* Note that the usual '\n' in magic strings may translate to different | |
10 | characters, as allowed by ANSI. '\012' has a fixed value, and remains | |
11 | compatible with existing BSDish archives. */ | |
12 | ||
13 | #define ARMAG "!<arch>\012" /* For COFF and a.out archives */ | |
14 | #define ARMAGB "!<bout>\012" /* For b.out archives */ | |
15 | #define SARMAG 8 | |
16 | #define ARFMAG "`\012" | |
17 | ||
18 | /* The ar_date field of the armap (__.SYMDEF) member of an archive | |
19 | must be greater than the modified date of the entire file, or | |
20 | BSD-derived linkers complain. We originally write the ar_date with | |
21 | this offset from the real file's mod-time. After finishing the | |
22 | file, we rewrite ar_date if it's not still greater than the mod date. */ | |
23 | ||
24 | #define ARMAP_TIME_OFFSET 60 | |
25 | ||
26 | struct ar_hdr { | |
27 | char ar_name[16]; /* name of this member */ | |
28 | char ar_date[12]; /* file mtime */ | |
29 | char ar_uid[6]; /* owner uid; printed as decimal */ | |
30 | char ar_gid[6]; /* owner gid; printed as decimal */ | |
31 | char ar_mode[8]; /* file mode, printed as octal */ | |
32 | char ar_size[10]; /* file size, printed as decimal */ | |
33 | char ar_fmag[2]; /* should contain ARFMAG */ | |
34 | }; | |
35 | ||
36 | #endif /* __GNU_AR_H__ */ |