186d7f5d3SJohn Marino /* archive file definition for GNU software 286d7f5d3SJohn Marino 386d7f5d3SJohn Marino Copyright 2001, 2008, 2010 Free Software Foundation, Inc. 486d7f5d3SJohn Marino 586d7f5d3SJohn Marino This program is free software; you can redistribute it and/or modify 686d7f5d3SJohn Marino it under the terms of the GNU General Public License as published by 786d7f5d3SJohn Marino the Free Software Foundation; either version 3 of the License, or 886d7f5d3SJohn Marino (at your option) any later version. 986d7f5d3SJohn Marino 1086d7f5d3SJohn Marino This program is distributed in the hope that it will be useful, 1186d7f5d3SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of 1286d7f5d3SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1386d7f5d3SJohn Marino GNU General Public License for more details. 1486d7f5d3SJohn Marino 1586d7f5d3SJohn Marino You should have received a copy of the GNU General Public License 1686d7f5d3SJohn Marino along with this program; if not, write to the Free Software 1786d7f5d3SJohn Marino Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 1886d7f5d3SJohn Marino MA 02110-1301, USA. */ 1986d7f5d3SJohn Marino 2086d7f5d3SJohn Marino /* So far this is correct for BSDish archives. Don't forget that 2186d7f5d3SJohn Marino files must begin on an even byte boundary. */ 2286d7f5d3SJohn Marino 2386d7f5d3SJohn Marino #ifndef __GNU_AR_H__ 2486d7f5d3SJohn Marino #define __GNU_AR_H__ 2586d7f5d3SJohn Marino 2686d7f5d3SJohn Marino /* Note that the usual '\n' in magic strings may translate to different 2786d7f5d3SJohn Marino characters, as allowed by ANSI. '\012' has a fixed value, and remains 2886d7f5d3SJohn Marino compatible with existing BSDish archives. */ 2986d7f5d3SJohn Marino 3086d7f5d3SJohn Marino #define ARMAG "!<arch>\012" /* For COFF and a.out archives. */ 3186d7f5d3SJohn Marino #define ARMAGB "!<bout>\012" /* For b.out archives. */ 3286d7f5d3SJohn Marino #define ARMAGT "!<thin>\012" /* For thin archives. */ 3386d7f5d3SJohn Marino #define SARMAG 8 3486d7f5d3SJohn Marino #define ARFMAG "`\012" 3586d7f5d3SJohn Marino 3686d7f5d3SJohn Marino /* The ar_date field of the armap (__.SYMDEF) member of an archive 3786d7f5d3SJohn Marino must be greater than the modified date of the entire file, or 3886d7f5d3SJohn Marino BSD-derived linkers complain. We originally write the ar_date with 3986d7f5d3SJohn Marino this offset from the real file's mod-time. After finishing the 4086d7f5d3SJohn Marino file, we rewrite ar_date if it's not still greater than the mod date. */ 4186d7f5d3SJohn Marino 4286d7f5d3SJohn Marino #define ARMAP_TIME_OFFSET 60 4386d7f5d3SJohn Marino 4486d7f5d3SJohn Marino struct ar_hdr 4586d7f5d3SJohn Marino { 4686d7f5d3SJohn Marino char ar_name[16]; /* Name of this member. */ 4786d7f5d3SJohn Marino char ar_date[12]; /* File mtime. */ 4886d7f5d3SJohn Marino char ar_uid[6]; /* Owner uid; printed as decimal. */ 4986d7f5d3SJohn Marino char ar_gid[6]; /* Owner gid; printed as decimal. */ 5086d7f5d3SJohn Marino char ar_mode[8]; /* File mode, printed as octal. */ 5186d7f5d3SJohn Marino char ar_size[10]; /* File size, printed as decimal. */ 5286d7f5d3SJohn Marino char ar_fmag[2]; /* Should contain ARFMAG. */ 5386d7f5d3SJohn Marino }; 5486d7f5d3SJohn Marino 5586d7f5d3SJohn Marino #endif /* __GNU_AR_H__ */ 56