Skip to content

Commit 512c641

Browse files
author
Uwe Steinmann
committed
- Several small corrections, typos, ...
1 parent 5cdb16a commit 512c641

File tree

5 files changed

+51
-29
lines changed

5 files changed

+51
-29
lines changed

ext/domxml/domxml.c

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ static zend_class_entry *domxmldtd_class_entry_ptr;
3333
static zend_class_entry *domxmlnode_class_entry_ptr;
3434
static zend_class_entry *domxmlattr_class_entry_ptr;
3535

36-
function_entry php_domxml_functions[] = {
36+
static zend_function_entry php_domxml_functions[] = {
3737
PHP_FE(getdom, NULL)
3838
PHP_FE(domxml_root, NULL)
3939
PHP_FE(domxml_attributes, NULL)
40+
PHP_FE(domxml_getattr, NULL)
41+
PHP_FE(domxml_setattr, NULL)
42+
PHP_FE(domxml_children, NULL)
4043
PHP_FALIAS(dom, getdom, NULL)
4144
{NULL, NULL, NULL}
4245
};
@@ -45,22 +48,26 @@ function_entry php_domxml_functions[] = {
4548
static zend_function_entry php_domxmldoc_class_functions[] = {
4649
PHP_FALIAS(root, domxml_root, NULL)
4750
PHP_FALIAS(intdtd, domxml_intdtd, NULL)
51+
{NULL, NULL, NULL}
4852
};
4953

5054
static zend_function_entry php_domxmldtd_class_functions[] = {
55+
{NULL, NULL, NULL}
5156
};
5257

5358
static zend_function_entry php_domxmlnode_class_functions[] = {
5459
PHP_FALIAS(lastchild, domxml_lastchild, NULL)
5560
PHP_FALIAS(children, domxml_children, NULL)
5661
PHP_FALIAS(parent, domxml_parent, NULL)
5762
PHP_FALIAS(getattr, domxml_getattr, NULL)
58-
PHP_FALIAS(setattr, domxml_getattr, NULL)
63+
PHP_FALIAS(setattr, domxml_setattr, NULL)
5964
PHP_FALIAS(attributes, domxml_attributes, NULL)
65+
{NULL, NULL, NULL}
6066
};
6167

6268
static zend_function_entry php_domxmlattr_class_functions[] = {
6369
PHP_FALIAS(name, domxml_attrname, NULL)
70+
{NULL, NULL, NULL}
6471
};
6572

6673
php3_module_entry php3_domxml_module_entry = {
@@ -143,7 +150,7 @@ PHP_FUNCTION(domxml_attrname)
143150
id_to_find = id->value.lval;
144151
}
145152

146-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
153+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
147154
if (!nodep || type != le_domxmlnodep) {
148155
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
149156
RETURN_FALSE;
@@ -154,7 +161,7 @@ PHP_FUNCTION(domxml_attrname)
154161
RETURN_FALSE;
155162
}
156163
while(attr) {
157-
ret = php3_list_insert(attr, le_domxmlattrp);
164+
ret = zend_list_insert(attr, le_domxmlattrp);
158165

159166
/* construct an object with some methods */
160167
object_init_ex(return_value, domxmlattr_class_entry_ptr);
@@ -192,7 +199,7 @@ PHP_FUNCTION(domxml_lastchild)
192199
id_to_find = id->value.lval;
193200
}
194201

195-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
202+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
196203
if (!nodep || type != le_domxmlnodep) {
197204
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
198205
RETURN_FALSE;
@@ -203,7 +210,7 @@ PHP_FUNCTION(domxml_lastchild)
203210
RETURN_FALSE;
204211
}
205212

206-
ret = php3_list_insert(last, le_domxmlnodep);
213+
ret = zend_list_insert(last, le_domxmlnodep);
207214

208215
/* construct an object with some methods */
209216
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -243,7 +250,7 @@ PHP_FUNCTION(domxml_parent)
243250
id_to_find = id->value.lval;
244251
}
245252

246-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
253+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
247254
if (!nodep || type != le_domxmlnodep) {
248255
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
249256
RETURN_FALSE;
@@ -254,7 +261,7 @@ PHP_FUNCTION(domxml_parent)
254261
RETURN_FALSE;
255262
}
256263

257-
ret = php3_list_insert(last, le_domxmlnodep);
264+
ret = zend_list_insert(last, le_domxmlnodep);
258265

259266
/* construct an object with some methods */
260267
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -294,7 +301,7 @@ PHP_FUNCTION(domxml_children)
294301
id_to_find = id->value.lval;
295302
}
296303

297-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
304+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
298305
if (!nodep || type != le_domxmlnodep) {
299306
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
300307
RETURN_FALSE;
@@ -313,7 +320,7 @@ PHP_FUNCTION(domxml_children)
313320
zval *child;
314321
MAKE_STD_ZVAL(child);
315322

316-
ret = php3_list_insert(last, le_domxmlnodep);
323+
ret = zend_list_insert(last, le_domxmlnodep);
317324

318325
/* construct a node object */
319326
object_init_ex(child, domxmlnode_class_entry_ptr);
@@ -359,7 +366,7 @@ PHP_FUNCTION(domxml_getattr)
359366
WRONG_PARAM_COUNT;
360367
}
361368

362-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
369+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
363370
if (!nodep || type != le_domxmlnodep) {
364371
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
365372
RETURN_FALSE;
@@ -407,7 +414,7 @@ PHP_FUNCTION(domxml_setattr)
407414
WRONG_PARAM_COUNT;
408415
}
409416

410-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
417+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
411418
if (!nodep || type != le_domxmlnodep) {
412419
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
413420
RETURN_FALSE;
@@ -452,7 +459,7 @@ PHP_FUNCTION(domxml_attributes)
452459
id_to_find = id->value.lval;
453460
}
454461

455-
nodep = (xmlNode *)php3_list_find(id_to_find, &type);
462+
nodep = (xmlNode *)zend_list_find(id_to_find, &type);
456463
if (!nodep || type != le_domxmlnodep) {
457464
php_error(E_WARNING, "unable to find node identifier (%d)", id_to_find);
458465
RETURN_FALSE;
@@ -474,7 +481,7 @@ PHP_FUNCTION(domxml_attributes)
474481
}
475482
/* }}} */
476483

477-
/* {{{ proto string domxml_root([int dir_handle])
484+
/* {{{ proto string domxml_root([int doc_handle])
478485
Read directory entry from dir_handle */
479486
PHP_FUNCTION(domxml_root)
480487
{
@@ -503,7 +510,7 @@ PHP_FUNCTION(domxml_root)
503510
id_to_find = id->value.lval;
504511
}
505512

506-
docp = (xmlDoc *)php3_list_find(id_to_find, &type);
513+
docp = (xmlDoc *)zend_list_find(id_to_find, &type);
507514
if (!docp || type != le_domxmldocp) {
508515
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
509516
RETURN_FALSE;
@@ -513,7 +520,7 @@ PHP_FUNCTION(domxml_root)
513520
if (!node) {
514521
RETURN_FALSE;
515522
}
516-
ret = php3_list_insert(node, le_domxmlnodep);
523+
ret = zend_list_insert(node, le_domxmlnodep);
517524

518525
/* construct an object with some methods */
519526
object_init_ex(return_value, domxmlnode_class_entry_ptr);
@@ -522,6 +529,7 @@ PHP_FUNCTION(domxml_root)
522529
add_property_stringl(return_value, "name", (char *) node->name, strlen(node->name), 1);
523530
if(node->content)
524531
add_property_stringl(return_value, "content", (char *) node->content, strlen(node->content), 1);
532+
zend_list_addref(ret);
525533
}
526534
/* }}} */
527535

@@ -554,7 +562,7 @@ PHP_FUNCTION(domxml_intdtd)
554562
id_to_find = id->value.lval;
555563
}
556564

557-
docp = (xmlDoc *)php3_list_find(id_to_find, &type);
565+
docp = (xmlDoc *)zend_list_find(id_to_find, &type);
558566
if (!docp || type != le_domxmldocp) {
559567
php_error(E_WARNING, "unable to find identifier (%d)", id_to_find);
560568
RETURN_FALSE;
@@ -564,14 +572,16 @@ PHP_FUNCTION(domxml_intdtd)
564572
if (!dtd) {
565573
RETURN_FALSE;
566574
}
567-
ret = php3_list_insert(dtd, le_domxmldtdp);
575+
ret = zend_list_insert(dtd, le_domxmldtdp);
568576

569577
/* construct an object with some methods */
570578
object_init_ex(return_value, domxmldtd_class_entry_ptr);
571579
add_property_long(return_value, "dtd", ret);
572-
add_property_string(return_value, "extid", (char *) dtd->ExternalID, 1);
580+
if(dtd->ExternalID)
581+
add_property_string(return_value, "extid", (char *) dtd->ExternalID, 1);
573582
add_property_string(return_value, "sysid", (char *) dtd->SystemID, 1);
574583
add_property_string(return_value, "name", (char *) dtd->name, 1);
584+
zend_list_addref(ret);
575585
}
576586
/* }}} */
577587

@@ -592,12 +602,13 @@ PHP_FUNCTION(getdom)
592602
if (!docp) {
593603
RETURN_FALSE;
594604
}
595-
ret = php3_list_insert(docp, le_domxmldocp);
605+
ret = zend_list_insert(docp, le_domxmldocp);
596606

597607
/* construct an object with some methods */
598608
object_init_ex(return_value, domxmldoc_class_entry_ptr);
599609
add_property_long(return_value, "doc", ret);
600610
add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1);
611+
zend_list_addref(ret);
601612
}
602613
/* }}} */
603614

ext/fdf/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ AC_ARG_WITH(fdftk,
2727
AC_CHECK_LIB(FdfTk, FDFOpen, [
2828
AC_DEFINE(HAVE_FDFLIB)
2929
EXTRA_LIBS="$EXTRA_LIBS -L$withval/lib -lFdfTk"
30-
],[AC_MSG_ERROR(fdftk module requires ftftk lib 2.0.)])
30+
],[AC_MSG_ERROR(fdftk module requires fdftk lib 2.0.)])
3131
LIBS=$old_LIBS
3232
INCLUDES="$INCLUDES $FDFLIB_INCLUDE"
3333
else

ext/hyperwave/hg_comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ int fnCmpAnchors(ANCHOR *a1, ANCHOR *a2)
226226
* int ancount: number of anchors *
227227
* Return: List of Anchors, NULL if error *
228228
***********************************************************************/
229-
DLIST *fnCreateAnchorList(hw_objectID objectID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode)
229+
DLIST *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode)
230230
{
231231
int start, end, i, destid, anchordestid, objectID;
232232
ANCHOR *cur_ptr = NULL;
@@ -299,7 +299,7 @@ DLIST *fnCreateAnchorList(hw_objectID objectID, char **anchors, char **docofanch
299299
/* This is basically for NAME tags. There is no need
300300
to add the destname if it is the document itself.
301301
*/
302-
/* if(destid == objectID) {
302+
/* if(destid == objID) {
303303
cur_ptr->destdocname = NULL;
304304
} else { */
305305
/* It's always nice to deal with names, so let's first check

ext/hyperwave/hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ PHP_FUNCTION(hw_getobject) {
13171317
link=argv[0]->value.lval;
13181318
ptr = php3_list_find(link,&type);
13191319
if(!ptr || (type!=HwSG(le_socketp) && type!=HwSG(le_psocketp))) {
1320-
php_error(E_WARNING,"Unable to find file identifier %d",id);
1320+
php_error(E_WARNING,"Unable to find file identifier %d", link);
13211321
RETURN_FALSE;
13221322
}
13231323

ext/pdf/config.m4

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ echo $withval
1313
yes)
1414
AC_MSG_RESULT(yes)
1515
PHP_EXTENSION(pdf)
16-
AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="-L/usr/local -lpdf -lz"],
16+
old_LDFLAGS=$LDFLAGS
17+
old_LIBS=$LIBS
18+
LIBS="$LIBS -ltiff -ljpeg -lz"
19+
AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB)],
1720
[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>)])
18-
EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
21+
LIBS=$old_LIBS
22+
LDFLAGS=$old_LDFLAGS
23+
AC_ADD_LIBRARY(pdf)
24+
AC_ADD_LIBRARY(tiff)
25+
AC_ADD_LIBRARY(jpeg)
26+
AC_ADD_LIBRARY(z)
1927
;;
2028
*)
21-
test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="-I$withval/include"
29+
test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="$withval/include"
2230
if test -n "$PDFLIB_INCLUDE" ; then
2331
AC_MSG_RESULT(yes)
2432
PHP_EXTENSION(pdf)
@@ -35,6 +43,7 @@ echo $withval
3543
fi
3644
AC_CHECK_LIB(z,deflate, [PDFLIB_LIBS="-L$withval/lib -lz"],[AC_MSG_RESULT(no)],)
3745
LIBS="$LIBS -L$withval/lib -lz"
46+
AC_ADD_LIBRARY_WITH_PATH(z, $/withvallib)
3847
],[
3948
AC_MSG_RESULT(no)
4049
AC_MSG_WARN(If configure fails try --with-zlib=<DIR>)
@@ -54,6 +63,7 @@ echo $withval
5463
fi
5564
LIBS="$LIBS -L$withval/lib -ljpeg"
5665
AC_CHECK_LIB(jpeg,jpeg_read_header, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -ljpeg"],[AC_MSG_RESULT(no)],)
66+
AC_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
5767
LIBS="$LIBS -L$withval/lib -ljpeg"
5868
],[
5969
AC_MSG_RESULT(no)
@@ -69,6 +79,7 @@ echo $withval
6979
fi
7080
LIBS="$LIBS -L$withval/lib -ltiff -ljpeg"
7181
AC_CHECK_LIB(tiff,TIFFOpen, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -ltiff"],[AC_MSG_RESULT(no)],)
82+
AC_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
7283
],[
7384
AC_MSG_RESULT(no)
7485
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
@@ -78,9 +89,9 @@ echo $withval
7889
LIBS="$LIBS -L$withval/lib"
7990
AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -lpdf"],
8091
[AC_MSG_ERROR(pdflib extension requires pdflib 2.x.)])
92+
AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib)
93+
AC_ADD_INCLUDE($PDFLIB_INCLUDE)
8194
LIBS=$old_LIBS
82-
EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
83-
INCLUDES="$INCLUDES $PDFLIB_INCLUDE"
8495
else
8596
AC_MSG_RESULT(no)
8697
fi ;;

0 commit comments

Comments
 (0)