133965Sjdp/* ranlib.h -- archive library index member definition for GNU.
278828Sobrien   Copyright 1990, 1991 Free Software Foundation, Inc.
333965Sjdp
433965SjdpThis program is free software; you can redistribute it and/or modify
533965Sjdpit under the terms of the GNU General Public License as published by
633965Sjdpthe Free Software Foundation; either version 2 of the License, or
733965Sjdp(at your option) any later version.
833965Sjdp
933965SjdpThis program is distributed in the hope that it will be useful,
1033965Sjdpbut WITHOUT ANY WARRANTY; without even the implied warranty of
1133965SjdpMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1233965SjdpGNU General Public License for more details.
1333965Sjdp
1433965SjdpYou should have received a copy of the GNU General Public License
1533965Sjdpalong with this program; if not, write to the Free Software
16218822SdimFoundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
1733965Sjdp
1833965Sjdp/* The Symdef member of an archive contains two things:
1933965Sjdp   a table that maps symbol-string offsets to file offsets,
2033965Sjdp   and a symbol-string table.  All the symbol names are
2133965Sjdp   run together (each with trailing null) in the symbol-string
2233965Sjdp   table.  There is a single longword bytecount on the front
2333965Sjdp   of each of these tables.  Thus if we have two symbols,
2433965Sjdp   "foo" and "_bar", that are in archive members at offsets
2533965Sjdp   200 and 900, it would look like this:
2633965Sjdp        16		; byte count of index table
2733965Sjdp  	0		; offset of "foo" in string table
2833965Sjdp  	200		; offset of foo-module in file
2933965Sjdp  	4		; offset of "bar" in string table
3033965Sjdp  	900		; offset of bar-module in file
3133965Sjdp  	9		; byte count of string table
3233965Sjdp  	"foo\0_bar\0"	; string table  */
3333965Sjdp
3433965Sjdp#define	RANLIBMAG	"__.SYMDEF"	/* Archive file name containing index */
3533965Sjdp#define	RANLIBSKEW	3		/* Creation time offset */
3633965Sjdp
3733965Sjdp/* Format of __.SYMDEF:
3833965Sjdp   First, a longword containing the size of the 'symdef' data that follows.
3933965Sjdp   Second, zero or more 'symdef' structures.
4033965Sjdp   Third, a longword containing the length of symbol name strings.
4133965Sjdp   Fourth, zero or more symbol name strings (each followed by a null).  */
4233965Sjdp
4333965Sjdpstruct symdef
4433965Sjdp  {
4533965Sjdp    union
4633965Sjdp      {
4733965Sjdp	unsigned long string_offset;	/* In the file */
4833965Sjdp	char *name;			/* In memory, sometimes */
4933965Sjdp      } s;
5033965Sjdp    /* this points to the front of the file header (AKA member header --
5133965Sjdp       a struct ar_hdr), not to the front of the file or into the file).
5233965Sjdp       in other words it only tells you which file to read */
5333965Sjdp    unsigned long file_offset;
5433965Sjdp  };
5533965Sjdp
5633965Sjdp/* Compatability with BSD code */
5733965Sjdp
5833965Sjdp#define	ranlib	symdef
5933965Sjdp#define	ran_un	s
6033965Sjdp#define	ran_strx string_offset
6133965Sjdp#define	ran_name name
6233965Sjdp#define	ran_off	file_offset
63