aboutsummaryrefslogtreecommitdiffstats
path: root/include/libxml/xmlerror.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libxml/xmlerror.h')
-rw-r--r--include/libxml/xmlerror.h104
1 files changed, 103 insertions, 1 deletions
diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
index 9e1a16dd..ebf6f536 100644
--- a/include/libxml/xmlerror.h
+++ b/include/libxml/xmlerror.h
@@ -7,6 +7,70 @@
extern "C" {
#endif
+/**
+ * xmlErrorLevel:
+ *
+ * Indicates the level of an error
+ */
+typedef enum {
+ XML_ERR_NONE = 0,
+ XML_ERR_WARNING = 1, /* A simple warning */
+ XML_ERR_ERROR = 2, /* A recoverable error */
+ XML_ERR_FATAL = 3 /* A fatal error */
+} xmlErrorLevel;
+
+/**
+ * xmlErrorDomain:
+ *
+ * Indicates where an error may have come from
+ */
+typedef enum {
+ XML_FROM_NONE = 0,
+ XML_FROM_PARSER, /* The XML parser */
+ XML_FROM_NAMESPACE, /* The XML Namespace module */
+ XML_FROM_DTD, /* The XML DTD validation */
+ XML_FROM_HTML, /* The HTML parser */
+ XML_FROM_MEMORY, /* The memory allocator */
+ XML_FROM_OUTPUT, /* The serialization code */
+ XML_FROM_IO, /* The Input/Output stack */
+ XML_FROM_XINCLUDE, /* The XInclude processing */
+ XML_FROM_XPATH, /* The XPath module */
+ XML_FROM_XPOINTER, /* The XPointer module */
+ XML_FROM_REGEXP, /* The regular expressions module */
+ XML_FROM_SCHEMAS, /* The W3C XML Schemas module */
+ XML_FROM_RELAXNG, /* The Relax-NG module */
+ XML_FROM_CATALOG, /* The Catalog module */
+ XML_FROM_C14N, /* The Canonicalization module */
+ XML_FROM_XSLT /* The XSLT engine from libxslt */
+} xmlErrorDomain;
+
+/**
+ * xmlError:
+ *
+ * An XML Error instance.
+ */
+
+typedef struct _xmlError xmlError;
+typedef xmlError *xmlErrorPtr;
+struct _xmlError {
+ int domain; /* What part of the library raised this error */
+ int code; /* The error code, e.g. an xmlParserError */
+ char *message;/* human-readable informative error message */
+ xmlErrorLevel level;/* how consequent is the error */
+ char *file; /* the filename */
+ int line; /* the line number if available */
+ char *str1; /* extra string information */
+ char *str2; /* extra string information */
+ char *str3; /* extra string information */
+ int int1; /* extra number information */
+ int int2; /* extra number information */
+};
+
+/**
+ * xmlParserError:
+ *
+ * This is an error that the XML (or HTML) parser can generate
+ */
typedef enum {
XML_ERR_OK = 0,
XML_ERR_INTERNAL_ERROR,
@@ -141,7 +205,11 @@ typedef enum {
XML_NS_ERR_QNAME,
XML_NS_ERR_ATTRIBUTE_REDEFINED,
XML_ERR_CONDSEC_INVALID_KEYWORD,
- XML_ERR_VERSION_MISSING
+ XML_ERR_VERSION_MISSING,
+ XML_DTD_MIXED_CORRUPT,
+ XML_DTD_NO_DOC,
+ XML_DTD_NO_ELEM_NAME,
+ XML_DTD_NOTATION_REDEFINED
} xmlParserErrors;
/**
@@ -192,6 +260,40 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL
xmlParserPrintFileContext (xmlParserInputPtr input);
+/*
+ * Extended error information routines
+ */
+XMLPUBFUN xmlErrorPtr XMLCALL
+ xmlGetLastError (void);
+XMLPUBFUN void XMLCALL
+ xmlResetLastError (void);
+XMLPUBFUN xmlErrorPtr XMLCALL
+ xmlCtxtGetLastError (void *ctx);
+XMLPUBFUN void XMLCALL
+ xmlCtxtResetLastError (void *ctx);
+XMLPUBFUN void XMLCALL
+ xmlResetError (xmlErrorPtr err);
+XMLPUBFUN int XMLCALL
+ xmlCopyError (xmlErrorPtr from,
+ xmlErrorPtr to);
+
+/*
+ * Intended for internal use mostly
+ */
+XMLPUBFUN void XMLCALL
+ xmlRaiseError (void *ctx,
+ int domain,
+ int code,
+ xmlErrorLevel level,
+ const char *file,
+ int line,
+ const char *str1,
+ const char *str2,
+ const char *str3,
+ int int1,
+ int int2,
+ const char *msg,
+ ...);
#ifdef __cplusplus
}
#endif