178828Sobrien/* archive file definition for GNU software 233965Sjdp 378828Sobrien Copyright 2001 Free Software Foundation, Inc. 478828Sobrien 578828Sobrien This program is free software; you can redistribute it and/or modify 678828Sobrien it under the terms of the GNU General Public License as published by 778828Sobrien the Free Software Foundation; either version 2 of the License, or 878828Sobrien (at your option) any later version. 978828Sobrien 1078828Sobrien This program is distributed in the hope that it will be useful, 1178828Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 1278828Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1378828Sobrien GNU General Public License for more details. 1478828Sobrien 1578828Sobrien You should have received a copy of the GNU General Public License 1678828Sobrien along with this program; if not, write to the Free Software 17218822Sdim Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 1878828Sobrien 1933965Sjdp/* So far this is correct for BSDish archives. Don't forget that 2033965Sjdp files must begin on an even byte boundary. */ 2133965Sjdp 2233965Sjdp#ifndef __GNU_AR_H__ 2333965Sjdp#define __GNU_AR_H__ 2433965Sjdp 2533965Sjdp/* Note that the usual '\n' in magic strings may translate to different 2633965Sjdp characters, as allowed by ANSI. '\012' has a fixed value, and remains 2733965Sjdp compatible with existing BSDish archives. */ 2833965Sjdp 2933965Sjdp#define ARMAG "!<arch>\012" /* For COFF and a.out archives */ 3033965Sjdp#define ARMAGB "!<bout>\012" /* For b.out archives */ 3133965Sjdp#define SARMAG 8 3233965Sjdp#define ARFMAG "`\012" 3333965Sjdp 3433965Sjdp/* The ar_date field of the armap (__.SYMDEF) member of an archive 3533965Sjdp must be greater than the modified date of the entire file, or 3633965Sjdp BSD-derived linkers complain. We originally write the ar_date with 3733965Sjdp this offset from the real file's mod-time. After finishing the 3833965Sjdp file, we rewrite ar_date if it's not still greater than the mod date. */ 3933965Sjdp 4033965Sjdp#define ARMAP_TIME_OFFSET 60 4133965Sjdp 4233965Sjdpstruct ar_hdr { 4333965Sjdp char ar_name[16]; /* name of this member */ 4433965Sjdp char ar_date[12]; /* file mtime */ 4533965Sjdp char ar_uid[6]; /* owner uid; printed as decimal */ 4633965Sjdp char ar_gid[6]; /* owner gid; printed as decimal */ 4733965Sjdp char ar_mode[8]; /* file mode, printed as octal */ 4833965Sjdp char ar_size[10]; /* file size, printed as decimal */ 4933965Sjdp char ar_fmag[2]; /* should contain ARFMAG */ 5033965Sjdp}; 5133965Sjdp 5233965Sjdp#endif /* __GNU_AR_H__ */ 53