1 /* pcp.h -- Describes the format of a precompiled file
2 Copyright (C) 1990 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* Structure allocated for every string in a precompiled file */
23 typedef struct stringdef STRINGDEF
;
26 U_CHAR
*contents
; /* String to include */
27 int len
; /* Its length */
28 int writeflag
; /* Whether we write this */
29 int lineno
; /* Linenumber of source file */
30 U_CHAR
*filename
; /* Name of source file */
31 STRINGDEF
*chain
; /* Global list of strings in natural order */
32 int output_mark
; /* Where in the output this goes */
35 typedef struct keydef KEYDEF
;
43 /* A precompiled file starts with a series of #define and #undef
45 #define MAC DEF --- Indicates MAC must be defined with defn DEF
46 #define MAC --- Indicates MAC must be defined with any defn
47 #undef MAC --- Indicates MAC cannot be defined
49 These preconditions must be true for a precompiled file to be used.
50 The preconditions section is null terminated. */
52 /* Then, there is a four byte number (in network byte order) which */
53 /* indicates the number of strings the file contains. */
55 /* Each string contains a STRINGDEF structure. The only component of */
56 /* the STRINGDEF structure which is used is the lineno field, which */
57 /* should hold the line number in the original header file. */
58 /* Then follows the string, followed by a null. Then comes a four */
59 /* byte number (again, in network byte order) indicating the number */
60 /* of keys for this string. Each key is a KEYDEF structure, with */
61 /* irrelevant contents, followed by the null-terminated string. */
63 /* If the number of keys is 0, then there are no keys for the string, */
64 /* in other words, the string will never be included. If the number */
65 /* of keys is -1, this is a special flag indicating there are no keys */
66 /* in the file, and the string is mandatory (that is, it must be */
67 /* included regardless in the included output). */
69 /* A file, then, looks like this: