diff options
author | SVN Migration <svn@php.net> | 1999-07-23 14:14:44 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 1999-07-23 14:14:44 +0000 |
commit | 5cb21cbfef2dcdf31ac914920427d3d190c6ed26 (patch) | |
tree | a6ea5826ba1eda810e9580a335798c020dfaeb9a /ext/xml | |
parent | b1617d8ac3bad1ace92085194e24cff8cbdbaf31 (diff) | |
download | php-git-php-4.0b1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_4_0b1'.php-4.0b1
Diffstat (limited to 'ext/xml')
-rw-r--r-- | ext/xml/Makefile.am | 12 | ||||
-rw-r--r-- | ext/xml/config.m4 | 43 | ||||
-rw-r--r-- | ext/xml/php3_xml.h | 14 | ||||
-rw-r--r-- | ext/xml/xml.c | 75 |
4 files changed, 36 insertions, 108 deletions
diff --git a/ext/xml/Makefile.am b/ext/xml/Makefile.am index 9b6e9cdec4..c4f9f526f3 100644 --- a/ext/xml/Makefile.am +++ b/ext/xml/Makefile.am @@ -1,12 +1,6 @@ # $Id$ -phplibdir=$(libdir)/php - -SRC=xml.c -INCLUDES=@INCLUDES@ @XML_INCLUDE@ -I@top_srcdir@ -I@top_srcdir@/libzend +INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend noinst_LIBRARIES=libphpext_xml.a -phplib_LTLIBRARIES=libphpext_xml.la -libphpext_xml_a_SOURCES=$(SRC) -libphpext_xml_la_SOURCES=$(SRC) -libphpext_xml_la_LIBADD=@XML_LIBS@ -EXTRA_LIBS= +libphpext_xml_a_SOURCES=xml.c + diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 index 787ee3465d..c4b871107d 100644 --- a/ext/xml/config.m4 +++ b/ext/xml/config.m4 @@ -1,51 +1,24 @@ -# $Source$ -# $Id$ +dnl $Id$ AC_MSG_CHECKING(for XML support) AC_ARG_WITH(xml, [ --with-xml Include XML support],[ - case $withval in - shared) - shared=yes - withval=yes - ;; - shared,*) - shared=yes - withval=`echo $withval | sed -e 's/^shared,//'` - ;; - *) - shared=no - ;; - esac if test "$withval" != "no"; then - if test "$shared" = "yes"; then - AC_MSG_RESULT([yes (shared)]) - else - AC_MSG_RESULT([yes (static)]) - fi if test "$withval" = "yes"; then - test -d /usr/include/xmltok && XML_INCLUDE="-I/usr/include/xmltok" - test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml" - test -d /usr/local/include/xml && XML_INCLUDE="-I/usr/local/include/xml" - AC_CHECK_LIB(expat, main, XML_LIBS="-lexpat", XML_LIBS="-lxmlparse -lxmltok") + XML_LIBS="-lexpat" + XML_INCLUDE="" else XML_LIBS="-L$withval/lib -lexpat" - if test -d $withval/include/xml; then - XML_INCLUDE="-I$withval/include/xml" - else - XML_INCLUDE="-I$withval/include" - fi + XML_INCLUDE="-I$withval/include" fi AC_DEFINE(HAVE_LIBEXPAT, 1) - PHP_EXTENSION(xml, $shared) - if test "$shared" != "yes"; then - EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS" - fi + AC_MSG_RESULT(yes) + PHP_EXTENSION(xml) + EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS" + INCLUDES="$INCLUDES $XML_INCLUDE" else AC_MSG_RESULT(no) fi ],[ AC_MSG_RESULT(no) ]) -AC_SUBST(XML_LIBS) -AC_SUBST(XML_INCLUDE) diff --git a/ext/xml/php3_xml.h b/ext/xml/php3_xml.h index 5016848c8e..0c4c706d9d 100644 --- a/ext/xml/php3_xml.h +++ b/ext/xml/php3_xml.h @@ -29,13 +29,13 @@ /* $Id$ */ -#ifndef _PHP_XML_H -# define _PHP_XML_H +#if HAVE_LIBEXPAT +# ifndef _PHP_XML_H +# define _PHP_XML_H +# endif -# if HAVE_LIBEXPAT - -#include <xmltok.h> -#include <xmlparse.h> +#include <xml/xmltok.h> +#include <xml/xmlparse.h> #ifdef XML_UNICODE # error "UTF-16 Unicode support not implemented!" @@ -129,8 +129,6 @@ PHP_FUNCTION(xml_parse_into_struct); #define phpext_xml_ptr xml_module_ptr -# endif /* _PHP_XML_H */ - /* * Local variables: * tab-width: 4 diff --git a/ext/xml/xml.c b/ext/xml/xml.c index b270adc1ea..acfe5ccb05 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -18,12 +18,6 @@ /* $Id$ */ #define IS_EXT_MODULE - -/* boldly assume that if PIC is defined, we are being compiled dynamically */ -#ifdef PIC -# define COMPILE_DL 1 -#endif - #if COMPILE_DL # if PHP_31 # include "../phpdl.h" @@ -98,44 +92,27 @@ DLEXPORT php3_module_entry *get_module() { return &xml_module_entry; }; #if PHP_API_VERSION >= 19990421 #define php3tls_pval_destructor(a) zval_dtor(a) #endif - /* {{{ php3i_long_pval() */ - -PHPAPI pval *php3i_long_pval(long value) +static pval *php3i_long_pval(long value) { - pval *ret = emalloc(sizeof(pval)); - - ret->type = IS_LONG; - ret->value.lval = value; - return ret; + pval *ret = emalloc(sizeof(pval)); + + ret->type = IS_LONG; + ret->value.lval = value; + INIT_PZVAL(ret); + return ret; } -/* }}} */ - /* {{{ php3i_double_pval() */ - -PHPAPI pval *php3i_double_pval(double value) +static pval *php3i_string_pval(const char *str) { - pval *ret = emalloc(sizeof(pval)); - - ret->type = IS_DOUBLE; - ret->value.dval = value; - return ret; -} - -/* }}} */ - /* {{{ php3i_string_pval() */ - -PHPAPI pval *php3i_string_pval(const char *str) -{ - pval *ret = emalloc(sizeof(pval)); - int len = strlen(str); - - ret->type = IS_STRING; - ret->value.str.len = len; - ret->value.str.val = estrndup(str, len); - return ret; -} - -/* }}} */ + pval *ret = emalloc(sizeof(pval)); + int len = strlen(str); + + ret->type = IS_STRING; + ret->value.str.len = len; + INIT_PZVAL(ret); + ret->value.str.val = estrndup(str, len); + return ret; +} /* end of UGLY HACK!!! */ @@ -641,21 +618,7 @@ static int php3i_xmlcharlen(const XML_Char *s) } /* }}} */ - /* {{{ php3i_pval_strdup() */ - -PHPAPI char *php3i_pval_strdup(pval *val) -{ - if (val->type == IS_STRING) { - char *buf = emalloc(val->value.str.len + 1); - memcpy(buf, val->value.str.val, val->value.str.len); - buf[val->value.str.len] = '\0'; - return buf; - } - return NULL; -} - -/* }}} */ - /* {{{ php3i_add_to_info */ +/* {{{ php3i_add_to_info */ static void php3i_add_to_info(xml_parser *parser,char *name) { pval **element, *values; @@ -682,7 +645,7 @@ static void php3i_add_to_info(xml_parser *parser,char *name) } /* }}} */ - /* {{{ php3i_xml_startElementHandler() */ +/* {{{ php3i_xml_startElementHandler() */ void php3i_xml_startElementHandler(void *userData, const char *name, const char **attributes) |