Debian Codegraph @

texk/chktex/chktex-src/FindErrs.h

raw
1 /*
2 * ChkTeX, header file for main program.
3 * Copyright (C) 1995-96 Jens T. Berger Thielemann
4 *
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 2 of the License, or
8 * (at your option) any later version.
9 *
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.
14 *
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.
18 *
19 * Contact the author at:
20 * Jens Berger
21 * Spektrumvn. 4
22 * N-0666 Oslo
23 * Norway
24 * E-mail: <[email protected]>
25 *
26 *
27 */
28
29 #ifndef FINDERRS_H
30 #define FINDERRS_H
31 #include "ChkTeX.h"
32
33
34 #undef ERRMSGS
35 #undef MSG
36
37 #define ERRMSGS \
38 MSG(emMinFault, etErr, iuOK, ctNone,\
39 INTERNFAULT)\
40 MSG(emSpaceTerm, etWarn, iuOK, ctOutMath,\
41 "Command terminated with space.")\
42 MSG(emNBSpace, etWarn, iuOK, ctNone,\
43 "Non-breaking space (`~') should have been used.")\
44 MSG(emEnclosePar, etWarn, iuOK, ctInMath,\
45 "You should enclose the previous parenthesis with `{}\'.")\
46 MSG(emItInNoIt, etWarn, iuOK, ctNone,\
47 "Italic correction (`\\/') found in non-italic buffer.")\
48 MSG(emItDup, etWarn, iuOK, ctNone,\
49 "Italic correction (`\\/') found more than once.")\
50 MSG(emNoItFound, etWarn, iuOK, ctNone,\
51 "No italic correction (`\\/') found.")\
52 MSG(emAccent, etWarn, iuOK, ctNone,\
53 "Accent command `%s' needs use of `\\%c%s'.")\
54 MSG(emWrongDash, etWarn, iuOK, ctOutMath,\
55 "Wrong length of dash may have been used.")\
56 MSG(emExpectC, etWarn, iuOK, ctNone,\
57 "`%s' expected, found `%s'.")\
58 MSG(emSoloC, etWarn, iuOK, ctNone,\
59 "Solo `%s' found.")\
60 MSG(emEllipsis, etWarn, iuOK, ctNone,\
61 "You should use %s to achieve an ellipsis.")\
62 MSG(emInterWord, etWarn, iuOK, ctOutMath,\
63 "Interword spacing (`\\ ') should perhaps be used.")\
64 MSG(emInterSent, etWarn, iuOK, ctOutMath,\
65 "Intersentence spacing (`\\@') should perhaps be used.")\
66 MSG(emNoArgFound, etErr, iuOK, ctNone,\
67 "Could not find argument for command.")\
68 MSG(emNoMatchC, etWarn, iuOK, ctOutMath,\
69 "No match found for `%s'.")\
70 MSG(emMathStillOn, etWarn, iuOK, ctNone,\
71 "Mathmode still on at end of LaTeX file.")\
72 MSG(emNoMatchCC, etWarn, iuOK, ctNone,\
73 "Number of `%c' doesn't match the number of `%c'!")\
74 MSG(emUseQuoteLiga, etWarn, iuOK, ctNone,\
75 "Use either `` or '' as an alternative to `\"'.")\
76 MSG(emUseOtherQuote, etWarn, iuNotSys, ctNone,\
77 "Use \"'\" (ASCII 39) instead of \"\xB4\" (ASCII 180).")\
78 MSG(emUserWarn, etWarn, iuOK, ctNone,\
79 "User-specified pattern found: %s.")\
80 MSG(emNotIntended, etWarn, iuNotSys, ctNone,\
81 "This command might not be intended.")\
82 MSG(emComment, etMsg, iuNotSys, ctNone,\
83 "Comment displayed.")\
84 MSG(emThreeQuotes, etWarn, iuOK, ctNone,\
85 "Either %c\\,%c%c or %c%c\\,%c will look better.")\
86 MSG(emFalsePage, etWarn, iuOK, ctOutMath,\
87 "Delete this space to maintain correct pagereferences.")\
88 MSG(emEmbrace, etWarn, iuOK, ctInMath,\
89 "You might wish to put this between a pair of `{}'")\
90 MSG(emSpacePunct, etWarn, iuOK, ctOutMath,\
91 "You ought to remove spaces in front of punctuation.")\
92 MSG(emNoCmdExec, etWarn, iuOK, ctNone,\
93 "Could not execute LaTeX command.")\
94 MSG(emItPunct, etWarn, iuOK, ctNone,\
95 "Don't use \\/ in front of small punctuation.")\
96 MSG(emUseTimes, etWarn, iuOK, ctNone,\
97 "$\\times$ may look prettier here.")\
98 MSG(emMultiSpace, etWarn, iuNotSys, ctOutMath,\
99 "Multiple spaces detected in input.")\
100 MSG(emIgnoreText, etWarn, iuOK, ctNone,\
101 "This text may be ignored.")\
102 MSG(emBeginQ, etWarn, iuOK, ctOutMath,\
103 "Use ` to begin quotation, not '.")\
104 MSG(emEndQ, etWarn, iuOK, ctOutMath,\
105 "Use ' to end quotation, not `.")\
106 MSG(emQuoteMix, etWarn, iuOK, ctNone,\
107 "Don't mix quotes.")\
108 MSG(emWordCommand, etWarn, iuOK, ctInMath,\
109 "You should perhaps use `\\%s' instead.")\
110 MSG(emSpaceParen, etWarn, iuOK, ctOutMath,\
111 "You should put a space %s parenthesis.")\
112 MSG(emNoSpaceParen, etWarn, iuOK, ctOutMath,\
113 "You should avoid spaces %s parenthesis.")\
114 MSG(emQuoteStyle, etWarn, iuOK, ctOutMath,\
115 "You should not use punctuation %s quotes.")\
116 MSG(emDblSpace, etWarn, iuOK, ctOutMath,\
117 "Double space found.")\
118 MSG(emPunctMath, etWarn, iuOK, ctNone,\
119 "You should put punctuation %s math mode.")\
120 MSG(emTeXPrim, etWarn, iuNotSys, ctNone,\
121 "You ought to not use primitive TeX in LaTeX code.")\
122 MSG(emRemPSSpace, etWarn, iuOK, ctOutMath,\
123 "You should remove spaces in front of `%s'") \
124 MSG(emNoCharMean, etWarn, iuOK, ctNone,\
125 "`%s' is normally not followed by `%c'.")\
126 MSG(emUserWarnRegex, etWarn, iuOK, ctNone,\
127 "User Regex: %.*s.") \
128 MSG(emDisplayMath, etWarn, iuOK, ctOutMath,\
129 "Use \\[ ... \\] instead of $$ ... $$.")\
130 MSG(emInlineMath, etWarn, iuNotSys, ctOutMath,\
131 "Use \\( ... \\) instead of $ ... $.")\
132 MSG(emExpectConTeXt, etWarn, iuOK, ctNone,\
133 "`%s' expected, found `%s' (ConTeXt).")\
134 MSG(emNoMatchConTeXt, etWarn, iuOK, ctNone,\
135 "No match found for `%s' (ConTeXt).") \
136 MSG(emMathModeConfusion, etWarn, iuOK, ctNone,\
137 "Expected math mode to be %s here.")
138
139 #undef MSG
140 #define MSG(num, type, inuse, ctxt, text) num,
141
142 enum ErrNum
143 {
144 ERRMSGS emMaxFault
145 };
146 #undef MSG
147
148 enum Context
149 {
150 ctNone = 0x00,
151 ctInMath = 0x01,
152 ctOutMath = 0x02,
153 ctInHead = 0x04,
154 ctOutHead = 0x08
155 };
156
157 struct ErrMsg
158 {
159 enum ErrNum Number;
160 enum
161 {
162 etMsg,
163 etWarn,
164 etErr
165 } Type;
166
167 enum
168 {
169 iuNotSys,
170 iuNotUser,
171 iuOK
172 } InUse;
173
174 /* Requirements posed upon environment */
175 enum Context Context;
176
177 const char *Message;
178 };
179
180 enum ItState
181 {
182 itOff,
183 itOn,
184 itCorrected
185 };
186
187
188 enum DotLevel
189 {
190 dtUnknown = 0x0,
191 dtCDots = 0x1,
192 dtLDots = 0x2,
193 dtDots = 0x4
194 };
195
196 extern struct ErrMsg LaTeXMsgs[emMaxFault + 1];
197
198 extern char *OutputFormat;
199
200 int CheckSilentRegex(void);
201 int FindErr(const char *, const unsigned long);
202 void PrintError(const enum ErrNum, const char *, const char *, const long,
203 const long, const long, ...);
204 void PrintStatus(unsigned long Lines);
205
206 #endif /* FINDERRS */