OSDN Git Service

Initial commit
[wordring-tm/wordring-tm.git] / third_party / tidy-html5-master / src / message.h
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
14 /* General message writing routines.
15 ** Each message is a single warning, error, etc.
16 **
17 ** This routine will keep track of counts and,
18 ** if the caller has set a filter, it will be
19 ** called.  The new preferred way of handling
20 ** Tidy diagnostics output is either a) define
21 ** a new output sink or b) install a message
22 ** filter routine.
23 **
24 ** Keeps track of ShowWarnings, ShowErrors, etc.
25 */
26
27 ctmbstr TY_(ReleaseDate)(void);
28
29 /* void TY_(ShowVersion)( TidyDocImpl* doc ); */
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_(HelloMessage)( TidyDocImpl* doc, ctmbstr date, ctmbstr filename ); */
35 void TY_(ReportMarkupVersion)( TidyDocImpl* doc );
36 void TY_(ReportNumWarnings)( TidyDocImpl* doc );
37
38 void TY_(GeneralInfo)( TidyDocImpl* doc );
39 /* void TY_(UnknownOption)( TidyDocImpl* doc, char c ); */
40 /* void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); */
41 void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level );
42
43 void TY_(ErrorSummary)( TidyDocImpl* doc );
44
45 void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding);
46 void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded);
47 void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c );
48 void TY_(ReportAttrError)( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
49 void TY_(ReportMissingAttr)( TidyDocImpl* doc, Node* node, ctmbstr name );
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 /* error codes for entities/numeric character references */
64
65 #define MISSING_SEMICOLON            1
66 #define MISSING_SEMICOLON_NCR        2
67 #define UNKNOWN_ENTITY               3
68 #define UNESCAPED_AMPERSAND          4
69 #define APOS_UNDEFINED               5
70
71 /* error codes for element messages */
72
73 #define MISSING_ENDTAG_FOR           6
74 #define MISSING_ENDTAG_BEFORE        7
75 #define DISCARDING_UNEXPECTED        8
76 #define NESTED_EMPHASIS              9
77 #define NON_MATCHING_ENDTAG          10
78 #define TAG_NOT_ALLOWED_IN           11
79 #define MISSING_STARTTAG             12
80 #define UNEXPECTED_ENDTAG            13
81 #define USING_BR_INPLACE_OF          14
82 #define INSERTING_TAG                15
83 #define SUSPECTED_MISSING_QUOTE      16
84 #define MISSING_TITLE_ELEMENT        17
85 #define DUPLICATE_FRAMESET           18
86 #define CANT_BE_NESTED               19
87 #define OBSOLETE_ELEMENT             20
88 #define PROPRIETARY_ELEMENT          21
89 #define UNKNOWN_ELEMENT              22
90 #define TRIM_EMPTY_ELEMENT           23
91 #define COERCE_TO_ENDTAG             24
92 #define ILLEGAL_NESTING              25
93 #define NOFRAMES_CONTENT             26
94 #define CONTENT_AFTER_BODY           27
95 #define INCONSISTENT_VERSION         28
96 #define MALFORMED_COMMENT            29
97 #define BAD_COMMENT_CHARS            30
98 #define BAD_XML_COMMENT              31
99 #define BAD_CDATA_CONTENT            32
100 #define INCONSISTENT_NAMESPACE       33
101 #define DOCTYPE_AFTER_TAGS           34
102 #define MALFORMED_DOCTYPE            35
103 #define UNEXPECTED_END_OF_FILE       36
104 #define DTYPE_NOT_UPPER_CASE         37
105 #define TOO_MANY_ELEMENTS            38
106 #define UNESCAPED_ELEMENT            39
107 #define NESTED_QUOTATION             40
108 #define ELEMENT_NOT_EMPTY            41
109 #define ENCODING_IO_CONFLICT         42
110 #define MIXED_CONTENT_IN_BLOCK       43
111 #define MISSING_DOCTYPE              44
112 #define SPACE_PRECEDING_XMLDECL      45
113 #define TOO_MANY_ELEMENTS_IN         46
114 #define UNEXPECTED_ENDTAG_IN         47
115 #define REPLACING_ELEMENT            83
116 #define REPLACING_UNEX_ELEMENT       84
117 #define COERCE_TO_ENDTAG_WARN        85
118
119 /* error codes used for attribute messages */
120
121 #define UNKNOWN_ATTRIBUTE            48
122 #define INSERTING_ATTRIBUTE          49
123 #define MISSING_ATTR_VALUE           50
124 #define BAD_ATTRIBUTE_VALUE          51
125 #define UNEXPECTED_GT                52
126 #define PROPRIETARY_ATTRIBUTE        53
127 #define PROPRIETARY_ATTR_VALUE       54
128 #define REPEATED_ATTRIBUTE           55
129 #define MISSING_IMAGEMAP             56
130 #define XML_ATTRIBUTE_VALUE          57
131 #define UNEXPECTED_QUOTEMARK         58
132 #define MISSING_QUOTEMARK            59
133 #define ID_NAME_MISMATCH             60
134
135 #define BACKSLASH_IN_URI             61
136 #define FIXED_BACKSLASH              62
137 #define ILLEGAL_URI_REFERENCE        63
138 #define ESCAPED_ILLEGAL_URI          64
139
140 #define NEWLINE_IN_URI               65
141 #define ANCHOR_NOT_UNIQUE            66
142
143 #define JOINING_ATTRIBUTE            68
144 #define UNEXPECTED_EQUALSIGN         69
145 #define ATTR_VALUE_NOT_LCASE         70
146 #define XML_ID_SYNTAX                71
147
148 #define INVALID_ATTRIBUTE            72
149
150 #define BAD_ATTRIBUTE_VALUE_REPLACED 73
151
152 #define INVALID_XML_ID               74
153 #define UNEXPECTED_END_OF_FILE_ATTR  75
154 #define MISSING_ATTRIBUTE            86
155 #define WHITE_IN_URI                 87
156
157 #define REMOVED_HTML5                88 /* this element removed from HTML5 */
158 #define BAD_BODY_HTML5               89 /* attr on body removed from HTML5 */
159 #define BAD_ALIGN_HTML5              90 /* use of align attr removed from HTML5 */
160
161 #define PREVIOUS_LOCATION            91 /* last */
162
163 /* character encoding errors */
164
165 #define VENDOR_SPECIFIC_CHARS        76
166 #define INVALID_SGML_CHARS           77
167 #define INVALID_UTF8                 78
168 #define INVALID_UTF16                79
169 #define ENCODING_MISMATCH            80
170 #define INVALID_URI                  81
171 #define INVALID_NCR                  82
172
173 /* accessibility flaws */
174
175 #define BA_MISSING_IMAGE_ALT       1
176 #define BA_MISSING_LINK_ALT        2
177 #define BA_MISSING_SUMMARY         4
178 #define BA_MISSING_IMAGE_MAP       8
179 #define BA_USING_FRAMES            16
180 #define BA_USING_NOFRAMES          32
181 #define BA_INVALID_LINK_NOFRAMES   64  /* WAI [6.5.1.4] */  
182 #define BA_WAI                     (1 << 31)
183
184 /* presentation flaws */
185
186 #define USING_SPACER            1
187 #define USING_LAYER             2
188 #define USING_NOBR              4
189 #define USING_FONT              8
190 #define USING_BODY              16
191
192 #define REPLACED_CHAR           0
193 #define DISCARDED_CHAR          1
194
195 /* badchar bit field */
196
197 #define BC_VENDOR_SPECIFIC_CHARS   1
198 #define BC_INVALID_SGML_CHARS      2
199 #define BC_INVALID_UTF8            4
200 #define BC_INVALID_UTF16           8
201 #define BC_ENCODING_MISMATCH       16 /* fatal error */
202 #define BC_INVALID_URI             32
203 #define BC_INVALID_NCR             64
204
205 #endif /* __MESSAGE_H__ */