summaryrefslogtreecommitdiff
path: root/ext/xml
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xml')
-rw-r--r--ext/xml/compat.c2
-rw-r--r--ext/xml/package.xml74
-rw-r--r--ext/xml/xml.c25
-rw-r--r--ext/xml/xml.mak172
4 files changed, 12 insertions, 261 deletions
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index ef83485722..2018dfa126 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -401,7 +401,7 @@ _get_entity(void *user, const xmlChar *name)
return ret;
}
-static xmlSAXHandler
+static const xmlSAXHandler
php_xml_compat_handlers = {
NULL, /* internalSubset */
NULL, /* isStandalone */
diff --git a/ext/xml/package.xml b/ext/xml/package.xml
deleted file mode 100644
index ae5e6450d8..0000000000
--- a/ext/xml/package.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>xml</name>
- <summary>XML Parsing functions</summary>
- <maintainers>
- <maintainer>
- <user>ssb</user>
- <name>Stig Bakken</name>
- <email>ssb@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>thies</user>
- <name>Thies Arntzen</name>
- <email>thies@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This extension lets you create XML parsers and then define
-handlers for different XML events. Each XML parser also has
-a few parameters you can adjust.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-curl" default="autodetect" prompt="path to curl installation?"/>
- </configureoptions>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.mw32"/>
- <file role="src" name="xml.mak"/>
- <file role="src" name="compat.c"/>
- <file role="src" name="expat_compat.h"/>
- <file role="src" name="php_xml.h"/>
- <file role="src" name="xml.c"/>
- <file role="test" name="tests/.cvsignore"/>
- <file role="test" name="tests/inc.ent"/>
- <file role="test" name="tests/skipif.inc"/>
- <file role="test" name="tests/xml001.phpt"/>
- <file role="test" name="tests/xml002.phpt"/>
- <file role="test" name="tests/xml003.phpt"/>
- <file role="test" name="tests/xml004.phpt"/>
- <file role="test" name="tests/xml006.phpt"/>
- <file role="test" name="tests/xml007.phpt"/>
- <file role="test" name="tests/xmltest.xml"/>
- <file role="test" name="tests/bug25666.phpt"/>
- <file role="test" name="tests/bug26528.phpt"/>
- <file role="test" name="tests/bug26614.phpt"/>
- <file role="test" name="tests/xml009.phpt"/>
- <file role="test" name="tests/xml010.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 7f1bb30571..e16f3f4bbb 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -70,7 +70,7 @@ ZEND_GET_MODULE(xml)
/* }}} */
-#define SKIP_TAGSTART(str) ((str) + (parser->toffset > strlen(str) ? strlen(str) : parser->toffset))
+#define SKIP_TAGSTART(str) ((str) + (parser->toffset > (int)strlen(str) ? strlen(str) : parser->toffset))
/* {{{ function prototypes */
@@ -212,7 +212,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_xml_parser_get_option, 0, 0, 2)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
-const zend_function_entry xml_functions[] = {
+static const zend_function_entry xml_functions[] = {
PHP_FE(xml_parser_create, arginfo_xml_parser_create)
PHP_FE(xml_parser_create_ns, arginfo_xml_parser_create_ns)
PHP_FE(xml_set_object, arginfo_xml_set_object)
@@ -270,7 +270,7 @@ zend_module_entry xml_module_entry = {
/* All the encoding functions are set to NULL right now, since all
* the encoding is currently done internally by expat/xmltok.
*/
-xml_encoding xml_encodings[] = {
+const xml_encoding xml_encodings[] = {
{ (XML_Char *)"ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 },
{ (XML_Char *)"US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii },
{ (XML_Char *)"UTF-8", NULL, NULL },
@@ -537,9 +537,9 @@ inline static char xml_decode_us_ascii(unsigned short c)
/* }}} */
/* {{{ xml_get_encoding() */
-static xml_encoding *xml_get_encoding(const XML_Char *name)
+static const xml_encoding *xml_get_encoding(const XML_Char *name)
{
- xml_encoding *enc = &xml_encodings[0];
+ const xml_encoding *enc = &xml_encodings[0];
while (enc && enc->name) {
if (strcasecmp((char *)name, (char *)enc->name) == 0) {
@@ -558,7 +558,7 @@ PHP_XML_API zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Ch
zend_string *str;
unsigned int c;
unsigned short (*encoder)(unsigned char) = NULL;
- xml_encoding *enc = xml_get_encoding(encoding);
+ const xml_encoding *enc = xml_get_encoding(encoding);
if (enc) {
encoder = enc->encoding_function;
@@ -608,7 +608,7 @@ PHP_XML_API zend_string *xml_utf8_decode(const XML_Char *s, size_t len, const XM
size_t pos = 0;
unsigned int c;
char (*decoder)(unsigned short) = NULL;
- xml_encoding *enc = xml_get_encoding(encoding);
+ const xml_encoding *enc = xml_get_encoding(encoding);
zend_string *str;
if (enc) {
@@ -1589,23 +1589,20 @@ PHP_FUNCTION(xml_parser_set_option)
switch (opt) {
case PHP_XML_OPTION_CASE_FOLDING:
- convert_to_long_ex(val);
- parser->case_folding = Z_LVAL_P(val);
+ parser->case_folding = zval_get_long(val);
break;
case PHP_XML_OPTION_SKIP_TAGSTART:
- convert_to_long_ex(val);
- parser->toffset = Z_LVAL_P(val);
+ parser->toffset = zval_get_long(val);
if (parser->toffset < 0) {
php_error_docref(NULL, E_NOTICE, "tagstart ignored, because it is out of range");
parser->toffset = 0;
}
break;
case PHP_XML_OPTION_SKIP_WHITE:
- convert_to_long_ex(val);
- parser->skipwhite = Z_LVAL_P(val);
+ parser->skipwhite = zval_get_long(val);
break;
case PHP_XML_OPTION_TARGET_ENCODING: {
- xml_encoding *enc;
+ const xml_encoding *enc;
convert_to_string_ex(val);
enc = xml_get_encoding((XML_Char*)Z_STRVAL_P(val));
if (enc == NULL) {
diff --git a/ext/xml/xml.mak b/ext/xml/xml.mak
deleted file mode 100644
index b712dea1d6..0000000000
--- a/ext/xml/xml.mak
+++ /dev/null
@@ -1,172 +0,0 @@
-# Temporarily here -- later may go into some batch file
-# which will set this as an environment variable
-PROJECT_ROOT = ..\..
-
-# Module details
-MODULE_NAME = php_xml
-MODULE_DESC = "PHP 7 - XML Extension"
-VMAJ = 3
-VMIN = 0
-VREV = 0
-
-#include the common settings
-include $(PROJECT_ROOT)/netware/common.mif
-
-# Extensions of all input and output files
-.SUFFIXES:
-.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d
-
-# Source files
-C_SRC = xml.c \
- start.c
-
-CPP_SRC_NODIR = $(notdir $(CPP_SRC))
-C_SRC_NODIR = $(notdir $(C_SRC))
-SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))
-
-# Library files
-LIBRARY =
-
-# Destination directories and files
-OBJ_DIR = $(BUILD)
-FINAL_DIR = $(BUILD)
-MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
-OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj))
-DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d))
-
-# Binary file
-ifndef BINARY
- BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
-endif
-
-# Compile flags
-C_FLAGS += -c -maxerrors 25 -msgstyle gcc
-C_FLAGS += -wchar_t on -bool on
-C_FLAGS += -processor Pentium
-C_FLAGS += -nostdinc -nosyspath
-C_FLAGS += -relax_pointers # To remove type-casting errors
-C_FLAGS += -DNETWARE -DZTS
-C_FLAGS += -DNEW_LIBC
-C_FLAGS += -DCOMPILE_DL_XML -DHAVE_LIBEXPAT=1
-C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main
-C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware
-C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm
-C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes)
-C_FLAGS += -I$(EXPAT_DIR)/include
-
-ifndef STACK_SIZE
-STACK_SIZE=8192
-endif
-
-# Extra stuff based on debug / release builds
-ifeq '$(BUILD)' 'debug'
- SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
- C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON
- C_FLAGS += -exc cw -DZEND_DEBUG=1
- LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE)
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
-else
- C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off
- C_FLAGS += -opt intrinsics
- C_FLAGS += -opt level=4 -DZEND_DEBUG=0
- LD_FLAGS += -sym off
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
-endif
-
-# Dependencies
-MODULE = LibC \
- expatlbc \
- phplib
-IMPORT = @$(SDK_DIR)/imports/libc.imp \
- @$(SDK_DIR)/imports/ws2nlm.imp \
- @$(MPK_DIR)/import/mpkOrg.imp \
- @$(EXPAT_DIR)/imports/expatlbc.imp \
- @$(PROJECT_ROOT)/netware/phplib.imp
-EXPORT = ($(MODULE_NAME)) get_module
-API = OutputToScreen
-
-
-# Virtual paths
-vpath %.cpp .
-vpath %.c . ..\..\netware
-vpath %.obj $(OBJ_DIR)
-
-
-all: prebuild project
-
-.PHONY: all
-
-prebuild:
- @if not exist $(OBJ_DIR) md $(OBJ_DIR)
-
-project: $(BINARY)
- @echo Build complete.
-
-$(OBJ_DIR)/%.d: %.cpp
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.d: %.c
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.cpp
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.c
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-
-$(BINARY): $(OBJECTS)
- @echo Import $(IMPORT) > $(basename $@).def
-ifdef API
- @echo Import $(API) >> $(basename $@).def
-endif
- @echo Module $(MODULE) >> $(basename $@).def
-ifdef EXPORT
- @echo Export $(EXPORT) >> $(basename $@).def
-endif
- @echo AutoUnload >> $(basename $@).def
-ifeq '$(BUILD)' 'debug'
- @echo Debug >> $(basename $@).def
-endif
- @echo Flag_On 0x00000008 >> $(basename $@).def
- @echo Start _LibCPrelude >> $(basename $@).def
- @echo Exit _LibCPostlude >> $(basename $@).def
-
- $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
- @echo xdcdata $(basename $@).xdc >> $(basename $@).def
-
- @echo Linking $@...
- @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
- @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link
-
- @$(LINK) @$(basename $@).link
-
-
-.PHONY: clean
-clean: cleanobj cleanbin
-
-.PHONY: cleand
-cleand:
- @echo Deleting all dependency files...
- -@del "$(OBJ_DIR)\*.d"
-
-.PHONY: cleanobj
-cleanobj:
- @echo Deleting all object files...
- -@del "$(OBJ_DIR)\*.obj"
-
-.PHONY: cleanbin
-cleanbin:
- @echo Deleting binary files...
- -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
- @echo Deleting MAP, DEF files, etc....
- -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
-ifeq '$(BUILD)' 'debug'
- -@del $(FINAL_DIR)\$(MODULE_NAME).sym
-endif