HTML Tidy  5.4.0
The HTACG Tidy HTML Project
message.h
Go to the documentation of this file.
1 #ifndef __MESSAGE_H__
2 #define __MESSAGE_H__
3 
4 /* message.h -- general message writing routines
5 
6  (c) 1998-2007 (W3C) MIT, ERCIM, Keio University
7  See tidy.h for the copyright notice.
8 
9 */
10 
11 #include "forward.h"
12 #include "tidy.h" /* For TidyReportLevel */
13 #include "language.h"
14 
15 /* General message writing routines.
16 ** Each message is a single warning, error, etc.
17 **
18 ** These routines keep track of counts and,
19 ** if the caller has set a filter, it will be
20 ** called. The new preferred way of handling
21 ** Tidy diagnostics output is either a) define
22 ** a new output sink or b) install a message
23 ** filter routine.
24 **
25 ** Keep track of ShowWarnings, ShowErrors, etc.
26 */
27 
28 ctmbstr TY_(ReleaseDate)(void);
29 
30 void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option );
31 void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option );
32 void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc );
33 
34 void TY_(ReportMarkupVersion)( TidyDocImpl* doc );
35 void TY_(ReportNumWarnings)( TidyDocImpl* doc );
36 
37 void TY_(GeneralInfo)( TidyDocImpl* doc );
38 /* void TY_(UnknownOption)( TidyDocImpl* doc, char c ); */
39 /* void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); */
40 void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level );
41 
42 void TY_(ErrorSummary)( TidyDocImpl* doc );
43 
44 void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding);
45 void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded);
46 void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c );
47 void TY_(ReportAttrError)( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
48 void TY_(ReportMissingAttr)( TidyDocImpl* doc, Node* node, ctmbstr name );
49 void TY_(ReportSurrogateError)(TidyDocImpl* doc, uint code, uint c1, uint c2);
50 
51 #if SUPPORT_ACCESSIBILITY_CHECKS
52 
53 void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code );
54 void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code );
55 
56 #endif
57 
58 void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code);
59 void TY_(ReportWarning)(TidyDocImpl* doc, Node *element, Node *node, uint code);
60 void TY_(ReportError)(TidyDocImpl* doc, Node* element, Node* node, uint code);
61 void TY_(ReportFatal)(TidyDocImpl* doc, Node* element, Node* node, uint code);
62 
63 
64 /**
65  * These tidyErrorCodes are used throughout libtidy, and also
66  * have associated localized strings to describe them.
67  *
68  * IMPORTANT: to maintain compatability with TidyMessageFilter3, if you add
69  * or remove keys from this enum, ALSO add/remove the corresponding key
70  * in language.c:tidyErrorFilterKeysStruct[]!
71  */
72 typedef enum {
73  /* This MUST be present and first. */
75 
76  /* error codes for entities/numeric character references */
77 
83 
84  /* error codes for element messages */
85 
133 
134  /* error codes used for attribute messages */
135 
152 
157 
160 
165 
167 
169 
174 
175  REMOVED_HTML5, /* this element removed from HTML5 */
176  BAD_SUMMARY_HTML5, /* use of summary attr removed from HTML5 */
177 
178  PREVIOUS_LOCATION, /* last */
179 
180  /* character encoding errors */
181 
189 
193 
194  /* This MUST be present and last. */
197 
198 /**
199  * These tidyMessagesMisc are used throughout libtidy, and also
200  * have associated localized strings to describe them.
201  */
202 typedef enum {
203  ACCESS_URL = 2048, /* Used to point to Web Accessibility Guidelines. */
204  ATRC_ACCESS_URL, /* Points to Tidy's accessibility page. */
205  FILE_CANT_OPEN, /* For retrieving a string when a file can't be opened. */
206  LINE_COLUMN_STRING, /* For retrieving localized `line %d column %d` text. */
207  STRING_CONTENT_LOOKS, /* `Document content looks like %s`. */
208  STRING_DISCARDING, /* For `discarding`. */
209  STRING_DOCTYPE_GIVEN, /* `Doctype given is \"%s\". */
210  STRING_ERROR_COUNT, /* `%u %s, %u %s were found!`. */
211  STRING_ERROR_COUNT_ERROR, /* `error` and `errors`. */
212  STRING_ERROR_COUNT_WARNING, /* `warning` and `warnings`. */
213  STRING_HELLO_ACCESS, /* Accessibility hello message. */
214  STRING_HTML_PROPRIETARY, /* `HTML Proprietary`/ */
215  STRING_MISSING_MALFORMED, /* For `missing or malformed argument for option: %s`. */
216  STRING_NO_ERRORS, /* `No warnings or errors were found.\n\n`. */
217  STRING_NO_SYSID, /* `No system identifier in emitted doctype`. */
218  STRING_NOT_ALL_SHOWN, /* ` Not all warnings/errors were shown.\n\n`. */
219  STRING_PLAIN_TEXT, /* For retrieving a string `plain text`. */
220  STRING_REPLACING, /* For `replacing`. */
221  STRING_SPECIFIED, /* For `specified`. */
222  STRING_UNKNOWN_FILE, /* `%s: can't open file \"%s\"\n`. */
223  STRING_UNKNOWN_OPTION, /* For retrieving a string `unknown option: %s`. */
224  STRING_UNRECZD_OPTION, /* `unrecognized option -%c use -help to list options\n`. */
225  STRING_XML_DECLARATION, /* For retrieving a string `XML declaration`. */
226  TEXT_ACCESS_ADVICE1, /* Explanatory text. */
227  TEXT_ACCESS_ADVICE2, /* Explanatory text. */
228  TEXT_BAD_FORM, /* Explanatory text. */
229  TEXT_BAD_MAIN, /* Explanatory text. */
230  TEXT_GENERAL_INFO, /* Explanatory text. */
231  TEXT_GENERAL_INFO_PLEA, /* Explanatory text. */
232  TEXT_HTML_T_ALGORITHM, /* Paragraph for describing the HTML table algorithm. */
233  TEXT_INVALID_URI, /* Explanatory text. */
234  TEXT_INVALID_UTF16, /* Explanatory text. */
235  TEXT_INVALID_UTF8, /* Explanatory text. */
236  TEXT_M_IMAGE_ALT, /* Explanatory text. */
237  TEXT_M_IMAGE_MAP, /* Explanatory text. */
238  TEXT_M_LINK_ALT, /* Explanatory text. */
239  TEXT_M_SUMMARY, /* Explanatory text. */
240  TEXT_NEEDS_INTERVENTION, /* Explanatory text. */
241  TEXT_SGML_CHARS, /* Explanatory text. */
242  TEXT_USING_BODY, /* Explanatory text. */
243  TEXT_USING_FONT, /* Explanatory text. */
244  TEXT_USING_FRAMES, /* Explanatory text. */
245  TEXT_USING_LAYER, /* Explanatory text. */
246  TEXT_USING_NOBR, /* Explanatory text. */
247  TEXT_USING_SPACER, /* Explanatory text. */
248  TEXT_VENDOR_CHARS, /* Explanatory text. */
249  TEXT_WINDOWS_CHARS /* Explanatory text. */
251 
252 /* accessibility flaws */
253 
254 #define BA_MISSING_IMAGE_ALT 1
255 #define BA_MISSING_LINK_ALT 2
256 #define BA_MISSING_SUMMARY 4
257 #define BA_MISSING_IMAGE_MAP 8
258 #define BA_USING_FRAMES 16
259 #define BA_USING_NOFRAMES 32
260 #define BA_INVALID_LINK_NOFRAMES 64 /* WAI [6.5.1.4] */
261 #define BA_WAI (1 << 31)
262 
263 /* presentation flaws */
264 
265 #define USING_SPACER 1
266 #define USING_LAYER 2
267 #define USING_NOBR 4
268 #define USING_FONT 8
269 #define USING_BODY 16
270 
271 /* badchar bit field */
272 
273 #define BC_VENDOR_SPECIFIC_CHARS 1
274 #define BC_INVALID_SGML_CHARS 2
275 #define BC_INVALID_UTF8 4
276 #define BC_INVALID_UTF16 8
277 #define BC_ENCODING_MISMATCH 16 /* fatal error */
278 #define BC_INVALID_URI 32
279 #define BC_INVALID_NCR 64
280 
281 /* Lexer and I/O Macros */
282 
283 #define REPLACED_CHAR 0
284 #define DISCARDED_CHAR 1
285 
286 
287 #endif /* __MESSAGE_H__ */
Definition: message.h:147
Definition: message.h:243
Definition: message.h:226
Definition: message.h:108
Definition: message.h:195
Definition: message.h:146
Definition: message.h:224
Definition: message.h:112
Definition: message.h:225
Definition: message.h:100
Definition: message.h:230
TidyReportLevel
Message severity level These TidyReportLevel are used throughout libtidy, but don&#39;t have associated l...
Definition: tidyenum.h:257
Definition: message.h:126
Definition: message.h:248
Definition: message.h:185
Definition: message.h:140
Definition: message.h:154
Definition: message.h:208
Definition: message.h:123
Definition: message.h:79
Definition: message.h:104
Definition: message.h:155
Definition: message.h:124
Definition: message.h:113
Definition: message.h:182
Definition: message.h:244
Definition: message.h:115
Definition: message.h:217
Definition: message.h:239
Definition: message.h:106
Definition: message.h:127
const tmbchar * ctmbstr
Definition: tidyplatform.h:556
Definition: message.h:207
Definition: message.h:170
Definition: message.h:120
Definition: message.h:94
Definition: message.h:116
Definition: message.h:190
Definition: message.h:82
Definition: message.h:168
Definition: message.h:238
Definition: message.h:235
Definition: message.h:143
Definition: message.h:114
Definition: message.h:236
Definition: message.h:213
Definition: message.h:111
Definition: message.h:92
Definition: message.h:163
Definition: message.h:87
Definition: message.h:245
Definition: message.h:132
Definition: message.h:221
Definition: message.h:184
Definition: message.h:131
Definition: message.h:240
Definition: message.h:103
Definition: message.h:212
Definition: message.h:219
Definition: message.h:141
Definition: message.h:99
Definition: message.h:211
Definition: message.h:90
Definition: message.h:171
Definition: message.h:164
Definition: message.h:125
Bool
Definition: tidyplatform.h:593
Definition: message.h:249
Definition: message.h:233
Definition: message.h:175
Definition: message.h:122
Definition: message.h:247
Definition: message.h:151
Definition: message.h:216
Definition: message.h:204
Definition: message.h:86
Definition: message.h:223
Definition: message.h:138
Definition: message.h:209
Definition: message.h:176
Defines HTML Tidy API implemented by tidy library.
Definition: message.h:231
Definition: message.h:162
Definition: message.h:205
Definition: message.h:148
Definition: message.h:214
Definition: message.h:95
tidyMessagesMisc
These tidyMessagesMisc are used throughout libtidy, and also have associated localized strings to des...
Definition: message.h:202
Definition: message.h:232
Definition: message.h:102
Definition: message.h:88
Definition: message.h:218
Definition: message.h:150
Definition: message.h:101
Definition: message.h:128
Definition: message.h:183
Definition: message.h:237
Definition: message.h:161
Definition: message.h:229
Definition: message.h:228
Definition: message.h:105
Definition: message.h:156
Definition: message.h:178
Definition: message.h:192
Definition: message.h:89
Definition: message.h:117
Definition: message.h:139
Definition: message.h:93
Definition: message.h:119
unsigned int uint
Definition: tidyplatform.h:525
Definition: message.h:210
Definition: message.h:215
Definition: message.h:145
Definition: message.h:97
Definition: message.h:96
Definition: message.h:187
Definition: message.h:172
Definition: message.h:234
Definition: message.h:241
Definition: message.h:227
Definition: message.h:110
Definition: message.h:121
Definition: message.h:206
Definition: message.h:153
Definition: message.h:188
Definition: message.h:144
Definition: message.h:81
Definition: message.h:137
Definition: message.h:74
Definition: message.h:166
Definition: message.h:130
Definition: message.h:203
Definition: message.h:107
Definition: message.h:98
Definition: message.h:129
Definition: message.h:80
Definition: message.h:222
#define TY_(str)
Definition: forward.h:23
Definition: message.h:118
Definition: message.h:186
Definition: message.h:149
Definition: message.h:159
Definition: message.h:191
Definition: message.h:78
Definition: message.h:242
Definition: message.h:173
Definition: message.h:142
Definition: message.h:220
Definition: message.h:91
Definition: message.h:246
Definition: message.h:158
Definition: message.h:109
Definition: message.h:136
tidyErrorCodes
These tidyErrorCodes are used throughout libtidy, and also have associated localized strings to descr...
Definition: message.h:72