]>
Commit | Line | Data |
---|---|---|
095c7223 JG |
1 | /* ranlib.h -- archive library index member definition for GNU. |
2 | Copyright 1990-1991 Free Software Foundation, Inc. | |
61a153e5 | 3 | |
095c7223 JG |
4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | |
6 | the Free Software Foundation; either version 2 of the License, or | |
7 | (at your option) any later version. | |
61a153e5 | 8 | |
095c7223 JG |
9 | This program is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
61a153e5 | 13 | |
095c7223 JG |
14 | You should have received a copy of the GNU General Public License |
15 | along with this program; if not, write to the Free Software | |
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
61a153e5 RP |
17 | |
18 | /* The Symdef member of an archive contains two things: | |
19 | a table that maps symbol-string offsets to file offsets, | |
20 | and a symbol-string table. All the symbol names are | |
21 | run together (each with trailing null) in the symbol-string | |
22 | table. There is a single longword bytecount on the front | |
23 | of each of these tables. Thus if we have two symbols, | |
24 | "foo" and "_bar", that are in archive members at offsets | |
25 | 200 and 900, it would look like this: | |
26 | 16 ; byte count of index table | |
27 | 0 ; offset of "foo" in string table | |
28 | 200 ; offset of foo-module in file | |
29 | 4 ; offset of "bar" in string table | |
30 | 900 ; offset of bar-module in file | |
31 | 9 ; byte count of string table | |
32 | "foo\0_bar\0" ; string table */ | |
33 | ||
bad3df67 JG |
34 | #define RANLIBMAG "__.SYMDEF" /* Archive file name containing index */ |
35 | #define RANLIBSKEW 3 /* Creation time offset */ | |
36 | ||
61a153e5 RP |
37 | /* Format of __.SYMDEF: |
38 | First, a longword containing the size of the 'symdef' data that follows. | |
39 | Second, zero or more 'symdef' structures. | |
40 | Third, a longword containing the length of symbol name strings. | |
41 | Fourth, zero or more symbol name strings (each followed by a null). */ | |
42 | ||
43 | struct symdef | |
44 | { | |
45 | union | |
46 | { | |
47 | unsigned long string_offset; /* In the file */ | |
48 | char *name; /* In memory, sometimes */ | |
49 | } s; | |
bad3df67 JG |
50 | /* this points to the front of the file header (AKA member header -- |
51 | a struct ar_hdr), not to the front of the file or into the file). | |
52 | in other words it only tells you which file to read */ | |
61a153e5 RP |
53 | unsigned long file_offset; |
54 | }; | |
55 | ||
56 | /* Compatability with BSD code */ | |
57 | ||
58 | #define ranlib symdef | |
59 | #define ran_un s | |
bad3df67 | 60 | #define ran_strx string_offset |
61a153e5 RP |
61 | #define ran_name name |
62 | #define ran_off file_offset |