ar.h revision 33965
189857Sobrien/* archive file definition for GNU software */ 289857Sobrien 389857Sobrien/* So far this is correct for BSDish archives. Don't forget that 489857Sobrien files must begin on an even byte boundary. */ 589857Sobrien 689857Sobrien#ifndef __GNU_AR_H__ 789857Sobrien#define __GNU_AR_H__ 889857Sobrien 989857Sobrien/* Note that the usual '\n' in magic strings may translate to different 1089857Sobrien characters, as allowed by ANSI. '\012' has a fixed value, and remains 1189857Sobrien compatible with existing BSDish archives. */ 1289857Sobrien 1389857Sobrien#define ARMAG "!<arch>\012" /* For COFF and a.out archives */ 1489857Sobrien#define ARMAGB "!<bout>\012" /* For b.out archives */ 1589857Sobrien#define SARMAG 8 1689857Sobrien#define ARFMAG "`\012" 1789857Sobrien 1889857Sobrien/* The ar_date field of the armap (__.SYMDEF) member of an archive 1989857Sobrien must be greater than the modified date of the entire file, or 2089857Sobrien BSD-derived linkers complain. We originally write the ar_date with 2189857Sobrien this offset from the real file's mod-time. After finishing the 2289857Sobrien file, we rewrite ar_date if it's not still greater than the mod date. */ 2389857Sobrien 2489857Sobrien#define ARMAP_TIME_OFFSET 60 2589857Sobrien 2689857Sobrienstruct ar_hdr { 2789857Sobrien char ar_name[16]; /* name of this member */ 2889857Sobrien char ar_date[12]; /* file mtime */ 2989857Sobrien char ar_uid[6]; /* owner uid; printed as decimal */ 3089857Sobrien char ar_gid[6]; /* owner gid; printed as decimal */ 3189857Sobrien char ar_mode[8]; /* file mode, printed as octal */ 3289857Sobrien char ar_size[10]; /* file size, printed as decimal */ 3389857Sobrien char ar_fmag[2]; /* should contain ARFMAG */ 3489857Sobrien}; 3589857Sobrien 3689857Sobrien#endif /* __GNU_AR_H__ */ 3789857Sobrien