1 - Source extraction program for chew.
2 - Copyright (C) 1990-2024 Free Software Foundation, Inc.
3 - This file is part of BFD, the Binary File Descriptor library.
5 - This program is free software; you can redistribute it and/or modify
6 - it under the terms of the GNU General Public License as published by
7 - the Free Software Foundation; either version 3 of the License, or
8 - (at your option) any later version.
10 - This program is distributed in the hope that it will be useful,
11 - but WITHOUT ANY WARRANTY; without even the implied warranty of
12 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 - GNU General Public License for more details.
15 - You should have received a copy of the GNU General Public License
16 - along with this program; if not, write to the Free Software
17 - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19 - chew.c keywords defined here put output into bfd-in2.h and libbfd.h or
20 - libcoff.h, from comments in the source. See also doc.str.
21 - Output lines generally come from comment lines starting with a dot,
22 - or from keywords like SYNOPSIS. Output switches to bfd-in2.h at the
23 - end of each comment. Use INTERNAL* to output to libbfd.h.
25 - EXTERNAL: output to bfd-in2.h, nothing to docs
26 - INTERNAL: output to libbfd.h, nothing to docs
27 - CODE_FRAGMENT: output to header and docs
28 - FUNCTION: output to bfd-in2.h and docs
29 - INTERNAL_FUNCTION: output to libbfd.h and docs
30 - DEFINITION: alias for FUNCTION, but generally doesn't have SYNOPSIS,
31 - used for structs and other random code
32 - INTERNAL_DEFINITION: as above, but output to libbfd.h and docs
33 - ENUM* outputs to bfd-in2.h, libbfd.h and docs.
39 strip_trailing_newlines
41 " ATTRIBUTE_HIDDEN" internalmode @ catstrif
47 - Ignore stuff that is for the docs. Output lines starting with dots.
58 - Output goes to bfd-in2.h
60 0 internalmode ! ignore ;
62 - Output goes to libbfd.h/libcoff.h
64 1 internalmode ! ignore ;
66 - input stack { a b } output b if internal, a if external
68 "" swap 1 internalmode ! maybecatstr
70 "" swap 0 internalmode ! maybecatstr
74 - Put note in output string, regardless of internal mode.
82 - SENUM enum-type-name
84 - ENUMX addl-enum-name
85 - ENUMDOC doc for preceding enums
86 - ENDSENUM max-enum-name
92 swap " _dummy_first_" swap catstr catstr
95 : make_string_table_header
97 "#ifdef _BFD_MAKE_TABLE_" swap catstr swap
98 "\n\nstatic const char *const " swap catstr catstr
99 "_names[] = { \"@@uninitialized@@\",\n" catstr
108 make_string_table_header
111 get_stuff_in_command catstr
115 copy_past_newline strip_trailing_newlines
117 " " swap catstr "\n};\n" catstr swap
118 " \"@@overflow: " swap catstr "@@\",\n};\n#endif\n\n" catstr
126 : make_enumerator_string
137 make_enumerator_string
140 : ENUMX ENUM catstr ;
144 copy_past_newline remchar
150 "" swap 0 internalmode ! maybecatstr
152 : ENUMEQX ENUMEQ catstr ;
156 strip_trailing_newlines
158 "\n" swap catstr "\n" catstr
159 - discard it if we're doing internal mode
160 "" swap 0 internalmode ! maybecatstr
165 : SUBSECTION ignore ;
166 : SUBSUBSECTION ignore ;
168 : DESCRIPTION ignore ;
171 : FUNCTION EXTERNAL ;
172 : INTERNAL_FUNCTION INTERNAL ;
173 : DEFINITION EXTERNAL ;
174 : INTERNAL_DEFINITION INTERNAL ;