xref: /php-src/ext/dom/domexception.h (revision 88da9149)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Authors: Christian Stocker <chregu@php.net>                          |
14    |          Rob Richards <rrichards@php.net>                            |
15    +----------------------------------------------------------------------+
16 */
17 
18 #ifndef DOM_EXCEPTION_H
19 #define DOM_EXCEPTION_H
20 
21 /* domexception errors */
22 typedef enum {
23 /* PHP_ERR is non-spec code for PHP errors: */
24 	PHP_ERR                        = 0,
25 	INDEX_SIZE_ERR                 = 1,
26 	DOMSTRING_SIZE_ERR             = 2,
27 	HIERARCHY_REQUEST_ERR          = 3,
28 	WRONG_DOCUMENT_ERR             = 4,
29 	INVALID_CHARACTER_ERR          = 5,
30 	NO_DATA_ALLOWED_ERR            = 6,
31 	NO_MODIFICATION_ALLOWED_ERR    = 7,
32 	NOT_FOUND_ERR                  = 8,
33 	NOT_SUPPORTED_ERR              = 9,
34 	INUSE_ATTRIBUTE_ERR            = 10,
35 /* Introduced in DOM Level 2: */
36 	INVALID_STATE_ERR              = 11,
37 /* Introduced in DOM Level 2: */
38 	SYNTAX_ERR                     = 12,
39 /* Introduced in DOM Level 2: */
40 	INVALID_MODIFICATION_ERR       = 13,
41 /* Introduced in DOM Level 2: */
42 	NAMESPACE_ERR                  = 14,
43 /* Introduced in DOM Level 2: */
44 	INVALID_ACCESS_ERR             = 15,
45 /* Introduced in DOM Level 3: */
46 	VALIDATION_ERR                 = 16
47 } dom_exception_code;
48 
49 void php_dom_throw_error(dom_exception_code error_code, bool strict_error);
50 void php_dom_throw_error_with_message(dom_exception_code error_code, const char *error_message, bool strict_error);
51 
52 #endif /* DOM_EXCEPTION_H */
53