4
/* message.h -- general message writing routines
6
(c) 1998-2005 (W3C) MIT, ERCIM, Keio University
7
See tidy.h for the copyright notice.
12
$Date: 2005/01/18 11:10:15 $
18
#include "tidy.h" /* For TidyReportLevel */
20
/* General message writing routines.
21
** Each message is a single warning, error, etc.
23
** This routine will keep track of counts and,
24
** if the caller has set a filter, it will be
25
** called. The new preferred way of handling
26
** Tidy diagnostics output is either a) define
27
** a new output sink or b) install a message
30
** Keeps track of ShowWarnings, ShowErrors, etc.
33
ctmbstr ReleaseDate(void);
35
/* Reports error at current Lexer line/column. */
36
void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
38
__attribute__((format(printf, 3, 4)))
42
/* Reports error at node line/column. */
43
void messageNode( TidyDocImpl* doc, TidyReportLevel level,
44
Node* node, ctmbstr msg, ... )
46
__attribute__((format(printf, 4, 5)))
50
/* Reports error at given line/column. */
51
void messageLexer( TidyDocImpl* doc, TidyReportLevel level,
54
__attribute__((format(printf, 3, 4)))
58
/* For general reporting. Emits nothing if --quiet yes */
59
void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... )
61
__attribute__((format(printf, 2, 3)))
66
void ShowVersion( TidyDocImpl* doc );
67
void ReportUnknownOption( TidyDocImpl* doc, ctmbstr option );
68
void ReportBadArgument( TidyDocImpl* doc, ctmbstr option );
69
void NeedsAuthorIntervention( TidyDocImpl* doc );
71
void HelloMessage( TidyDocImpl* doc, ctmbstr date, ctmbstr filename );
72
void ReportMarkupVersion( TidyDocImpl* doc );
73
void ReportNumWarnings( TidyDocImpl* doc );
75
void GeneralInfo( TidyDocImpl* doc );
76
void UnknownOption( TidyDocImpl* doc, char c );
77
void UnknownFile( TidyDocImpl* doc, ctmbstr program, ctmbstr file );
78
void FileError( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level );
80
void ErrorSummary( TidyDocImpl* doc );
82
void ReportEncodingWarning(TidyDocImpl* doc, uint code, uint encoding);
83
void ReportEncodingError(TidyDocImpl* doc, uint code, uint c, Bool discarded);
84
void ReportEntityError( TidyDocImpl* doc, uint code, ctmbstr entity, int c );
85
void ReportAttrError( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
86
void ReportMissingAttr( TidyDocImpl* doc, Node* node, ctmbstr name );
88
#if SUPPORT_ACCESSIBILITY_CHECKS
90
void ReportAccessWarning( TidyDocImpl* doc, Node* node, uint code );
91
void ReportAccessError( TidyDocImpl* doc, Node* node, uint code );
95
void ReportNotice(TidyDocImpl* doc, Node *element, Node *node, uint code);
96
void ReportWarning(TidyDocImpl* doc, Node *element, Node *node, uint code);
97
void ReportError(TidyDocImpl* doc, Node* element, Node* node, uint code);
98
void ReportFatal(TidyDocImpl* doc, Node* element, Node* node, uint code);
100
/* error codes for entities/numeric character references */
102
#define MISSING_SEMICOLON 1
103
#define MISSING_SEMICOLON_NCR 2
104
#define UNKNOWN_ENTITY 3
105
#define UNESCAPED_AMPERSAND 4
106
#define APOS_UNDEFINED 5
108
/* error codes for element messages */
110
#define MISSING_ENDTAG_FOR 6
111
#define MISSING_ENDTAG_BEFORE 7
112
#define DISCARDING_UNEXPECTED 8
113
#define NESTED_EMPHASIS 9
114
#define NON_MATCHING_ENDTAG 10
115
#define TAG_NOT_ALLOWED_IN 11
116
#define MISSING_STARTTAG 12
117
#define UNEXPECTED_ENDTAG 13
118
#define USING_BR_INPLACE_OF 14
119
#define INSERTING_TAG 15
120
#define SUSPECTED_MISSING_QUOTE 16
121
#define MISSING_TITLE_ELEMENT 17
122
#define DUPLICATE_FRAMESET 18
123
#define CANT_BE_NESTED 19
124
#define OBSOLETE_ELEMENT 20
125
#define PROPRIETARY_ELEMENT 21
126
#define UNKNOWN_ELEMENT 22
127
#define TRIM_EMPTY_ELEMENT 23
128
#define COERCE_TO_ENDTAG 24
129
#define ILLEGAL_NESTING 25
130
#define NOFRAMES_CONTENT 26
131
#define CONTENT_AFTER_BODY 27
132
#define INCONSISTENT_VERSION 28
133
#define MALFORMED_COMMENT 29
134
#define BAD_COMMENT_CHARS 30
135
#define BAD_XML_COMMENT 31
136
#define BAD_CDATA_CONTENT 32
137
#define INCONSISTENT_NAMESPACE 33
138
#define DOCTYPE_AFTER_TAGS 34
139
#define MALFORMED_DOCTYPE 35
140
#define UNEXPECTED_END_OF_FILE 36
141
#define DTYPE_NOT_UPPER_CASE 37
142
#define TOO_MANY_ELEMENTS 38
143
#define UNESCAPED_ELEMENT 39
144
#define NESTED_QUOTATION 40
145
#define ELEMENT_NOT_EMPTY 41
146
#define ENCODING_IO_CONFLICT 42
147
#define MIXED_CONTENT_IN_BLOCK 43
148
#define MISSING_DOCTYPE 44
149
#define SPACE_PRECEDING_XMLDECL 45
150
#define TOO_MANY_ELEMENTS_IN 46
151
#define UNEXPECTED_ENDTAG_IN 47
152
#define REPLACING_ELEMENT 83
153
#define REPLACING_UNEX_ELEMENT 84
154
#define COERCE_TO_ENDTAG_WARN 85
156
/* error codes used for attribute messages */
158
#define UNKNOWN_ATTRIBUTE 48
159
#define INSERTING_ATTRIBUTE 49
160
#define MISSING_ATTR_VALUE 50
161
#define BAD_ATTRIBUTE_VALUE 51
162
#define UNEXPECTED_GT 52
163
#define PROPRIETARY_ATTRIBUTE 53
164
#define PROPRIETARY_ATTR_VALUE 54
165
#define REPEATED_ATTRIBUTE 55
166
#define MISSING_IMAGEMAP 56
167
#define XML_ATTRIBUTE_VALUE 57
168
#define UNEXPECTED_QUOTEMARK 58
169
#define MISSING_QUOTEMARK 59
170
#define ID_NAME_MISMATCH 60
172
#define BACKSLASH_IN_URI 61
173
#define FIXED_BACKSLASH 62
174
#define ILLEGAL_URI_REFERENCE 63
175
#define ESCAPED_ILLEGAL_URI 64
177
#define NEWLINE_IN_URI 65
178
#define ANCHOR_NOT_UNIQUE 66
180
#define JOINING_ATTRIBUTE 68
181
#define UNEXPECTED_EQUALSIGN 69
182
#define ATTR_VALUE_NOT_LCASE 70
183
#define XML_ID_SYNTAX 71
185
#define INVALID_ATTRIBUTE 72
187
#define BAD_ATTRIBUTE_VALUE_REPLACED 73
189
#define INVALID_XML_ID 74
190
#define UNEXPECTED_END_OF_FILE_ATTR 75
191
#define MISSING_ATTRIBUTE 86 /* last */
194
/* character encoding errors */
196
#define VENDOR_SPECIFIC_CHARS 76
197
#define INVALID_SGML_CHARS 77
198
#define INVALID_UTF8 78
199
#define INVALID_UTF16 79
200
#define ENCODING_MISMATCH 80
201
#define INVALID_URI 81
202
#define INVALID_NCR 82
204
/* accessibility flaws */
206
#define MISSING_IMAGE_ALT 1
207
#define MISSING_LINK_ALT 2
208
#define MISSING_SUMMARY 4
209
#define MISSING_IMAGE_MAP 8
210
#define USING_FRAMES 16
211
#define USING_NOFRAMES 32
213
/* presentation flaws */
215
#define USING_SPACER 1
216
#define USING_LAYER 2
219
#define USING_BODY 16
221
#define REPLACED_CHAR 0
222
#define DISCARDED_CHAR 1
224
/* badchar bit field */
226
#define BC_VENDOR_SPECIFIC_CHARS 1
227
#define BC_INVALID_SGML_CHARS 2
228
#define BC_INVALID_UTF8 4
229
#define BC_INVALID_UTF16 8
230
#define BC_ENCODING_MISMATCH 16 /* fatal error */
231
#define BC_INVALID_URI 32
232
#define BC_INVALID_NCR 64
234
#endif /* __MESSAGE_H__ */