ReactOS  0.4.15-dev-5496-g599ba9c
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 */
215  XML_NS_ERR_QNAME, /* 202 */
217  XML_NS_ERR_EMPTY, /* 204 */
218  XML_NS_ERR_COLON, /* 205 */
231  XML_DTD_ID_FIXED, /* 512 */
233  XML_DTD_ID_SUBSET, /* 514 */
240  XML_DTD_NO_DOC, /* 521 */
241  XML_DTD_NO_DTD, /* 522 */
243  XML_DTD_NO_PREFIX, /* 524 */
244  XML_DTD_NO_ROOT, /* 525 */
247  XML_DTD_NOT_EMPTY, /* 528 */
250  XML_DTD_ROOT_NAME, /* 531 */
260  XML_DTD_DUP_TOKEN, /* 541 */
286  XML_RNGP_EMPTY, /* 1022 */
363  XML_RNGP_REF_CYCLE, /* 1099 */
386  XML_RNGP_XML_NS, /* 1122 */
412  XML_TREE_NOT_UTF8, /* 1303 */
419  XML_IO_EACCES, /* 1501 */
420  XML_IO_EAGAIN, /* 1502 */
421  XML_IO_EBADF, /* 1503 */
422  XML_IO_EBADMSG, /* 1504 */
423  XML_IO_EBUSY, /* 1505 */
424  XML_IO_ECANCELED, /* 1506 */
425  XML_IO_ECHILD, /* 1507 */
426  XML_IO_EDEADLK, /* 1508 */
427  XML_IO_EDOM, /* 1509 */
428  XML_IO_EEXIST, /* 1510 */
429  XML_IO_EFAULT, /* 1511 */
430  XML_IO_EFBIG, /* 1512 */
431  XML_IO_EINPROGRESS, /* 1513 */
432  XML_IO_EINTR, /* 1514 */
433  XML_IO_EINVAL, /* 1515 */
434  XML_IO_EIO, /* 1516 */
435  XML_IO_EISDIR, /* 1517 */
436  XML_IO_EMFILE, /* 1518 */
437  XML_IO_EMLINK, /* 1519 */
438  XML_IO_EMSGSIZE, /* 1520 */
440  XML_IO_ENFILE, /* 1522 */
441  XML_IO_ENODEV, /* 1523 */
442  XML_IO_ENOENT, /* 1524 */
443  XML_IO_ENOEXEC, /* 1525 */
444  XML_IO_ENOLCK, /* 1526 */
445  XML_IO_ENOMEM, /* 1527 */
446  XML_IO_ENOSPC, /* 1528 */
447  XML_IO_ENOSYS, /* 1529 */
448  XML_IO_ENOTDIR, /* 1530 */
449  XML_IO_ENOTEMPTY, /* 1531 */
450  XML_IO_ENOTSUP, /* 1532 */
451  XML_IO_ENOTTY, /* 1533 */
452  XML_IO_ENXIO, /* 1534 */
453  XML_IO_EPERM, /* 1535 */
454  XML_IO_EPIPE, /* 1536 */
455  XML_IO_ERANGE, /* 1537 */
456  XML_IO_EROFS, /* 1538 */
457  XML_IO_ESPIPE, /* 1539 */
458  XML_IO_ESRCH, /* 1540 */
459  XML_IO_ETIMEDOUT, /* 1541 */
460  XML_IO_EXDEV, /* 1542 */
462  XML_IO_ENCODER, /* 1544 */
463  XML_IO_FLUSH, /* 1545 */
464  XML_IO_WRITE, /* 1546 */
465  XML_IO_NO_INPUT, /* 1547 */
466  XML_IO_BUFFER_FULL, /* 1548 */
467  XML_IO_LOAD_ERROR, /* 1549 */
468  XML_IO_ENOTSOCK, /* 1550 */
469  XML_IO_EISCONN, /* 1551 */
471  XML_IO_ENETUNREACH, /* 1553 */
472  XML_IO_EADDRINUSE, /* 1554 */
473  XML_IO_EALREADY, /* 1555 */
558  XML_SCHEMAP_NOROOT, /* 1759 */
605  XML_SCHEMAV_NOTYPE, /* 1806 */
621  XML_SCHEMAV_VALUE, /* 1822 */
622  XML_SCHEMAV_FACET, /* 1823 */
673  XML_SCHEMAV_CVC_AU, /* 1874 */
678  XML_SCHEMAV_MISC, /* 1879 */
691  XML_FTP_ACCNT, /* 2002 */
692  XML_FTP_URL_SYNTAX, /* 2003 */
694  XML_HTTP_USE_IP, /* 2021 */
753  XML_SCHEMAP_NO_XSI, /* 3057 */
765  XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */
766  XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */
788  XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */
790  XML_MODULE_OPEN = 4900, /* 4900 */
791  XML_MODULE_CLOSE, /* 4901 */
798  XML_CHECK_FOUND_PI, /* 5006 */
806  XML_CHECK_NO_DOC, /* 5014 */
807  XML_CHECK_NO_NAME, /* 5015 */
808  XML_CHECK_NO_ELEM, /* 5016 */
810  XML_CHECK_NO_PREV, /* 5018 */
812  XML_CHECK_NO_NEXT, /* 5020 */
814  XML_CHECK_NOT_DTD, /* 5022 */
815  XML_CHECK_NOT_ATTR, /* 5023 */
820  XML_CHECK_NO_HREF, /* 5028 */
822  XML_CHECK_NS_SCOPE, /* 5030 */
824  XML_CHECK_NOT_UTF8, /* 5032 */
825  XML_CHECK_NO_DICT, /* 5033 */
834  XML_I18N_NO_OUTPUT, /* 6004 */
837 
848  const char *msg,
849  ...) LIBXML_ATTR_FORMAT(2,3);
858 typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
859 
860 /*
861  * Use the following function to reset the two global variables
862  * xmlGenericError and xmlGenericErrorContext.
863  */
864 XMLPUBFUN void XMLCALL
867 XMLPUBFUN void XMLCALL
869 
870 XMLPUBFUN void XMLCALL
872  xmlStructuredErrorFunc handler);
873 /*
874  * Default message routines used by SAX and Valid context for error
875  * and warning reporting.
876  */
877 XMLPUBFUN void XMLCDECL
878  xmlParserError (void *ctx,
879  const char *msg,
880  ...) LIBXML_ATTR_FORMAT(2,3);
881 XMLPUBFUN void XMLCDECL
882  xmlParserWarning (void *ctx,
883  const char *msg,
884  ...) LIBXML_ATTR_FORMAT(2,3);
885 XMLPUBFUN void XMLCDECL
887  const char *msg,
888  ...) LIBXML_ATTR_FORMAT(2,3);
889 XMLPUBFUN void XMLCDECL
891  const char *msg,
892  ...) LIBXML_ATTR_FORMAT(2,3);
893 XMLPUBFUN void XMLCALL
895 XMLPUBFUN void XMLCALL
897 
898 /*
899  * Extended error information routines
900  */
902  xmlGetLastError (void);
903 XMLPUBFUN void XMLCALL
904  xmlResetLastError (void);
906  xmlCtxtGetLastError (void *ctx);
907 XMLPUBFUN void XMLCALL
908  xmlCtxtResetLastError (void *ctx);
909 XMLPUBFUN void XMLCALL
911 XMLPUBFUN int XMLCALL
913  xmlErrorPtr to);
914 
915 #ifdef IN_LIBXML
916 /*
917  * Internal callback reporting routine
918  */
919 XMLPUBFUN void XMLCALL
920  __xmlRaiseError (xmlStructuredErrorFunc schannel,
921  xmlGenericErrorFunc channel,
922  void *data,
923  void *ctx,
924  void *node,
925  int domain,
926  int code,
928  const char *file,
929  int line,
930  const char *str1,
931  const char *str2,
932  const char *str3,
933  int int1,
934  int col,
935  const char *msg,
936  ...) LIBXML_ATTR_FORMAT(16,17);
937 XMLPUBFUN void XMLCALL
938  __xmlSimpleError (int domain,
939  int code,
941  const char *msg,
942  const char *extra) LIBXML_ATTR_FORMAT(4,0);
943 #endif
944 #ifdef __cplusplus
945 }
946 #endif
947 #endif /* __XML_ERROR_H__ */
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
XMLPUBFUN void XMLCALL xmlCtxtResetLastError(void *ctx)
xmlErrorLevel
Definition: xmlerror.h:24
#define XMLPUBFUN
Definition: xmlexports.h:61
XMLPUBFUN void XMLCALL xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler)
Definition: error.c:134
void * node
Definition: xmlerror.h:91
int int1
Definition: xmlerror.h:88
Definition: cookie.c:41
char * message
Definition: xmlerror.h:81
Definition: parser.c:48
int int2
Definition: xmlerror.h:89
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:486
XMLPUBFUN int XMLCALL xmlCopyError(xmlErrorPtr from, xmlErrorPtr to)
xmlErrorDomain
Definition: xmlerror.h:36
Definition: id3.c:95
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
void(XMLCDECL *) typedef xmlErrorPt error)
Definition: xmlerror.h:858
XMLPUBFUN void XMLCALL xmlParserPrintFileContext(xmlParserInputPtr input)
Definition: error.c:230
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * ctxt
Definition: xmlerror.h:90
Definition: tree.h:489
#define err(...)
Definition: inflate.c:139
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
#define XMLCDECL
Definition: xmlexports.h:52
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
#define msg(x)
Definition: auth_time.c:54
int code
Definition: xmlerror.h:80
#define XMLCALL
void(XMLCDECL * xmlGenericErrorFunc)(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
Definition: xmlerror.h:847
#define const
Definition: zconf.h:230
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
XMLPUBFUN void XMLCALL xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler)
Definition: error.c:113
CardRegion * from
Definition: spigame.cpp:19
int domain
Definition: xmlerror.h:79
XMLPUBFUN xmlErrorPtr XMLCALL xmlCtxtGetLastError(void *ctx)
Definition: dlist.c:348
XMLPUBFUN xmlErrorPtr XMLCALL xmlGetLastError(void)
char * str1
Definition: xmlerror.h:85
Definition: fci.c:126
void(XMLCDECL *) typede void)(XMLCALL *xmlStructuredErrorFunc)(void *userData
Definition: xmlerror.h:858