Debian Codegraph @

texk/makeindexk/scanst.h

raw
1 /*
2 *
3 * This file is part of
4 * MakeIndex - A formatter and format independent index processor
5 *
6 * Copyright (C) 1998-2011 by the TeX Live project.
7 * Copyright (C) 1989 by Chen & Harrison International Systems, Inc.
8 * Copyright (C) 1988 by Olivetti Research Center
9 * Copyright (C) 1987 by Regents of the University of California
10 *
11 * Author:
12 * Pehong Chen
13 * Chen & Harrison International Systems, Inc.
14 * Palo Alto, California
15 * USA
16 * ([email protected] or [email protected])
17 *
18 * Contributors:
19 * Please refer to the CONTRIB file that comes with this release
20 * for a list of people who have contributed to this and/or previous
21 * release(s) of MakeIndex.
22 *
23 * All rights reserved by the copyright holders. See the copyright
24 * notice distributed with this software for a complete description of
25 * the conditions under which it is made available.
26 *
27 */
28
29 #define COMMENT '%'
30 #define STR_DELIM '"'
31 #define CHR_DELIM '\''
32
33 #define KEYWORD "keyword"
34 #define AOPEN "arg_open"
35 #define ACLOSE "arg_close"
36 #define ROPEN "range_open"
37 #define RCLOSE "range_close"
38 #define LEVEL "level"
39 #define QUOTE "quote"
40 #define ACTUAL "actual"
41 #define ENCAP "encap"
42 #define ESCAPE "escape"
43
44 #define IDX_KEYWORD "\\indexentry"
45 #define IDX_AOPEN '{'
46 #define IDX_ACLOSE '}'
47 #define IDX_ROPEN '('
48 #define IDX_RCLOSE ')'
49 #define IDX_LEVEL '!'
50 #define IDX_QUOTE '"'
51 #define IDX_ACTUAL '@'
52 #define IDX_ENCAP '|'
53 #define IDX_ESCAPE '\\'
54
55 #define COMPOSITOR "page_compositor"
56 #define COMPOSITOR_DEF "-"
57 #define PRECEDENCE "page_precedence"
58 #define PRECEDENCE_DEF "rnaRA"
59 #define ROMAN_LOWER 'r'
60 #define ROMAN_UPPER 'R'
61 #define ARABIC 'n'
62 #define ALPHA_LOWER 'a'
63 #define ALPHA_UPPER 'A'
64 #define ROMAN_LOWER_OFFSET 10000
65 #define ROMAN_UPPER_OFFSET 10000
66 #define ARABIC_OFFSET 10000
67 #define ALPHA_LOWER_OFFSET 26
68 #define ALPHA_UPPER_OFFSET 26
69
70 #define PREAMBLE "preamble"
71 #define PREAMBLE_DEF "\\begin{theindex}\n"
72 #define PREAMBLE_LEN 1
73 #define POSTAMBLE "postamble"
74 #define POSTAMBLE_DEF "\n\n\\end{theindex}\n"
75 #define POSTAMBLE_LEN 3
76
77 #define SETPAGEOPEN "setpage_prefix"
78 #define SETPAGECLOSE "setpage_suffix"
79
80 #define SETPAGEOPEN_DEF "\n \\setcounter{page}{"
81
82 #define SETPAGECLOSE_DEF "}\n"
83 #define SETPAGE_LEN 2
84
85 #define GROUP_SKIP "group_skip"
86 #define GROUPSKIP_DEF "\n\n \\indexspace\n"
87 #define GROUPSKIP_LEN 3
88
89 #define HEADINGS_FLAG "headings_flag"
90 #define HEADINGSFLAG_DEF 0
91 #define HEADING_PRE "heading_prefix"
92 #define HEADINGPRE_DEF ""
93 #define HEADINGPRE_LEN 0
94 #define HEADING_SUF "heading_suffix"
95 #define HEADINGSUF_DEF ""
96 #define HEADINGSUF_LEN 0
97 #define SYMHEAD_POS "symhead_positive"
98 #define SYMHEADPOS_DEF "Symbols"
99 #define SYMHEAD_NEG "symhead_negative"
100 #define SYMHEADNEG_DEF "symbols"
101 #define NUMHEAD_POS "numhead_positive"
102 #define NUMHEADPOS_DEF "Numbers"
103 #define NUMHEAD_NEG "numhead_negative"
104 #define NUMHEADNEG_DEF "numbers"
105
106 #define ITEM_0 "item_0"
107 #define ITEM_1 "item_1"
108 #define ITEM_2 "item_2"
109 #define ITEM_01 "item_01"
110 #define ITEM_x1 "item_x1"
111 #define ITEM_12 "item_12"
112 #define ITEM_x2 "item_x2"
113
114 #define ITEM0_DEF "\n \\item "
115 #define ITEM1_DEF "\n \\subitem "
116 #define ITEM2_DEF "\n \\subsubitem "
117
118 #define ITEM_LEN 1
119
120 #define DELIM_0 "delim_0"
121 #define DELIM_1 "delim_1"
122 #define DELIM_2 "delim_2"
123 #define DELIM_N "delim_n"
124 #define DELIM_R "delim_r"
125 #define DELIM_T "delim_t"
126 #define DELIM_DEF ", "
127 #define DELIMR_DEF "--"
128 #define DELIMT_DEF ""
129
130 #define SUFFIX_2P "suffix_2p"
131 #define SUFFIX_3P "suffix_3p"
132 #define SUFFIX_MP "suffix_mp"
133
134 #define ENCAP_0 "encap_prefix"
135 #define ENCAP_1 "encap_infix"
136 #define ENCAP_2 "encap_suffix"
137 #define ENCAP0_DEF "\\"
138 #define ENCAP1_DEF "{"
139 #define ENCAP2_DEF "}"
140
141 #define LINEMAX "line_max"
142 #define INDENT_SPACE "indent_space"
143 #define INDENT_LENGTH "indent_length"
144
145 #define INDENTSPC_DEF "\t\t"
146
147 #define INDENTLEN_DEF 16
148
149 #define STY_ERROR(F) { \
150 if (idx_dot) { \
151 fprintf(ilg_fp, "\n"); \
152 idx_dot = FALSE; \
153 } \
154 fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n -- ", \
155 sty_fn, sty_lc); \
156 fprintf(ilg_fp, F); \
157 sty_ec++; \
158 put_dot = FALSE; \
159 }
160
161 #define STY_ERROR1(F, D) { \
162 if (idx_dot) { \
163 fprintf(ilg_fp, "\n"); \
164 idx_dot = FALSE; \
165 } \
166 fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n -- ", \
167 sty_fn, sty_lc); \
168 fprintf(ilg_fp, F, D); \
169 sty_ec++; \
170 put_dot = FALSE; \
171 }
172
173 #define STY_ERROR2(F, D1, D2) { \
174 if (idx_dot) { \
175 fprintf(ilg_fp, "\n"); \
176 idx_dot = FALSE; \
177 } \
178 fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n -- ", \
179 sty_fn, sty_lc); \
180 fprintf(ilg_fp, F, D1, D2); \
181 sty_ec++; \
182 put_dot = FALSE; \
183 }
184
185 #define STY_DOT { \
186 idx_dot = TRUE; \
187 if (verbose) \
188 fprintf(stderr, DOT); \
189 fprintf(ilg_fp, DOT); \
190 }
191
192 #define STY_SKIPLINE { \
193 int a; \
194 while ( ((a = GET_CHAR(sty_fp)) != LFD) && (a != EOF) ); \
195 sty_lc++; \
196 }
197
198 #define SCAN_NO(N) { \
199 fscanf(sty_fp, "%d", N); \
200 }
201
202 #define MULTIPLE(C) { \
203 STY_SKIPLINE; \
204 STY_ERROR2( \
205 "Multiple instances of type `%c' in page precedence specification `%s'.\n", \
206 C, page_prec); \
207 return (FALSE); \
208 }