1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 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 #ifndef PHP_SIMPLEXML_H 20 #define PHP_SIMPLEXML_H 21 22 extern zend_module_entry simplexml_module_entry; 23 #define phpext_simplexml_ptr &simplexml_module_entry 24 25 #include "php_version.h" 26 #define PHP_SIMPLEXML_VERSION PHP_VERSION 27 28 #ifdef ZTS 29 #include "TSRM.h" 30 #endif 31 32 #include "ext/libxml/php_libxml.h" 33 #include <libxml/parser.h> 34 #include <libxml/parserInternals.h> 35 #include <libxml/tree.h> 36 #include <libxml/uri.h> 37 #include <libxml/xmlerror.h> 38 #include <libxml/xinclude.h> 39 #include <libxml/xpath.h> 40 #include <libxml/xpathInternals.h> 41 #include <libxml/xpointer.h> 42 #include <libxml/xmlschemas.h> 43 44 PHP_MINIT_FUNCTION(simplexml); 45 PHP_MSHUTDOWN_FUNCTION(simplexml); 46 PHP_MINFO_FUNCTION(simplexml); 47 48 typedef enum { 49 SXE_ITER_NONE = 0, 50 SXE_ITER_ELEMENT = 1, 51 SXE_ITER_CHILD = 2, 52 SXE_ITER_ATTRLIST = 3 53 } SXE_ITER; 54 55 typedef struct { 56 php_libxml_node_ptr *node; 57 php_libxml_ref_obj *document; 58 HashTable *properties; 59 xmlXPathContextPtr xpath; 60 struct { 61 xmlChar *name; 62 xmlChar *nsprefix; 63 int isprefix; 64 SXE_ITER type; 65 zval data; 66 } iter; 67 zval tmp; 68 zend_function *fptr_count; 69 zend_object zo; 70 } php_sxe_object; 71 72 #ifdef PHP_WIN32 73 # ifdef PHP_SIMPLEXML_EXPORTS 74 # define PHP_SXE_API __declspec(dllexport) 75 # else 76 # define PHP_SXE_API __declspec(dllimport) 77 # endif 78 #else 79 # define PHP_SXE_API ZEND_API 80 #endif 81 82 PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(); 83 84 #endif 85