|
Packit |
bbfece |
/* ranlib.h -- archive library index member definition for GNU.
|
|
Packit |
bbfece |
Copyright (C) 1990-2018 Free Software Foundation, Inc.
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
This program is free software; you can redistribute it and/or modify
|
|
Packit |
bbfece |
it under the terms of the GNU General Public License as published by
|
|
Packit |
bbfece |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit |
bbfece |
(at your option) any later version.
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
This program is distributed in the hope that it will be useful,
|
|
Packit |
bbfece |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
bbfece |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
bbfece |
GNU General Public License for more details.
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
You should have received a copy of the GNU General Public License
|
|
Packit |
bbfece |
along with this program; if not, write to the Free Software
|
|
Packit |
bbfece |
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
Packit |
bbfece |
MA 02110-1301, USA. */
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
/* The Symdef member of an archive contains two things:
|
|
Packit |
bbfece |
a table that maps symbol-string offsets to file offsets,
|
|
Packit |
bbfece |
and a symbol-string table. All the symbol names are
|
|
Packit |
bbfece |
run together (each with trailing null) in the symbol-string
|
|
Packit |
bbfece |
table. There is a single longword bytecount on the front
|
|
Packit |
bbfece |
of each of these tables. Thus if we have two symbols,
|
|
Packit |
bbfece |
"foo" and "_bar", that are in archive members at offsets
|
|
Packit |
bbfece |
200 and 900, it would look like this:
|
|
Packit |
bbfece |
16 ; byte count of index table
|
|
Packit |
bbfece |
0 ; offset of "foo" in string table
|
|
Packit |
bbfece |
200 ; offset of foo-module in file
|
|
Packit |
bbfece |
4 ; offset of "bar" in string table
|
|
Packit |
bbfece |
900 ; offset of bar-module in file
|
|
Packit |
bbfece |
9 ; byte count of string table
|
|
Packit |
bbfece |
"foo\0_bar\0" ; string table */
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
#define RANLIBMAG "__.SYMDEF" /* Archive file name containing index */
|
|
Packit |
bbfece |
#define RANLIBSKEW 3 /* Creation time offset */
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
/* Format of __.SYMDEF:
|
|
Packit |
bbfece |
First, a longword containing the size of the 'symdef' data that follows.
|
|
Packit |
bbfece |
Second, zero or more 'symdef' structures.
|
|
Packit |
bbfece |
Third, a longword containing the length of symbol name strings.
|
|
Packit |
bbfece |
Fourth, zero or more symbol name strings (each followed by a null). */
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
struct symdef
|
|
Packit |
bbfece |
{
|
|
Packit |
bbfece |
union
|
|
Packit |
bbfece |
{
|
|
Packit |
bbfece |
unsigned long string_offset; /* In the file */
|
|
Packit |
bbfece |
char *name; /* In memory, sometimes */
|
|
Packit |
bbfece |
} s;
|
|
Packit |
bbfece |
/* this points to the front of the file header (AKA member header --
|
|
Packit |
bbfece |
a struct ar_hdr), not to the front of the file or into the file).
|
|
Packit |
bbfece |
in other words it only tells you which file to read */
|
|
Packit |
bbfece |
unsigned long file_offset;
|
|
Packit |
bbfece |
};
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
/* Compatability with BSD code */
|
|
Packit |
bbfece |
|
|
Packit |
bbfece |
#define ranlib symdef
|
|
Packit |
bbfece |
#define ran_un s
|
|
Packit |
bbfece |
#define ran_strx string_offset
|
|
Packit |
bbfece |
#define ran_name name
|
|
Packit |
bbfece |
#define ran_off file_offset
|