w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

FindErrs.h
Go to the documentation of this file.
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: <jensthi@ifi.uio.no>
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 
133 #undef MSG
134 #define MSG(num, type, inuse, ctxt, text) num,
135 
136 enum ErrNum
137 {
139 };
140 #undef MSG
141 
143 {
144  ctNone = 0x00,
145  ctInMath = 0x01,
146  ctOutMath = 0x02,
147  ctInHead = 0x04,
148  ctOutHead = 0x08
149 };
150 
151 struct ErrMsg
152 {
153  enum ErrNum Number;
154  enum
155  {
158  etErr
159  } Type;
160 
161  enum
162  {
165  iuOK
166  } InUse;
167 
168  /* Requirements posed upon environment */
169  enum Context Context;
170 
171  const char *Message;
172 };
173 
175 {
179 };
180 
181 
183 {
184  dtUnknown = 0x0,
185  dtCDots = 0x1,
186  dtLDots = 0x2,
187  dtDots = 0x4
188 };
189 
190 extern struct ErrMsg LaTeXMsgs[emMaxFault + 1];
191 
192 extern char *OutputFormat;
193 
194 int CheckSilentRegex(void);
195 int FindErr(const char *, const unsigned long);
196 void PrintError(const char *, const char *, const long, const long,
197  const long, const enum ErrNum, ...);
198 void PrintStatus(unsigned long Lines);
199 
200 #endif /* FINDERRS */
#define ERRMSGS
Definition: FindErrs.h:37
DotLevel
Definition: FindErrs.h:183
@ dtCDots
Definition: FindErrs.h:185
@ dtLDots
Definition: FindErrs.h:186
@ dtDots
Definition: FindErrs.h:187
@ dtUnknown
Definition: FindErrs.h:184
void PrintStatus(unsigned long Lines)
Definition: FindErrs.c:1777
struct ErrMsg LaTeXMsgs[emMaxFault+1]
Definition: FindErrs.c:63
void PrintError(const char *, const char *, const long, const long, const long, const enum ErrNum,...)
Definition: FindErrs.c:1850
@ ctOutMath
Definition: FindErrs.h:146
@ ctInMath
Definition: FindErrs.h:145
@ ctOutHead
Definition: FindErrs.h:148
@ ctInHead
Definition: FindErrs.h:147
@ ctNone
Definition: FindErrs.h:144
ItState
Definition: FindErrs.h:175
@ itOff
Definition: FindErrs.h:176
@ itCorrected
Definition: FindErrs.h:178
@ itOn
Definition: FindErrs.h:177
ErrNum
Definition: FindErrs.h:137
@ emMaxFault
Definition: FindErrs.h:138
int FindErr(const char *, const unsigned long)
Definition: FindErrs.c:1302
int CheckSilentRegex(void)
Definition: FindErrs.c:1213
char * OutputFormat
Definition: ChkTeX.c:200
enum Context Context
Definition: FindErrs.h:169
enum ErrMsg::@91 Type
@ iuNotSys
Definition: FindErrs.h:163
@ iuNotUser
Definition: FindErrs.h:164
@ iuOK
Definition: FindErrs.h:165
@ etMsg
Definition: FindErrs.h:156
@ etErr
Definition: FindErrs.h:158
@ etWarn
Definition: FindErrs.h:157
const char * Message
Definition: FindErrs.h:171
enum ErrMsg::@92 InUse
enum ErrNum Number
Definition: FindErrs.h:153