1#ifndef __MESSAGE_H__ 2#define __MESSAGE_H__ 3 4/* message.h -- general message writing routines 5 6 (c) 1998-2006 (W3C) MIT, ERCIM, Keio University 7 See tidy.h for the copyright notice. 8 9 CVS Info : 10 11 $Author: iccir $ 12 $Date: 2007/01/30 23:46:52 $ 13 $Revision: 1.3 $ 14 15*/ 16 17#include "forward.h" 18#include "tidy.h" /* For TidyReportLevel */ 19 20/* General message writing routines. 21** Each message is a single warning, error, etc. 22** 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 28** filter routine. 29** 30** Keeps track of ShowWarnings, ShowErrors, etc. 31*/ 32 33ctmbstr TY_(ReleaseDate)(void); 34 35/* void TY_(ShowVersion)( TidyDocImpl* doc ); */ 36void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option ); 37void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option ); 38void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc ); 39 40/* void TY_(HelloMessage)( TidyDocImpl* doc, ctmbstr date, ctmbstr filename ); */ 41void TY_(ReportMarkupVersion)( TidyDocImpl* doc ); 42void TY_(ReportNumWarnings)( TidyDocImpl* doc ); 43 44void TY_(GeneralInfo)( TidyDocImpl* doc ); 45/* void TY_(UnknownOption)( TidyDocImpl* doc, char c ); */ 46/* void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); */ 47void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level ); 48 49void TY_(ErrorSummary)( TidyDocImpl* doc ); 50 51void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding); 52void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded); 53void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c ); 54void TY_(ReportAttrError)( TidyDocImpl* doc, Node* node, AttVal* av, uint code ); 55void TY_(ReportMissingAttr)( TidyDocImpl* doc, Node* node, ctmbstr name ); 56 57#if SUPPORT_ACCESSIBILITY_CHECKS 58 59void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code ); 60void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ); 61 62#endif 63 64void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code); 65void TY_(ReportWarning)(TidyDocImpl* doc, Node *element, Node *node, uint code); 66void TY_(ReportError)(TidyDocImpl* doc, Node* element, Node* node, uint code); 67void TY_(ReportFatal)(TidyDocImpl* doc, Node* element, Node* node, uint code); 68 69/* error codes for entities/numeric character references */ 70 71#define MISSING_SEMICOLON 1 72#define MISSING_SEMICOLON_NCR 2 73#define UNKNOWN_ENTITY 3 74#define UNESCAPED_AMPERSAND 4 75#define APOS_UNDEFINED 5 76 77/* error codes for element messages */ 78 79#define MISSING_ENDTAG_FOR 6 80#define MISSING_ENDTAG_BEFORE 7 81#define DISCARDING_UNEXPECTED 8 82#define NESTED_EMPHASIS 9 83#define NON_MATCHING_ENDTAG 10 84#define TAG_NOT_ALLOWED_IN 11 85#define MISSING_STARTTAG 12 86#define UNEXPECTED_ENDTAG 13 87#define USING_BR_INPLACE_OF 14 88#define INSERTING_TAG 15 89#define SUSPECTED_MISSING_QUOTE 16 90#define MISSING_TITLE_ELEMENT 17 91#define DUPLICATE_FRAMESET 18 92#define CANT_BE_NESTED 19 93#define OBSOLETE_ELEMENT 20 94#define PROPRIETARY_ELEMENT 21 95#define UNKNOWN_ELEMENT 22 96#define TRIM_EMPTY_ELEMENT 23 97#define COERCE_TO_ENDTAG 24 98#define ILLEGAL_NESTING 25 99#define NOFRAMES_CONTENT 26 100#define CONTENT_AFTER_BODY 27 101#define INCONSISTENT_VERSION 28 102#define MALFORMED_COMMENT 29 103#define BAD_COMMENT_CHARS 30 104#define BAD_XML_COMMENT 31 105#define BAD_CDATA_CONTENT 32 106#define INCONSISTENT_NAMESPACE 33 107#define DOCTYPE_AFTER_TAGS 34 108#define MALFORMED_DOCTYPE 35 109#define UNEXPECTED_END_OF_FILE 36 110#define DTYPE_NOT_UPPER_CASE 37 111#define TOO_MANY_ELEMENTS 38 112#define UNESCAPED_ELEMENT 39 113#define NESTED_QUOTATION 40 114#define ELEMENT_NOT_EMPTY 41 115#define ENCODING_IO_CONFLICT 42 116#define MIXED_CONTENT_IN_BLOCK 43 117#define MISSING_DOCTYPE 44 118#define SPACE_PRECEDING_XMLDECL 45 119#define TOO_MANY_ELEMENTS_IN 46 120#define UNEXPECTED_ENDTAG_IN 47 121#define REPLACING_ELEMENT 83 122#define REPLACING_UNEX_ELEMENT 84 123#define COERCE_TO_ENDTAG_WARN 85 124 125/* error codes used for attribute messages */ 126 127#define UNKNOWN_ATTRIBUTE 48 128#define INSERTING_ATTRIBUTE 49 129#define MISSING_ATTR_VALUE 50 130#define BAD_ATTRIBUTE_VALUE 51 131#define UNEXPECTED_GT 52 132#define PROPRIETARY_ATTRIBUTE 53 133#define PROPRIETARY_ATTR_VALUE 54 134#define REPEATED_ATTRIBUTE 55 135#define MISSING_IMAGEMAP 56 136#define XML_ATTRIBUTE_VALUE 57 137#define UNEXPECTED_QUOTEMARK 58 138#define MISSING_QUOTEMARK 59 139#define ID_NAME_MISMATCH 60 140 141#define BACKSLASH_IN_URI 61 142#define FIXED_BACKSLASH 62 143#define ILLEGAL_URI_REFERENCE 63 144#define ESCAPED_ILLEGAL_URI 64 145 146#define NEWLINE_IN_URI 65 147#define ANCHOR_NOT_UNIQUE 66 148 149#define JOINING_ATTRIBUTE 68 150#define UNEXPECTED_EQUALSIGN 69 151#define ATTR_VALUE_NOT_LCASE 70 152#define XML_ID_SYNTAX 71 153 154#define INVALID_ATTRIBUTE 72 155 156#define BAD_ATTRIBUTE_VALUE_REPLACED 73 157 158#define INVALID_XML_ID 74 159#define UNEXPECTED_END_OF_FILE_ATTR 75 160#define MISSING_ATTRIBUTE 86 161#define WHITE_IN_URI 87 /* 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 MISSING_IMAGE_ALT 1 176#define MISSING_LINK_ALT 2 177#define MISSING_SUMMARY 4 178#define MISSING_IMAGE_MAP 8 179#define USING_FRAMES 16 180#define USING_NOFRAMES 32 181 182/* presentation flaws */ 183 184#define USING_SPACER 1 185#define USING_LAYER 2 186#define USING_NOBR 4 187#define USING_FONT 8 188#define USING_BODY 16 189 190#define REPLACED_CHAR 0 191#define DISCARDED_CHAR 1 192 193/* badchar bit field */ 194 195#define BC_VENDOR_SPECIFIC_CHARS 1 196#define BC_INVALID_SGML_CHARS 2 197#define BC_INVALID_UTF8 4 198#define BC_INVALID_UTF16 8 199#define BC_ENCODING_MISMATCH 16 /* fatal error */ 200#define BC_INVALID_URI 32 201#define BC_INVALID_NCR 64 202 203#endif /* __MESSAGE_H__ */ 204