HTML Tidy  0.1
message.h
00001 #ifndef __MESSAGE_H__
00002 #define __MESSAGE_H__
00003 
00004 /* message.h -- general message writing routines
00005 
00006   (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
00007   See tidy.h for the copyright notice.
00008   
00009   CVS Info :
00010 
00011     $Author: arnaud02 $ 
00012     $Date: 2007/01/16 22:30:51 $ 
00013     $Revision: 1.28 $ 
00014 
00015 */
00016 
00017 #include "forward.h"
00018 #include "tidy.h"  /* For TidyReportLevel */
00019 
00020 /* General message writing routines.
00021 ** Each message is a single warning, error, etc.
00022 **
00023 ** This routine will keep track of counts and,
00024 ** if the caller has set a filter, it will be
00025 ** called.  The new preferred way of handling
00026 ** Tidy diagnostics output is either a) define
00027 ** a new output sink or b) install a message
00028 ** filter routine.
00029 **
00030 ** Keeps track of ShowWarnings, ShowErrors, etc.
00031 */
00032 
00033 ctmbstr TY_(ReleaseDate)(void);
00034 
00035 /* void TY_(ShowVersion)( TidyDocImpl* doc ); */
00036 void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option );
00037 void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option );
00038 void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc );
00039 
00040 /* void TY_(HelloMessage)( TidyDocImpl* doc, ctmbstr date, ctmbstr filename ); */
00041 void TY_(ReportMarkupVersion)( TidyDocImpl* doc );
00042 void TY_(ReportNumWarnings)( TidyDocImpl* doc );
00043 
00044 void TY_(GeneralInfo)( TidyDocImpl* doc );
00045 /* void TY_(UnknownOption)( TidyDocImpl* doc, char c ); */
00046 /* void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); */
00047 void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level );
00048 
00049 void TY_(ErrorSummary)( TidyDocImpl* doc );
00050 
00051 void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding);
00052 void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded);
00053 void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c );
00054 void TY_(ReportAttrError)( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
00055 void TY_(ReportMissingAttr)( TidyDocImpl* doc, Node* node, ctmbstr name );
00056 
00057 #if SUPPORT_ACCESSIBILITY_CHECKS
00058 
00059 void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code );
00060 void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code );
00061 
00062 #endif
00063 
00064 void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code);
00065 void TY_(ReportWarning)(TidyDocImpl* doc, Node *element, Node *node, uint code);
00066 void TY_(ReportError)(TidyDocImpl* doc, Node* element, Node* node, uint code);
00067 void TY_(ReportFatal)(TidyDocImpl* doc, Node* element, Node* node, uint code);
00068 
00069 /* error codes for entities/numeric character references */
00070 
00071 #define MISSING_SEMICOLON            1
00072 #define MISSING_SEMICOLON_NCR        2
00073 #define UNKNOWN_ENTITY               3
00074 #define UNESCAPED_AMPERSAND          4
00075 #define APOS_UNDEFINED               5
00076 
00077 /* error codes for element messages */
00078 
00079 #define MISSING_ENDTAG_FOR           6
00080 #define MISSING_ENDTAG_BEFORE        7
00081 #define DISCARDING_UNEXPECTED        8
00082 #define NESTED_EMPHASIS              9
00083 #define NON_MATCHING_ENDTAG          10
00084 #define TAG_NOT_ALLOWED_IN           11
00085 #define MISSING_STARTTAG             12
00086 #define UNEXPECTED_ENDTAG            13
00087 #define USING_BR_INPLACE_OF          14
00088 #define INSERTING_TAG                15
00089 #define SUSPECTED_MISSING_QUOTE      16
00090 #define MISSING_TITLE_ELEMENT        17
00091 #define DUPLICATE_FRAMESET           18
00092 #define CANT_BE_NESTED               19
00093 #define OBSOLETE_ELEMENT             20
00094 #define PROPRIETARY_ELEMENT          21
00095 #define UNKNOWN_ELEMENT              22
00096 #define TRIM_EMPTY_ELEMENT           23
00097 #define COERCE_TO_ENDTAG             24
00098 #define ILLEGAL_NESTING              25
00099 #define NOFRAMES_CONTENT             26
00100 #define CONTENT_AFTER_BODY           27
00101 #define INCONSISTENT_VERSION         28
00102 #define MALFORMED_COMMENT            29
00103 #define BAD_COMMENT_CHARS            30
00104 #define BAD_XML_COMMENT              31
00105 #define BAD_CDATA_CONTENT            32
00106 #define INCONSISTENT_NAMESPACE       33
00107 #define DOCTYPE_AFTER_TAGS           34
00108 #define MALFORMED_DOCTYPE            35
00109 #define UNEXPECTED_END_OF_FILE       36
00110 #define DTYPE_NOT_UPPER_CASE         37
00111 #define TOO_MANY_ELEMENTS            38
00112 #define UNESCAPED_ELEMENT            39
00113 #define NESTED_QUOTATION             40
00114 #define ELEMENT_NOT_EMPTY            41
00115 #define ENCODING_IO_CONFLICT         42
00116 #define MIXED_CONTENT_IN_BLOCK       43
00117 #define MISSING_DOCTYPE              44
00118 #define SPACE_PRECEDING_XMLDECL      45
00119 #define TOO_MANY_ELEMENTS_IN         46
00120 #define UNEXPECTED_ENDTAG_IN         47
00121 #define REPLACING_ELEMENT            83
00122 #define REPLACING_UNEX_ELEMENT       84
00123 #define COERCE_TO_ENDTAG_WARN        85
00124 
00125 /* error codes used for attribute messages */
00126 
00127 #define UNKNOWN_ATTRIBUTE            48
00128 #define INSERTING_ATTRIBUTE          49
00129 #define MISSING_ATTR_VALUE           50
00130 #define BAD_ATTRIBUTE_VALUE          51
00131 #define UNEXPECTED_GT                52
00132 #define PROPRIETARY_ATTRIBUTE        53
00133 #define PROPRIETARY_ATTR_VALUE       54
00134 #define REPEATED_ATTRIBUTE           55
00135 #define MISSING_IMAGEMAP             56
00136 #define XML_ATTRIBUTE_VALUE          57
00137 #define UNEXPECTED_QUOTEMARK         58
00138 #define MISSING_QUOTEMARK            59
00139 #define ID_NAME_MISMATCH             60
00140 
00141 #define BACKSLASH_IN_URI             61
00142 #define FIXED_BACKSLASH              62
00143 #define ILLEGAL_URI_REFERENCE        63
00144 #define ESCAPED_ILLEGAL_URI          64
00145 
00146 #define NEWLINE_IN_URI               65
00147 #define ANCHOR_NOT_UNIQUE            66
00148 
00149 #define JOINING_ATTRIBUTE            68
00150 #define UNEXPECTED_EQUALSIGN         69
00151 #define ATTR_VALUE_NOT_LCASE         70
00152 #define XML_ID_SYNTAX                71
00153 
00154 #define INVALID_ATTRIBUTE            72
00155 
00156 #define BAD_ATTRIBUTE_VALUE_REPLACED 73
00157 
00158 #define INVALID_XML_ID               74
00159 #define UNEXPECTED_END_OF_FILE_ATTR  75
00160 #define MISSING_ATTRIBUTE            86
00161 #define WHITE_IN_URI                 87
00162 
00163 #define PREVIOUS_LOCATION            88 /* last */
00164 
00165 /* character encoding errors */
00166 
00167 #define VENDOR_SPECIFIC_CHARS        76
00168 #define INVALID_SGML_CHARS           77
00169 #define INVALID_UTF8                 78
00170 #define INVALID_UTF16                79
00171 #define ENCODING_MISMATCH            80
00172 #define INVALID_URI                  81
00173 #define INVALID_NCR                  82
00174 
00175 /* accessibility flaws */
00176 
00177 #define BA_MISSING_IMAGE_ALT       1
00178 #define BA_MISSING_LINK_ALT        2
00179 #define BA_MISSING_SUMMARY         4
00180 #define BA_MISSING_IMAGE_MAP       8
00181 #define BA_USING_FRAMES            16
00182 #define BA_USING_NOFRAMES          32
00183 #define BA_INVALID_LINK_NOFRAMES   64  /* WAI [6.5.1.4] */  
00184 #define BA_WAI                     (1 << 31)
00185 
00186 /* presentation flaws */
00187 
00188 #define USING_SPACER            1
00189 #define USING_LAYER             2
00190 #define USING_NOBR              4
00191 #define USING_FONT              8
00192 #define USING_BODY              16
00193 
00194 #define REPLACED_CHAR           0
00195 #define DISCARDED_CHAR          1
00196 
00197 /* badchar bit field */
00198 
00199 #define BC_VENDOR_SPECIFIC_CHARS   1
00200 #define BC_INVALID_SGML_CHARS      2
00201 #define BC_INVALID_UTF8            4
00202 #define BC_INVALID_UTF16           8
00203 #define BC_ENCODING_MISMATCH       16 /* fatal error */
00204 #define BC_INVALID_URI             32
00205 #define BC_INVALID_NCR             64
00206 
00207 #endif /* __MESSAGE_H__ */