summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/imap/config.m44
-rw-r--r--ext/pgsql/config.m41
-rw-r--r--ext/snmp/config.m41
-rw-r--r--ext/xml/config.m417
-rw-r--r--ext/xml/php3_xml.h14
-rw-r--r--ext/xml/xml.c69
6 files changed, 77 insertions, 29 deletions
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
index 06ceb6ce9b..36697bfc18 100644
--- a/ext/imap/config.m4
+++ b/ext/imap/config.m4
@@ -11,12 +11,16 @@ AC_ARG_WITH(imap,
withval=/usr
elif test -f /usr/include/imap/mail.h; then
withval=/usr
+ elif test -f /usr/include/c-client/mail.h; then
+ withval=/usr
fi
fi
if test "$withval" != "no" && test "$withval" != "yes"; then
IMAP_DIR=$withval
if test -f $IMAP_DIR/include/imap/mail.h; then
IMAP_INC_DIR=$IMAP_DIR/include/imap
+ elif test -f $IMAP_DIR/include/c-client/mail.h; then
+ IMAP_INC_DIR=$IMAP_DIR/include/c-client
else
IMAP_INC_DIR=$withval/include
fi
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index bd83c2794e..c40840cc3c 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -12,6 +12,7 @@ AC_ARG_WITH(pgsql,
else
PGSQL_INCDIR=$withval/include
test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
+ test -d $withval/include/postgresql && PGSQL_INCDIR=$withval/include/postgresql
PGSQL_LIBDIR=$withval/lib
test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
fi
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4
index c39d77908e..1608331b56 100644
--- a/ext/snmp/config.m4
+++ b/ext/snmp/config.m4
@@ -12,6 +12,7 @@ AC_ARG_WITH(snmp,
SNMP_LIBDIR=/usr/local/lib
test -d /usr/local/include/ucd-snmp && SNMP_INCDIR=/usr/local/include/ucd-snmp
test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
+ test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
else
SNMP_INCDIR=$withval/include
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index c4b871107d..316b23b761 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -1,15 +1,24 @@
-dnl $Id$
+# $Source$
+# $Id$
AC_MSG_CHECKING(for XML support)
AC_ARG_WITH(xml,
[ --with-xml Include XML support],[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
- XML_LIBS="-lexpat"
- XML_INCLUDE=""
+ 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"
+ test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml"
+ XML_INCLUDE="-I/usr/include/xml"
+ AC_CHECK_LIB(expat, main, XML_LIBS="-lexpat", XML_LIBS="-lxmlparse -lxmltok")
else
XML_LIBS="-L$withval/lib -lexpat"
- XML_INCLUDE="-I$withval/include"
+ if test -d $withval/include/xml; then
+ XML_INCLUDE="-I$withval/include/xml"
+ else
+ XML_INCLUDE="-I$withval/include"
+ fi
fi
AC_DEFINE(HAVE_LIBEXPAT, 1)
AC_MSG_RESULT(yes)
diff --git a/ext/xml/php3_xml.h b/ext/xml/php3_xml.h
index 0c4c706d9d..5016848c8e 100644
--- a/ext/xml/php3_xml.h
+++ b/ext/xml/php3_xml.h
@@ -29,13 +29,13 @@
/* $Id$ */
-#if HAVE_LIBEXPAT
-# ifndef _PHP_XML_H
-# define _PHP_XML_H
-# endif
+#ifndef _PHP_XML_H
+# define _PHP_XML_H
-#include <xml/xmltok.h>
-#include <xml/xmlparse.h>
+# if HAVE_LIBEXPAT
+
+#include <xmltok.h>
+#include <xmlparse.h>
#ifdef XML_UNICODE
# error "UTF-16 Unicode support not implemented!"
@@ -129,6 +129,8 @@ 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 acfe5ccb05..66ea4a043d 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -92,27 +92,44 @@ DLEXPORT php3_module_entry *get_module() { return &xml_module_entry; };
#if PHP_API_VERSION >= 19990421
#define php3tls_pval_destructor(a) zval_dtor(a)
#endif
-static pval *php3i_long_pval(long value)
+ /* {{{ php3i_long_pval() */
+
+PHPAPI pval *php3i_long_pval(long value)
+{
+ pval *ret = emalloc(sizeof(pval));
+
+ ret->type = IS_LONG;
+ ret->value.lval = value;
+ return ret;
+}
+
+/* }}} */
+ /* {{{ php3i_double_pval() */
+
+PHPAPI pval *php3i_double_pval(double value)
{
- pval *ret = emalloc(sizeof(pval));
-
- ret->type = IS_LONG;
- ret->value.lval = value;
- INIT_PZVAL(ret);
- return ret;
+ pval *ret = emalloc(sizeof(pval));
+
+ ret->type = IS_DOUBLE;
+ ret->value.dval = value;
+ return ret;
}
-static pval *php3i_string_pval(const char *str)
+/* }}} */
+ /* {{{ 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;
- INIT_PZVAL(ret);
- 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;
+ ret->value.str.val = estrndup(str, len);
+ return ret;
+}
+
+/* }}} */
/* end of UGLY HACK!!! */
@@ -618,7 +635,21 @@ static int php3i_xmlcharlen(const XML_Char *s)
}
/* }}} */
-/* {{{ php3i_add_to_info */
+ /* {{{ 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 */
static void php3i_add_to_info(xml_parser *parser,char *name)
{
pval **element, *values;
@@ -645,7 +676,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)