summaryrefslogtreecommitdiff
path: root/ext/xml/php_xml.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xml/php_xml.h')
-rw-r--r--ext/xml/php_xml.h53
1 files changed, 28 insertions, 25 deletions
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index fdce3a4cf0..8f92eefe1d 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2015 The PHP Group |
+----------------------------------------------------------------------+
@@ -26,6 +26,10 @@
#ifdef HAVE_XML
extern zend_module_entry xml_module_entry;
#define xml_module_ptr &xml_module_entry
+
+#include "php_version.h"
+#define PHP_XML_VERSION PHP_VERSION
+
#else
#define xml_module_ptr NULL
#endif
@@ -34,7 +38,6 @@ extern zend_module_entry xml_module_entry;
#include "ext/xml/expat_compat.h"
-
#ifdef XML_UNICODE
#error "UTF-16 Unicode support not implemented!"
#endif
@@ -44,22 +47,22 @@ ZEND_BEGIN_MODULE_GLOBALS(xml)
ZEND_END_MODULE_GLOBALS(xml)
typedef struct {
- int index;
int case_folding;
XML_Parser parser;
XML_Char *target_encoding;
- zval *startElementHandler;
- zval *endElementHandler;
- zval *characterDataHandler;
- zval *processingInstructionHandler;
- zval *defaultHandler;
- zval *unparsedEntityDeclHandler;
- zval *notationDeclHandler;
- zval *externalEntityRefHandler;
- zval *unknownEncodingHandler;
- zval *startNamespaceDeclHandler;
- zval *endNamespaceDeclHandler;
+ zval index;
+ zval startElementHandler;
+ zval endElementHandler;
+ zval characterDataHandler;
+ zval processingInstructionHandler;
+ zval defaultHandler;
+ zval unparsedEntityDeclHandler;
+ zval notationDeclHandler;
+ zval externalEntityRefHandler;
+ zval unknownEncodingHandler;
+ zval startNamespaceDeclHandler;
+ zval endNamespaceDeclHandler;
zend_function *startElementPtr;
zend_function *endElementPtr;
@@ -73,14 +76,14 @@ typedef struct {
zend_function *startNamespaceDeclPtr;
zend_function *endNamespaceDeclPtr;
- zval *object;
+ zval object;
- zval *data;
- zval *info;
+ zval data;
+ zval info;
int level;
int toffset;
int curtag;
- zval **ctag;
+ zval *ctag;
char **ltags;
int lastwasopen;
int skipwhite;
@@ -133,18 +136,18 @@ PHP_FUNCTION(utf8_encode);
PHP_FUNCTION(utf8_decode);
PHP_FUNCTION(xml_parse_into_struct);
-PHPAPI char *_xml_zval_strdup(zval *val);
-PHPAPI char *xml_utf8_decode(const XML_Char *, int, int *, const XML_Char *);
-PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding);
+PHP_XML_API char *_xml_zval_strdup(zval *);
+PHP_XML_API zend_string *xml_utf8_decode(const XML_Char *, size_t, const XML_Char *);
+PHP_XML_API zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *);
#endif /* HAVE_LIBEXPAT */
#define phpext_xml_ptr xml_module_ptr
-#ifdef ZTS
-#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
-#else
-#define XML(v) (xml_globals.v)
+#define XML(v) ZEND_MODULE_GLOBALS_ACCESSOR(xml, v)
+
+#if defined(ZTS) && defined(COMPILE_DL_XML)
+ZEND_TSRMLS_CACHE_EXTERN();
#endif
#endif /* PHP_XML_H */