xref: /php-src/ext/dom/lexbor/lexbor/dom/exception.h (revision f0934090)
1 /*
2  * Copyright (C) 2018 Alexander Borisov
3  *
4  * Author: Alexander Borisov <borisov@lexbor.com>
5  */
6 
7 #ifndef LEXBOR_DOM_EXCEPTION_H
8 #define LEXBOR_DOM_EXCEPTION_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "lexbor/core/base.h"
15 
16 
17 typedef enum {
18     LXB_DOM_INDEX_SIZE_ERR = 0x00,
19     LXB_DOM_DOMSTRING_SIZE_ERR,
20     LXB_DOM_HIERARCHY_REQUEST_ERR,
21     LXB_DOM_WRONG_DOCUMENT_ERR,
22     LXB_DOM_INVALID_CHARACTER_ERR,
23     LXB_DOM_NO_DATA_ALLOWED_ERR,
24     LXB_DOM_NO_MODIFICATION_ALLOWED_ERR,
25     LXB_DOM_NOT_FOUND_ERR,
26     LXB_DOM_NOT_SUPPORTED_ERR,
27     LXB_DOM_INUSE_ATTRIBUTE_ERR,
28     LXB_DOM_INVALID_STATE_ERR,
29     LXB_DOM_SYNTAX_ERR,
30     LXB_DOM_INVALID_MODIFICATION_ERR,
31     LXB_DOM_NAMESPACE_ERR,
32     LXB_DOM_INVALID_ACCESS_ERR,
33     LXB_DOM_VALIDATION_ERR,
34     LXB_DOM_TYPE_MISMATCH_ERR,
35     LXB_DOM_SECURITY_ERR,
36     LXB_DOM_NETWORK_ERR,
37     LXB_DOM_ABORT_ERR,
38     LXB_DOM_URL_MISMATCH_ERR,
39     LXB_DOM_QUOTA_EXCEEDED_ERR,
40     LXB_DOM_TIMEOUT_ERR,
41     LXB_DOM_INVALID_NODE_TYPE_ERR,
42     LXB_DOM_DATA_CLONE_ERR
43 }
44 lxb_dom_exception_code_t;
45 
46 
47 /*
48  * Inline functions
49  */
50 lxb_inline void *
lxb_dom_exception_code_ref_set(lxb_dom_exception_code_t * var,lxb_dom_exception_code_t code)51 lxb_dom_exception_code_ref_set(lxb_dom_exception_code_t *var,
52                                lxb_dom_exception_code_t code)
53 {
54     if (var != NULL) {
55         *var = code;
56     }
57 
58     return NULL;
59 }
60 
61 /*
62  * No inline functions for ABI.
63  */
64 LXB_API void *
65 lxb_dom_exception_code_ref_set_noi(lxb_dom_exception_code_t *var,
66                                    lxb_dom_exception_code_t code);
67 
68 
69 #ifdef __cplusplus
70 } /* extern "C" */
71 #endif
72 
73 #endif /* LEXBOR_DOM_EXCEPTION_H */
74