cvs: /php4/ext/domxml domxml.c /php4/ext/fdf config.m4 /php4/ext/hyperwave hg_comm.c hw.c /php4/ext/pdf config.m4
| From: | Uwe Steinmann | Date: | Tue, 07 Dec 1999 10:49:50 +0000 |
| Subject: | cvs: /php4/ext/domxml domxml.c /php4/ext/fdf config.m4 /php4/ext/hyperwave hg_comm.c hw.c /php4/ext/pdf config.m4 | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7583@lists.php.net to get a copy of this message | ||
steinm Tue Dec 7 05:49:50 1999 EDT
Modified files:
/php4/ext/domxml domxml.c
/php4/ext/fdf config.m4
/php4/ext/hyperwave hg_comm.c hw.c
/php4/ext/pdf config.m4
Log:
- Several small corrections, typos, ...
Index: php4/ext/domxml/domxml.c
diff -u php4/ext/domxml/domxml.c:1.3 php4/ext/domxml/domxml.c:1.4
--- php4/ext/domxml/domxml.c:1.3 Sat Dec 4 14:15:47 1999
+++ php4/ext/domxml/domxml.c Tue Dec 7 05:49:16 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domxml.c,v 1.3 1999/12/04 19:15:47 sas Exp $ */
+/* $Id: domxml.c,v 1.4 1999/12/07 10:49:16 steinm Exp $ */
#include "php.h"
@@ -33,10 +33,13 @@
static zend_class_entry *domxmlnode_class_entry_ptr;
static zend_class_entry *domxmlattr_class_entry_ptr;
-function_entry php_domxml_functions[] = {
+static zend_function_entry php_domxml_functions[] = {
PHP_FE(getdom, NULL)
PHP_FE(domxml_root, NULL)
PHP_FE(domxml_attributes, NULL)
+ PHP_FE(domxml_getattr, NULL)
+ PHP_FE(domxml_setattr, NULL)
+ PHP_FE(domxml_children, NULL)
PHP_FALIAS(dom, getdom, NULL)
{NULL, NULL, NULL}
};
@@ -45,9 +48,11 @@
static zend_function_entry php_domxmldoc_class_functions[] = {
PHP_FALIAS(root, domxml_root, NULL)
PHP_FALIAS(intdtd, domxml_intdtd, NULL)
+ {NULL, NULL, NULL}
};
static zend_function_entry php_domxmldtd_class_functions[] = {
+ {NULL, NULL, NULL}
};
static zend_function_entry php_domxmlnode_class_functions[] = {
@@ -55,12 +60,14 @@
PHP_FALIAS(children, domxml_children, NULL)
PHP_FALIAS(parent, domxml_parent, NULL)
PHP_FALIAS(getattr, domxml_getattr, NULL)
- PHP_FALIAS(setattr, domxml_getattr, NULL)
+ PHP_FALIAS(setattr, domxml_setattr, NULL)
PHP_FALIAS(attributes, domxml_attributes, NULL)
+ {NULL, NULL, NULL}
};
static zend_function_entry php_domxmlattr_class_functions[] = {
PHP_FALIAS(name, domxml_attrname, NULL)
+ {NULL, NULL, NULL}
};
php3_module_entry php3_domxml_module_entry = {
@@ -143,7 +150,7 @@
id_to_find = id->value.lval;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -154,7 +161,7 @@
RETURN_FALSE;
}
while(attr) {
- ret = php3_list_insert(attr, le_domxmlattrp);
+ ret = zend_list_insert(attr, le_domxmlattrp);
/* construct an object with some methods */
object_init_ex(return_value, domxmlattr_class_entry_ptr);
@@ -192,7 +199,7 @@
id_to_find = id->value.lval;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -203,7 +210,7 @@
RETURN_FALSE;
}
- ret = php3_list_insert(last, le_domxmlnodep);
+ ret = zend_list_insert(last, le_domxmlnodep);
/* construct an object with some methods */
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -243,7 +250,7 @@
id_to_find = id->value.lval;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -254,7 +261,7 @@
RETURN_FALSE;
}
- ret = php3_list_insert(last, le_domxmlnodep);
+ ret = zend_list_insert(last, le_domxmlnodep);
/* construct an object with some methods */
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -294,7 +301,7 @@
id_to_find = id->value.lval;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -313,7 +320,7 @@
zval *child;
MAKE_STD_ZVAL(child);
- ret = php3_list_insert(last, le_domxmlnodep);
+ ret = zend_list_insert(last, le_domxmlnodep);
/* construct a node object */
object_init_ex(child, domxmlnode_class_entry_ptr);
@@ -359,7 +366,7 @@
WRONG_PARAM_COUNT;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -407,7 +414,7 @@
WRONG_PARAM_COUNT;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -452,7 +459,7 @@
id_to_find = id->value.lval;
}
- nodep = (xmlNode *)php3_list_find(id_to_find, &type);
+ nodep = (xmlNode *)zend_list_find(id_to_find, &type);
if (!nodep || type != le_domxmlnodep) {
php_error(E_WARNING, "unable to find node identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -474,7 +481,7 @@
}
/* }}} */
-/* {{{ proto string domxml_root([int dir_handle])
+/* {{{ proto string domxml_root([int doc_handle])
Read directory entry from dir_handle */
PHP_FUNCTION(domxml_root)
{
@@ -503,7 +510,7 @@
id_to_find = id->value.lval;
}
- docp = (xmlDoc *)php3_list_find(id_to_find, &type);
+ docp = (xmlDoc *)zend_list_find(id_to_find, &type);
if (!docp || type != le_domxmldocp) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -513,7 +520,7 @@
if (!node) {
RETURN_FALSE;
}
- ret = php3_list_insert(node, le_domxmlnodep);
+ ret = zend_list_insert(node, le_domxmlnodep);
/* construct an object with some methods */
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -522,6 +529,7 @@
add_property_stringl(return_value, "name", (char *) node->name,
strlen(node->name), 1);
if(node->content)
add_property_stringl(return_value, "content", (char *) node->content,
strlen(node->content), 1);
+ zend_list_addref(ret);
}
/* }}} */
@@ -554,7 +562,7 @@
id_to_find = id->value.lval;
}
- docp = (xmlDoc *)php3_list_find(id_to_find, &type);
+ docp = (xmlDoc *)zend_list_find(id_to_find, &type);
if (!docp || type != le_domxmldocp) {
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
RETURN_FALSE;
@@ -564,14 +572,16 @@
if (!dtd) {
RETURN_FALSE;
}
- ret = php3_list_insert(dtd, le_domxmldtdp);
+ ret = zend_list_insert(dtd, le_domxmldtdp);
/* construct an object with some methods */
object_init_ex(return_value, domxmldtd_class_entry_ptr);
add_property_long(return_value, "dtd", ret);
- add_property_string(return_value, "extid", (char *) dtd->ExternalID, 1);
+ if(dtd->ExternalID)
+ add_property_string(return_value, "extid", (char *) dtd->ExternalID, 1);
add_property_string(return_value, "sysid", (char *) dtd->SystemID, 1);
add_property_string(return_value, "name", (char *) dtd->name, 1);
+ zend_list_addref(ret);
}
/* }}} */
@@ -592,12 +602,13 @@
if (!docp) {
RETURN_FALSE;
}
- ret = php3_list_insert(docp, le_domxmldocp);
+ ret = zend_list_insert(docp, le_domxmldocp);
/* construct an object with some methods */
object_init_ex(return_value, domxmldoc_class_entry_ptr);
add_property_long(return_value, "doc", ret);
add_property_stringl(return_value, "version", (char *) docp->version,
strlen(docp->version), 1);
+ zend_list_addref(ret);
}
/* }}} */
Index: php4/ext/fdf/config.m4
diff -u php4/ext/fdf/config.m4:1.3 php4/ext/fdf/config.m4:1.4
--- php4/ext/fdf/config.m4:1.3 Wed Oct 6 01:23:28 1999
+++ php4/ext/fdf/config.m4 Tue Dec 7 05:49:17 1999
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.3 1999/10/06 05:23:28 steinm Exp $
+dnl $Id: config.m4,v 1.4 1999/12/07 10:49:17 steinm Exp $
AC_MSG_CHECKING(whether to include fdftk support)
AC_ARG_WITH(fdftk,
@@ -27,7 +27,7 @@
AC_CHECK_LIB(FdfTk, FDFOpen, [
AC_DEFINE(HAVE_FDFLIB)
EXTRA_LIBS="$EXTRA_LIBS -L$withval/lib -lFdfTk"
- ],[AC_MSG_ERROR(fdftk module requires ftftk lib 2.0.)])
+ ],[AC_MSG_ERROR(fdftk module requires fdftk lib 2.0.)])
LIBS=$old_LIBS
INCLUDES="$INCLUDES $FDFLIB_INCLUDE"
else
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.14 php4/ext/hyperwave/hg_comm.c:1.15
--- php4/ext/hyperwave/hg_comm.c:1.14 Thu Oct 21 11:15:23 1999
+++ php4/ext/hyperwave/hg_comm.c Tue Dec 7 05:49:18 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hg_comm.c,v 1.14 1999/10/21 15:15:23 steinm Exp $ */
+/* $Id: hg_comm.c,v 1.15 1999/12/07 10:49:18 steinm Exp $ */
/* #define HW_DEBUG */
@@ -226,7 +226,7 @@
* int ancount: number of anchors *
* Return: List of Anchors, NULL if error *
***********************************************************************/
-DLIST *fnCreateAnchorList(hw_objectID objectID, char **anchors, char **docofanchorrec, char
**reldestrec, int ancount, int anchormode)
+DLIST *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char
**reldestrec, int ancount, int anchormode)
{
int start, end, i, destid, anchordestid, objectID;
ANCHOR *cur_ptr = NULL;
@@ -299,7 +299,7 @@
/* This is basically for NAME tags. There is no need
to add the destname if it is the document itself.
*/
-/* if(destid == objectID) {
+/* if(destid == objID) {
cur_ptr->destdocname = NULL;
} else { */
/* It's always nice to deal with names, so let's first check
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.26 php4/ext/hyperwave/hw.c:1.27
--- php4/ext/hyperwave/hw.c:1.26 Sat Dec 4 14:15:49 1999
+++ php4/ext/hyperwave/hw.c Tue Dec 7 05:49:18 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.26 1999/12/04 19:15:49 sas Exp $ */
+/* $Id: hw.c,v 1.27 1999/12/07 10:49:18 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -1317,7 +1317,7 @@
link=argv[0]->value.lval;
ptr = php3_list_find(link,&type);
if(!ptr || (type!=HwSG(le_socketp) && type!=HwSG(le_psocketp))) {
- php_error(E_WARNING,"Unable to find file identifier %d",id);
+ php_error(E_WARNING,"Unable to find file identifier %d", link);
RETURN_FALSE;
}
Index: php4/ext/pdf/config.m4
diff -u php4/ext/pdf/config.m4:1.5 php4/ext/pdf/config.m4:1.6
--- php4/ext/pdf/config.m4:1.5 Thu Aug 19 13:07:26 1999
+++ php4/ext/pdf/config.m4 Tue Dec 7 05:49:19 1999
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.5 1999/08/19 17:07:26 steinm Exp $
+dnl $Id: config.m4,v 1.6 1999/12/07 10:49:19 steinm Exp $
AC_MSG_CHECKING(whether to include Pdflib 2.x support)
AC_ARG_WITH(pdflib,
@@ -13,12 +13,20 @@
yes)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pdf)
- AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="-L/usr/local -lpdf
-lz"],
+ old_LDFLAGS=$LDFLAGS
+ old_LIBS=$LIBS
+ LIBS="$LIBS -ltiff -ljpeg -lz"
+ AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB)],
[AC_MSG_ERROR(pdflib extension requires pdflib 2.x. You may as well need libtiff and
libjpeg. In such a case use the options --with-tiff-dir=<DIR> and
--with-jpeg-dir=<DIR>)])
- EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
+ LIBS=$old_LIBS
+ LDFLAGS=$old_LDFLAGS
+ AC_ADD_LIBRARY(pdf)
+ AC_ADD_LIBRARY(tiff)
+ AC_ADD_LIBRARY(jpeg)
+ AC_ADD_LIBRARY(z)
;;
*)
- test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="-I$withval/include"
+ test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="$withval/include"
if test -n "$PDFLIB_INCLUDE" ; then
AC_MSG_RESULT(yes)
PHP_EXTENSION(pdf)
@@ -35,6 +43,7 @@
fi
AC_CHECK_LIB(z,deflate, [PDFLIB_LIBS="-L$withval/lib
-lz"],[AC_MSG_RESULT(no)],)
LIBS="$LIBS -L$withval/lib -lz"
+ AC_ADD_LIBRARY_WITH_PATH(z, $/withvallib)
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-zlib=<DIR>)
@@ -54,6 +63,7 @@
fi
LIBS="$LIBS -L$withval/lib -ljpeg"
AC_CHECK_LIB(jpeg,jpeg_read_header, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib
-ljpeg"],[AC_MSG_RESULT(no)],)
+ AC_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
LIBS="$LIBS -L$withval/lib -ljpeg"
],[
AC_MSG_RESULT(no)
@@ -69,6 +79,7 @@
fi
LIBS="$LIBS -L$withval/lib -ltiff -ljpeg"
AC_CHECK_LIB(tiff,TIFFOpen, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib
-ltiff"],[AC_MSG_RESULT(no)],)
+ AC_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
@@ -78,9 +89,9 @@
LIBS="$LIBS -L$withval/lib"
AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="$PDFLIB_LIBS
-L$withval/lib -lpdf"],
[AC_MSG_ERROR(pdflib extension requires pdflib 2.x.)])
+ AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib)
+ AC_ADD_INCLUDE($PDFLIB_INCLUDE)
LIBS=$old_LIBS
- EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
- INCLUDES="$INCLUDES $PDFLIB_INCLUDE"
else
AC_MSG_RESULT(no)
fi ;;