1*fae548d3Szrj /* archive file definition for GNU software 2*fae548d3Szrj 3*fae548d3Szrj Copyright (C) 2001-2020 Free Software Foundation, Inc. 4*fae548d3Szrj 5*fae548d3Szrj This program is free software; you can redistribute it and/or modify 6*fae548d3Szrj it under the terms of the GNU General Public License as published by 7*fae548d3Szrj the Free Software Foundation; either version 3 of the License, or 8*fae548d3Szrj (at your option) any later version. 9*fae548d3Szrj 10*fae548d3Szrj This program is distributed in the hope that it will be useful, 11*fae548d3Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 12*fae548d3Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*fae548d3Szrj GNU General Public License for more details. 14*fae548d3Szrj 15*fae548d3Szrj You should have received a copy of the GNU General Public License 16*fae548d3Szrj along with this program; if not, write to the Free Software 17*fae548d3Szrj Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 18*fae548d3Szrj MA 02110-1301, USA. */ 19*fae548d3Szrj 20*fae548d3Szrj /* So far this is correct for BSDish archives. Don't forget that 21*fae548d3Szrj files must begin on an even byte boundary. */ 22*fae548d3Szrj 23*fae548d3Szrj #ifndef __GNU_AR_H__ 24*fae548d3Szrj #define __GNU_AR_H__ 25*fae548d3Szrj 26*fae548d3Szrj /* Note that the usual '\n' in magic strings may translate to different 27*fae548d3Szrj characters, as allowed by ANSI. '\012' has a fixed value, and remains 28*fae548d3Szrj compatible with existing BSDish archives. */ 29*fae548d3Szrj 30*fae548d3Szrj #define ARMAG "!<arch>\012" /* For COFF and a.out archives. */ 31*fae548d3Szrj #define ARMAGT "!<thin>\012" /* For thin archives. */ 32*fae548d3Szrj #define SARMAG 8 33*fae548d3Szrj #define ARFMAG "`\012" 34*fae548d3Szrj 35*fae548d3Szrj /* The ar_date field of the armap (__.SYMDEF) member of an archive 36*fae548d3Szrj must be greater than the modified date of the entire file, or 37*fae548d3Szrj BSD-derived linkers complain. We originally write the ar_date with 38*fae548d3Szrj this offset from the real file's mod-time. After finishing the 39*fae548d3Szrj file, we rewrite ar_date if it's not still greater than the mod date. */ 40*fae548d3Szrj 41*fae548d3Szrj #define ARMAP_TIME_OFFSET 60 42*fae548d3Szrj 43*fae548d3Szrj struct ar_hdr 44*fae548d3Szrj { 45*fae548d3Szrj char ar_name[16]; /* Name of this member. */ 46*fae548d3Szrj char ar_date[12]; /* File mtime. */ 47*fae548d3Szrj char ar_uid[6]; /* Owner uid; printed as decimal. */ 48*fae548d3Szrj char ar_gid[6]; /* Owner gid; printed as decimal. */ 49*fae548d3Szrj char ar_mode[8]; /* File mode, printed as octal. */ 50*fae548d3Szrj char ar_size[10]; /* File size, printed as decimal. */ 51*fae548d3Szrj char ar_fmag[2]; /* Should contain ARFMAG. */ 52*fae548d3Szrj }; 53*fae548d3Szrj 54*fae548d3Szrj #endif /* __GNU_AR_H__ */ 55