1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_SIMPLEXML_H
22 #define PHP_SIMPLEXML_H
23
24 extern zend_module_entry simplexml_module_entry;
25 #define phpext_simplexml_ptr &simplexml_module_entry
26
27 #include "php_version.h"
28 #define PHP_SIMPLEXML_VERSION PHP_VERSION
29
30 #ifdef ZTS
31 #include "TSRM.h"
32 #endif
33
34 #include "ext/libxml/php_libxml.h"
35 #include <libxml/parser.h>
36 #include <libxml/parserInternals.h>
37 #include <libxml/tree.h>
38 #include <libxml/uri.h>
39 #include <libxml/xmlerror.h>
40 #include <libxml/xinclude.h>
41 #include <libxml/xpath.h>
42 #include <libxml/xpathInternals.h>
43 #include <libxml/xpointer.h>
44 #include <libxml/xmlschemas.h>
45
46 PHP_MINIT_FUNCTION(simplexml);
47 PHP_MSHUTDOWN_FUNCTION(simplexml);
48 #ifdef HAVE_SPL
49 PHP_RINIT_FUNCTION(simplexml);
50 #endif
51 PHP_MINFO_FUNCTION(simplexml);
52
53 typedef enum {
54 SXE_ITER_NONE = 0,
55 SXE_ITER_ELEMENT = 1,
56 SXE_ITER_CHILD = 2,
57 SXE_ITER_ATTRLIST = 3
58 } SXE_ITER;
59
60 typedef struct {
61 php_libxml_node_ptr *node;
62 php_libxml_ref_obj *document;
63 HashTable *properties;
64 xmlXPathContextPtr xpath;
65 struct {
66 xmlChar *name;
67 xmlChar *nsprefix;
68 int isprefix;
69 SXE_ITER type;
70 zval data;
71 } iter;
72 zval tmp;
73 zend_function *fptr_count;
74 zend_object zo;
75 } php_sxe_object;
76
77 #ifdef ZTS
78 #define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v)
79 #else
80 #define SIMPLEXML_G(v) (simplexml_globals.v)
81 #endif
82
83 #ifdef PHP_WIN32
84 # ifdef PHP_SIMPLEXML_EXPORTS
85 # define PHP_SXE_API __declspec(dllexport)
86 # else
87 # define PHP_SXE_API __declspec(dllimport)
88 # endif
89 #else
90 # define PHP_SXE_API ZEND_API
91 #endif
92
93 PHP_SXE_API zend_class_entry *sxe_get_element_class_entry();
94
95 #endif
96
97
98
99
100
101
102
103
104
105