xref: /PHP-7.2/ext/simplexml/php_simplexml.h (revision 7a7ec01a)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2018 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Author: Sterling Hughes <sterling@php.net>                           |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
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 PHP_MINFO_FUNCTION(simplexml);
49 
50 typedef enum {
51 	SXE_ITER_NONE     = 0,
52 	SXE_ITER_ELEMENT  = 1,
53 	SXE_ITER_CHILD    = 2,
54 	SXE_ITER_ATTRLIST = 3
55 } SXE_ITER;
56 
57 typedef struct {
58 	php_libxml_node_ptr *node;
59 	php_libxml_ref_obj *document;
60 	HashTable *properties;
61 	xmlXPathContextPtr xpath;
62 	struct {
63 		xmlChar               *name;
64 		xmlChar               *nsprefix;
65 		int                   isprefix;
66 		SXE_ITER              type;
67 		zval                  data;
68 	} iter;
69 	zval tmp;
70 	zend_function *fptr_count;
71 	zend_object zo;
72 } php_sxe_object;
73 
74 #ifdef ZTS
75 #define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v)
76 #else
77 #define SIMPLEXML_G(v) (simplexml_globals.v)
78 #endif
79 
80 #ifdef PHP_WIN32
81 #	ifdef PHP_SIMPLEXML_EXPORTS
82 #		define PHP_SXE_API __declspec(dllexport)
83 #	else
84 #		define PHP_SXE_API __declspec(dllimport)
85 #	endif
86 #else
87 #	define PHP_SXE_API ZEND_API
88 #endif
89 
90 PHP_SXE_API zend_class_entry *sxe_get_element_class_entry();
91 
92 #endif
93 
94 /*
95  * Local variables:
96  * tab-width: 4
97  * c-basic-offset: 4
98  * indent-tabs-mode: t
99  * End:
100  * vim600: fdm=marker
101  * vim: noet sw=4 ts=4
102  */
103