ReactOS  0.4.11-dev-721-g95bc44e
xmlerror.h
Go to the documentation of this file.
1 /*
2  * Summary: error handling
3  * Description: the API used to report errors
4  *
5  * Copy: See Copyright for the status of this software.
6  *
7  * Author: Daniel Veillard
8  */
9 
10 #include <libxml/parser.h>
11 
12 #ifndef __XML_ERROR_H__
13 #define __XML_ERROR_H__
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
24 typedef enum {
26  XML_ERR_WARNING = 1, /* A simple warning */
27  XML_ERR_ERROR = 2, /* A recoverable error */
28  XML_ERR_FATAL = 3 /* A fatal error */
30 
36 typedef enum {
38  XML_FROM_PARSER, /* The XML parser */
39  XML_FROM_TREE, /* The tree module */
40  XML_FROM_NAMESPACE, /* The XML Namespace module */
41  XML_FROM_DTD, /* The XML DTD validation with parser context*/
42  XML_FROM_HTML, /* The HTML parser */
43  XML_FROM_MEMORY, /* The memory allocator */
44  XML_FROM_OUTPUT, /* The serialization code */
45  XML_FROM_IO, /* The Input/Output stack */
46  XML_FROM_FTP, /* The FTP module */
47  XML_FROM_HTTP, /* The HTTP module */
48  XML_FROM_XINCLUDE, /* The XInclude processing */
49  XML_FROM_XPATH, /* The XPath module */
50  XML_FROM_XPOINTER, /* The XPointer module */
51  XML_FROM_REGEXP, /* The regular expressions module */
52  XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */
53  XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */
54  XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */
55  XML_FROM_RELAXNGP, /* The Relax-NG parser module */
56  XML_FROM_RELAXNGV, /* The Relax-NG validator module */
57  XML_FROM_CATALOG, /* The Catalog module */
58  XML_FROM_C14N, /* The Canonicalization module */
59  XML_FROM_XSLT, /* The XSLT engine from libxslt */
60  XML_FROM_VALID, /* The XML DTD validation with valid context */
61  XML_FROM_CHECK, /* The error checking module */
62  XML_FROM_WRITER, /* The xmlwriter module */
63  XML_FROM_MODULE, /* The dynamically loaded module module*/
64  XML_FROM_I18N, /* The module handling character conversion */
65  XML_FROM_SCHEMATRONV,/* The Schematron validator module */
66  XML_FROM_BUFFER, /* The buffers module */
67  XML_FROM_URI /* The URI module */
69 
76 typedef struct _xmlError xmlError;
78 struct _xmlError {
79  int domain; /* What part of the library raised this error */
80  int code; /* The error code, e.g. an xmlParserError */
81  char *message;/* human-readable informative error message */
82  xmlErrorLevel level;/* how consequent is the error */
83  char *file; /* the filename */
84  int line; /* the line number if available */
85  char *str1; /* extra string information */
86  char *str2; /* extra string information */
87  char *str3; /* extra string information */
88  int int1; /* extra number information */
89  int int2; /* error column # or 0 if N/A (todo: rename field when we would brk ABI) */
90  void *ctxt; /* the parser context if available */
91  void *node; /* the node in the tree */
92 };
93 
99 typedef enum {
194  XML_ERR_NO_DTD, /* 94 */
199  XML_WAR_NS_URI, /* 99 */
206  XML_WAR_NS_COLUMN, /* 106 */
211  XML_ERR_USER_STOP, /* 111 */
214  XML_NS_ERR_QNAME, /* 202 */
216  XML_NS_ERR_EMPTY, /* 204 */
217  XML_NS_ERR_COLON, /* 205 */
230  XML_DTD_ID_FIXED, /* 512 */
232  XML_DTD_ID_SUBSET, /* 514 */
239  XML_DTD_NO_DOC, /* 521 */
240  XML_DTD_NO_DTD, /* 522 */
242  XML_DTD_NO_PREFIX, /* 524 */
243  XML_DTD_NO_ROOT, /* 525 */
246  XML_DTD_NOT_EMPTY, /* 528 */
249  XML_DTD_ROOT_NAME, /* 531 */
259  XML_DTD_DUP_TOKEN, /* 541 */
284  XML_RNGP_EMPTY, /* 1022 */
361  XML_RNGP_REF_CYCLE, /* 1099 */
384  XML_RNGP_XML_NS, /* 1122 */
410  XML_TREE_NOT_UTF8, /* 1303 */
417  XML_IO_EACCES, /* 1501 */
418  XML_IO_EAGAIN, /* 1502 */
419  XML_IO_EBADF, /* 1503 */
420  XML_IO_EBADMSG, /* 1504 */
421  XML_IO_EBUSY, /* 1505 */
422  XML_IO_ECANCELED, /* 1506 */
423  XML_IO_ECHILD, /* 1507 */
424  XML_IO_EDEADLK, /* 1508 */
425  XML_IO_EDOM, /* 1509 */
426  XML_IO_EEXIST, /* 1510 */
427  XML_IO_EFAULT, /* 1511 */
428  XML_IO_EFBIG, /* 1512 */
429  XML_IO_EINPROGRESS, /* 1513 */
430  XML_IO_EINTR, /* 1514 */
431  XML_IO_EINVAL, /* 1515 */
432  XML_IO_EIO, /* 1516 */
433  XML_IO_EISDIR, /* 1517 */
434  XML_IO_EMFILE, /* 1518 */
435  XML_IO_EMLINK, /* 1519 */
436  XML_IO_EMSGSIZE, /* 1520 */
438  XML_IO_ENFILE, /* 1522 */
439  XML_IO_ENODEV, /* 1523 */
440  XML_IO_ENOENT, /* 1524 */
441  XML_IO_ENOEXEC, /* 1525 */
442  XML_IO_ENOLCK, /* 1526 */
443  XML_IO_ENOMEM, /* 1527 */
444  XML_IO_ENOSPC, /* 1528 */
445  XML_IO_ENOSYS, /* 1529 */
446  XML_IO_ENOTDIR, /* 1530 */
447  XML_IO_ENOTEMPTY, /* 1531 */
448  XML_IO_ENOTSUP, /* 1532 */
449  XML_IO_ENOTTY, /* 1533 */
450  XML_IO_ENXIO, /* 1534 */
451  XML_IO_EPERM, /* 1535 */
452  XML_IO_EPIPE, /* 1536 */
453  XML_IO_ERANGE, /* 1537 */
454  XML_IO_EROFS, /* 1538 */
455  XML_IO_ESPIPE, /* 1539 */
456  XML_IO_ESRCH, /* 1540 */
457  XML_IO_ETIMEDOUT, /* 1541 */
458  XML_IO_EXDEV, /* 1542 */
460  XML_IO_ENCODER, /* 1544 */
461  XML_IO_FLUSH, /* 1545 */
462  XML_IO_WRITE, /* 1546 */
463  XML_IO_NO_INPUT, /* 1547 */
464  XML_IO_BUFFER_FULL, /* 1548 */
465  XML_IO_LOAD_ERROR, /* 1549 */
466  XML_IO_ENOTSOCK, /* 1550 */
467  XML_IO_EISCONN, /* 1551 */
469  XML_IO_ENETUNREACH, /* 1553 */
470  XML_IO_EADDRINUSE, /* 1554 */
471  XML_IO_EALREADY, /* 1555 */
556  XML_SCHEMAP_NOROOT, /* 1759 */
603  XML_SCHEMAV_NOTYPE, /* 1806 */
619  XML_SCHEMAV_VALUE, /* 1822 */
620  XML_SCHEMAV_FACET, /* 1823 */
671  XML_SCHEMAV_CVC_AU, /* 1874 */
676  XML_SCHEMAV_MISC, /* 1879 */
689  XML_FTP_ACCNT, /* 2002 */
690  XML_FTP_URL_SYNTAX, /* 2003 */
692  XML_HTTP_USE_IP, /* 2021 */
751  XML_SCHEMAP_NO_XSI, /* 3057 */
763  XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */
764  XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */
786  XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */
788  XML_MODULE_OPEN = 4900, /* 4900 */
789  XML_MODULE_CLOSE, /* 4901 */
796  XML_CHECK_FOUND_PI, /* 5006 */
804  XML_CHECK_NO_DOC, /* 5014 */
805  XML_CHECK_NO_NAME, /* 5015 */
806  XML_CHECK_NO_ELEM, /* 5016 */
808  XML_CHECK_NO_PREV, /* 5018 */
810  XML_CHECK_NO_NEXT, /* 5020 */
812  XML_CHECK_NOT_DTD, /* 5022 */
813  XML_CHECK_NOT_ATTR, /* 5023 */
818  XML_CHECK_NO_HREF, /* 5028 */
820  XML_CHECK_NS_SCOPE, /* 5030 */
822  XML_CHECK_NOT_UTF8, /* 5032 */
823  XML_CHECK_NO_DICT, /* 5033 */
832  XML_I18N_NO_OUTPUT, /* 6004 */
835 
845 typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx,
846  const char *msg,
856 typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
857 
858 /*
859  * Use the following function to reset the two global variables
860  * xmlGenericError and xmlGenericErrorContext.
861  */
862 XMLPUBFUN void XMLCALL
863  xmlSetGenericErrorFunc (void *ctx,
864  xmlGenericErrorFunc handler);
865 XMLPUBFUN void XMLCALL
866  initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
867 
868 XMLPUBFUN void XMLCALL
869  xmlSetStructuredErrorFunc (void *ctx,
870  xmlStructuredErrorFunc handler);
871 /*
872  * Default message routines used by SAX and Valid context for error
873  * and warning reporting.
874  */
875 XMLPUBFUN void XMLCDECL
876  xmlParserError (void *ctx,
877  const char *msg,
878  ...) LIBXML_ATTR_FORMAT(2,3);
879 XMLPUBFUN void XMLCDECL
880  xmlParserWarning (void *ctx,
881  const char *msg,
882  ...) LIBXML_ATTR_FORMAT(2,3);
883 XMLPUBFUN void XMLCDECL
884  xmlParserValidityError (void *ctx,
885  const char *msg,
886  ...) LIBXML_ATTR_FORMAT(2,3);
887 XMLPUBFUN void XMLCDECL
888  xmlParserValidityWarning (void *ctx,
889  const char *msg,
890  ...) LIBXML_ATTR_FORMAT(2,3);
891 XMLPUBFUN void XMLCALL
893 XMLPUBFUN void XMLCALL
895 
896 /*
897  * Extended error information routines
898  */
899 XMLPUBFUN xmlErrorPtr XMLCALL
900  xmlGetLastError (void);
901 XMLPUBFUN void XMLCALL
902  xmlResetLastError (void);
903 XMLPUBFUN xmlErrorPtr XMLCALL
904  xmlCtxtGetLastError (void *ctx);
905 XMLPUBFUN void XMLCALL
906  xmlCtxtResetLastError (void *ctx);
907 XMLPUBFUN void XMLCALL
908  xmlResetError (xmlErrorPtr err);
909 XMLPUBFUN int XMLCALL
910  xmlCopyError (xmlErrorPtr from,
911  xmlErrorPtr to);
912 
913 #ifdef IN_LIBXML
914 /*
915  * Internal callback reporting routine
916  */
917 XMLPUBFUN void XMLCALL
918  __xmlRaiseError (xmlStructuredErrorFunc schannel,
919  xmlGenericErrorFunc channel,
920  void *data,
921  void *ctx,
922  void *node,
923  int domain,
924  int code,
926  const char *file,
927  int line,
928  const char *str1,
929  const char *str2,
930  const char *str3,
931  int int1,
932  int col,
933  const char *msg,
934  ...) LIBXML_ATTR_FORMAT(16,17);
935 XMLPUBFUN void XMLCALL
936  __xmlSimpleError (int domain,
937  int code,
938  xmlNodePtr node,
939  const char *msg,
940  const char *extra) LIBXML_ATTR_FORMAT(4,0);
941 #endif
942 #ifdef __cplusplus
943 }
944 #endif
945 #endif /* __XML_ERROR_H__ */
Definition: graphics.c:170
GLint level
Definition: gl.h:1546
int line
Definition: xmlerror.h:84
char * file
Definition: xmlerror.h:83
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCALL xmlParserPrintFileInfo(xmlParserInputPtr input)
Definition: error.c:153
const char LIBXML_ATTR_FORMAT(2, 3)
Definition: xmlerror.h:847
XMLPUBFUN void XMLCALL xmlCtxtResetLastError(void *ctx)
xmlErrorLevel
Definition: xmlerror.h:24
#define XMLPUBFUN
Definition: xmlexports.h:30
XMLPUBFUN void XMLCALL xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler)
Definition: error.c:134
void * node
Definition: xmlerror.h:91
int int1
Definition: xmlerror.h:88
int int int * err
Definition: fci.h:172
typedef void(XMLCDECL *xmlGenericErrorFunc)(void *ctx
char * message
Definition: xmlerror.h:81
Definition: parser.c:48
int int2
Definition: xmlerror.h:89
XMLPUBFUN int XMLCALL xmlCopyError(xmlErrorPtr from, xmlErrorPtr to)
xmlErrorDomain
Definition: xmlerror.h:36
Definition: id3.c:18
xmlParserErrors
Definition: xmlerror.h:99
XMLPUBFUN void XMLCDECL xmlParserError(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
XMLPUBFUN void XMLCALL initGenericErrorDefaultFunc(xmlGenericErrorFunc *handler)
Definition: error.c:90
XMLPUBFUN void XMLCALL xmlResetLastError(void)
char * str2
Definition: xmlerror.h:86
XMLPUBFUN void XMLCALL xmlParserPrintFileContext(xmlParserInputPtr input)
Definition: error.c:230
xmlErrorPtr error
Definition: xmlerror.h:856
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * ctxt
Definition: xmlerror.h:90
Definition: tree.h:489
xmlErrorLevel level
Definition: xmlerror.h:82
XMLPUBFUN void XMLCALL xmlResetError(xmlErrorPtr err)
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserValidityWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
char * str3
Definition: xmlerror.h:87
GLenum GLenum GLenum input
Definition: glext.h:9031
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
xmlError * xmlErrorPtr
Definition: xmlerror.h:77
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7782
#define XMLCDECL
Definition: xmlexports.h:49
static BYTE int1[]
Definition: cert.c:3154
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserValidityError(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
int code
Definition: xmlerror.h:80
#define XMLCALL
#define const
Definition: zconf.h:230
XMLPUBFUN void XMLCALL xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler)
Definition: error.c:113
CardRegion * from
Definition: spigame.cpp:19
const char * msg
Definition: xmlerror.h:846
int domain
Definition: xmlerror.h:79
XMLPUBFUN xmlErrorPtr XMLCALL xmlCtxtGetLastError(void *ctx)
XMLPUBFUN xmlErrorPtr XMLCALL xmlGetLastError(void)
char * str1
Definition: xmlerror.h:85
Definition: fci.c:126