Skip to content

Commit 57f0f15

Browse files
committed
Debian fixes
1 parent 968d6d9 commit 57f0f15

File tree

6 files changed

+77
-29
lines changed

6 files changed

+77
-29
lines changed

ext/imap/config.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ AC_ARG_WITH(imap,
1111
withval=/usr
1212
elif test -f /usr/include/imap/mail.h; then
1313
withval=/usr
14+
elif test -f /usr/include/c-client/mail.h; then
15+
withval=/usr
1416
fi
1517
fi
1618
if test "$withval" != "no" && test "$withval" != "yes"; then
1719
IMAP_DIR=$withval
1820
if test -f $IMAP_DIR/include/imap/mail.h; then
1921
IMAP_INC_DIR=$IMAP_DIR/include/imap
22+
elif test -f $IMAP_DIR/include/c-client/mail.h; then
23+
IMAP_INC_DIR=$IMAP_DIR/include/c-client
2024
else
2125
IMAP_INC_DIR=$withval/include
2226
fi

ext/pgsql/config.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AC_ARG_WITH(pgsql,
1212
else
1313
PGSQL_INCDIR=$withval/include
1414
test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql
15+
test -d $withval/include/postgresql && PGSQL_INCDIR=$withval/include/postgresql
1516
PGSQL_LIBDIR=$withval/lib
1617
test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql
1718
fi

ext/snmp/config.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AC_ARG_WITH(snmp,
1212
SNMP_LIBDIR=/usr/local/lib
1313
test -d /usr/local/include/ucd-snmp && SNMP_INCDIR=/usr/local/include/ucd-snmp
1414
test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
15+
test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
1516
test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
1617
else
1718
SNMP_INCDIR=$withval/include

ext/xml/config.m4

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
dnl $Id$
1+
# $Source$
2+
# $Id$
23

34
AC_MSG_CHECKING(for XML support)
45
AC_ARG_WITH(xml,
56
[ --with-xml Include XML support],[
67
if test "$withval" != "no"; then
78
if test "$withval" = "yes"; then
8-
XML_LIBS="-lexpat"
9-
XML_INCLUDE=""
9+
test -d /usr/include/xmltok && XML_INCLUDE="-I/usr/include/xmltok"
10+
test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml"
11+
test -d /usr/local/include/xml && XML_INCLUDE="-I/usr/local/include/xml"
12+
test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml"
13+
XML_INCLUDE="-I/usr/include/xml"
14+
AC_CHECK_LIB(expat, main, XML_LIBS="-lexpat", XML_LIBS="-lxmlparse -lxmltok")
1015
else
1116
XML_LIBS="-L$withval/lib -lexpat"
12-
XML_INCLUDE="-I$withval/include"
17+
if test -d $withval/include/xml; then
18+
XML_INCLUDE="-I$withval/include/xml"
19+
else
20+
XML_INCLUDE="-I$withval/include"
21+
fi
1322
fi
1423
AC_DEFINE(HAVE_LIBEXPAT, 1)
1524
AC_MSG_RESULT(yes)

ext/xml/php3_xml.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929

3030
/* $Id$ */
3131

32-
#if HAVE_LIBEXPAT
33-
# ifndef _PHP_XML_H
34-
# define _PHP_XML_H
35-
# endif
32+
#ifndef _PHP_XML_H
33+
# define _PHP_XML_H
3634

37-
#include <xml/xmltok.h>
38-
#include <xml/xmlparse.h>
35+
# if HAVE_LIBEXPAT
36+
37+
#include <xmltok.h>
38+
#include <xmlparse.h>
3939

4040
#ifdef XML_UNICODE
4141
# error "UTF-16 Unicode support not implemented!"
@@ -129,6 +129,8 @@ PHP_FUNCTION(xml_parse_into_struct);
129129

130130
#define phpext_xml_ptr xml_module_ptr
131131

132+
# endif /* _PHP_XML_H */
133+
132134
/*
133135
* Local variables:
134136
* tab-width: 4

ext/xml/xml.c

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,44 @@ DLEXPORT php3_module_entry *get_module() { return &xml_module_entry; };
9292
#if PHP_API_VERSION >= 19990421
9393
#define php3tls_pval_destructor(a) zval_dtor(a)
9494
#endif
95-
static pval *php3i_long_pval(long value)
95+
/* {{{ php3i_long_pval() */
96+
97+
PHPAPI pval *php3i_long_pval(long value)
98+
{
99+
pval *ret = emalloc(sizeof(pval));
100+
101+
ret->type = IS_LONG;
102+
ret->value.lval = value;
103+
return ret;
104+
}
105+
106+
/* }}} */
107+
/* {{{ php3i_double_pval() */
108+
109+
PHPAPI pval *php3i_double_pval(double value)
96110
{
97-
pval *ret = emalloc(sizeof(pval));
98-
99-
ret->type = IS_LONG;
100-
ret->value.lval = value;
101-
INIT_PZVAL(ret);
102-
return ret;
111+
pval *ret = emalloc(sizeof(pval));
112+
113+
ret->type = IS_DOUBLE;
114+
ret->value.dval = value;
115+
return ret;
103116
}
104117

105-
static pval *php3i_string_pval(const char *str)
118+
/* }}} */
119+
/* {{{ php3i_string_pval() */
120+
121+
PHPAPI pval *php3i_string_pval(const char *str)
106122
{
107-
pval *ret = emalloc(sizeof(pval));
108-
int len = strlen(str);
109-
110-
ret->type = IS_STRING;
111-
ret->value.str.len = len;
112-
INIT_PZVAL(ret);
113-
ret->value.str.val = estrndup(str, len);
114-
return ret;
115-
}
123+
pval *ret = emalloc(sizeof(pval));
124+
int len = strlen(str);
125+
126+
ret->type = IS_STRING;
127+
ret->value.str.len = len;
128+
ret->value.str.val = estrndup(str, len);
129+
return ret;
130+
}
131+
132+
/* }}} */
116133

117134
/* end of UGLY HACK!!! */
118135

@@ -618,7 +635,21 @@ static int php3i_xmlcharlen(const XML_Char *s)
618635
}
619636

620637
/* }}} */
621-
/* {{{ php3i_add_to_info */
638+
/* {{{ php3i_pval_strdup() */
639+
640+
PHPAPI char *php3i_pval_strdup(pval *val)
641+
{
642+
if (val->type == IS_STRING) {
643+
char *buf = emalloc(val->value.str.len + 1);
644+
memcpy(buf, val->value.str.val, val->value.str.len);
645+
buf[val->value.str.len] = '\0';
646+
return buf;
647+
}
648+
return NULL;
649+
}
650+
651+
/* }}} */
652+
/* {{{ php3i_add_to_info */
622653
static void php3i_add_to_info(xml_parser *parser,char *name)
623654
{
624655
pval **element, *values;
@@ -645,7 +676,7 @@ static void php3i_add_to_info(xml_parser *parser,char *name)
645676
}
646677

647678
/* }}} */
648-
/* {{{ php3i_xml_startElementHandler() */
679+
/* {{{ php3i_xml_startElementHandler() */
649680

650681
void php3i_xml_startElementHandler(void *userData, const char *name,
651682
const char **attributes)

0 commit comments

Comments
 (0)