@@ -33,10 +33,13 @@ static zend_class_entry *domxmldtd_class_entry_ptr;
33
33
static zend_class_entry * domxmlnode_class_entry_ptr ;
34
34
static zend_class_entry * domxmlattr_class_entry_ptr ;
35
35
36
- function_entry php_domxml_functions [] = {
36
+ static zend_function_entry php_domxml_functions [] = {
37
37
PHP_FE (getdom , NULL )
38
38
PHP_FE (domxml_root , NULL )
39
39
PHP_FE (domxml_attributes , NULL )
40
+ PHP_FE (domxml_getattr , NULL )
41
+ PHP_FE (domxml_setattr , NULL )
42
+ PHP_FE (domxml_children , NULL )
40
43
PHP_FALIAS (dom , getdom , NULL )
41
44
{NULL , NULL , NULL }
42
45
};
@@ -45,22 +48,26 @@ function_entry php_domxml_functions[] = {
45
48
static zend_function_entry php_domxmldoc_class_functions [] = {
46
49
PHP_FALIAS (root , domxml_root , NULL )
47
50
PHP_FALIAS (intdtd , domxml_intdtd , NULL )
51
+ {NULL , NULL , NULL }
48
52
};
49
53
50
54
static zend_function_entry php_domxmldtd_class_functions [] = {
55
+ {NULL , NULL , NULL }
51
56
};
52
57
53
58
static zend_function_entry php_domxmlnode_class_functions [] = {
54
59
PHP_FALIAS (lastchild , domxml_lastchild , NULL )
55
60
PHP_FALIAS (children , domxml_children , NULL )
56
61
PHP_FALIAS (parent , domxml_parent , NULL )
57
62
PHP_FALIAS (getattr , domxml_getattr , NULL )
58
- PHP_FALIAS (setattr , domxml_getattr , NULL )
63
+ PHP_FALIAS (setattr , domxml_setattr , NULL )
59
64
PHP_FALIAS (attributes , domxml_attributes , NULL )
65
+ {NULL , NULL , NULL }
60
66
};
61
67
62
68
static zend_function_entry php_domxmlattr_class_functions [] = {
63
69
PHP_FALIAS (name , domxml_attrname , NULL )
70
+ {NULL , NULL , NULL }
64
71
};
65
72
66
73
php3_module_entry php3_domxml_module_entry = {
@@ -143,7 +150,7 @@ PHP_FUNCTION(domxml_attrname)
143
150
id_to_find = id -> value .lval ;
144
151
}
145
152
146
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
153
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
147
154
if (!nodep || type != le_domxmlnodep ) {
148
155
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
149
156
RETURN_FALSE ;
@@ -154,7 +161,7 @@ PHP_FUNCTION(domxml_attrname)
154
161
RETURN_FALSE ;
155
162
}
156
163
while (attr ) {
157
- ret = php3_list_insert (attr , le_domxmlattrp );
164
+ ret = zend_list_insert (attr , le_domxmlattrp );
158
165
159
166
/* construct an object with some methods */
160
167
object_init_ex (return_value , domxmlattr_class_entry_ptr );
@@ -192,7 +199,7 @@ PHP_FUNCTION(domxml_lastchild)
192
199
id_to_find = id -> value .lval ;
193
200
}
194
201
195
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
202
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
196
203
if (!nodep || type != le_domxmlnodep ) {
197
204
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
198
205
RETURN_FALSE ;
@@ -203,7 +210,7 @@ PHP_FUNCTION(domxml_lastchild)
203
210
RETURN_FALSE ;
204
211
}
205
212
206
- ret = php3_list_insert (last , le_domxmlnodep );
213
+ ret = zend_list_insert (last , le_domxmlnodep );
207
214
208
215
/* construct an object with some methods */
209
216
object_init_ex (return_value , domxmlnode_class_entry_ptr );
@@ -243,7 +250,7 @@ PHP_FUNCTION(domxml_parent)
243
250
id_to_find = id -> value .lval ;
244
251
}
245
252
246
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
253
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
247
254
if (!nodep || type != le_domxmlnodep ) {
248
255
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
249
256
RETURN_FALSE ;
@@ -254,7 +261,7 @@ PHP_FUNCTION(domxml_parent)
254
261
RETURN_FALSE ;
255
262
}
256
263
257
- ret = php3_list_insert (last , le_domxmlnodep );
264
+ ret = zend_list_insert (last , le_domxmlnodep );
258
265
259
266
/* construct an object with some methods */
260
267
object_init_ex (return_value , domxmlnode_class_entry_ptr );
@@ -294,7 +301,7 @@ PHP_FUNCTION(domxml_children)
294
301
id_to_find = id -> value .lval ;
295
302
}
296
303
297
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
304
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
298
305
if (!nodep || type != le_domxmlnodep ) {
299
306
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
300
307
RETURN_FALSE ;
@@ -313,7 +320,7 @@ PHP_FUNCTION(domxml_children)
313
320
zval * child ;
314
321
MAKE_STD_ZVAL (child );
315
322
316
- ret = php3_list_insert (last , le_domxmlnodep );
323
+ ret = zend_list_insert (last , le_domxmlnodep );
317
324
318
325
/* construct a node object */
319
326
object_init_ex (child , domxmlnode_class_entry_ptr );
@@ -359,7 +366,7 @@ PHP_FUNCTION(domxml_getattr)
359
366
WRONG_PARAM_COUNT ;
360
367
}
361
368
362
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
369
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
363
370
if (!nodep || type != le_domxmlnodep ) {
364
371
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
365
372
RETURN_FALSE ;
@@ -407,7 +414,7 @@ PHP_FUNCTION(domxml_setattr)
407
414
WRONG_PARAM_COUNT ;
408
415
}
409
416
410
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
417
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
411
418
if (!nodep || type != le_domxmlnodep ) {
412
419
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
413
420
RETURN_FALSE ;
@@ -452,7 +459,7 @@ PHP_FUNCTION(domxml_attributes)
452
459
id_to_find = id -> value .lval ;
453
460
}
454
461
455
- nodep = (xmlNode * )php3_list_find (id_to_find , & type );
462
+ nodep = (xmlNode * )zend_list_find (id_to_find , & type );
456
463
if (!nodep || type != le_domxmlnodep ) {
457
464
php_error (E_WARNING , "unable to find node identifier (%d)" , id_to_find );
458
465
RETURN_FALSE ;
@@ -474,7 +481,7 @@ PHP_FUNCTION(domxml_attributes)
474
481
}
475
482
/* }}} */
476
483
477
- /* {{{ proto string domxml_root([int dir_handle ])
484
+ /* {{{ proto string domxml_root([int doc_handle ])
478
485
Read directory entry from dir_handle */
479
486
PHP_FUNCTION (domxml_root )
480
487
{
@@ -503,7 +510,7 @@ PHP_FUNCTION(domxml_root)
503
510
id_to_find = id -> value .lval ;
504
511
}
505
512
506
- docp = (xmlDoc * )php3_list_find (id_to_find , & type );
513
+ docp = (xmlDoc * )zend_list_find (id_to_find , & type );
507
514
if (!docp || type != le_domxmldocp ) {
508
515
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
509
516
RETURN_FALSE ;
@@ -513,7 +520,7 @@ PHP_FUNCTION(domxml_root)
513
520
if (!node ) {
514
521
RETURN_FALSE ;
515
522
}
516
- ret = php3_list_insert (node , le_domxmlnodep );
523
+ ret = zend_list_insert (node , le_domxmlnodep );
517
524
518
525
/* construct an object with some methods */
519
526
object_init_ex (return_value , domxmlnode_class_entry_ptr );
@@ -522,6 +529,7 @@ PHP_FUNCTION(domxml_root)
522
529
add_property_stringl (return_value , "name" , (char * ) node -> name , strlen (node -> name ), 1 );
523
530
if (node -> content )
524
531
add_property_stringl (return_value , "content" , (char * ) node -> content , strlen (node -> content ), 1 );
532
+ zend_list_addref (ret );
525
533
}
526
534
/* }}} */
527
535
@@ -554,7 +562,7 @@ PHP_FUNCTION(domxml_intdtd)
554
562
id_to_find = id -> value .lval ;
555
563
}
556
564
557
- docp = (xmlDoc * )php3_list_find (id_to_find , & type );
565
+ docp = (xmlDoc * )zend_list_find (id_to_find , & type );
558
566
if (!docp || type != le_domxmldocp ) {
559
567
php_error (E_WARNING , "unable to find identifier (%d)" , id_to_find );
560
568
RETURN_FALSE ;
@@ -564,14 +572,16 @@ PHP_FUNCTION(domxml_intdtd)
564
572
if (!dtd ) {
565
573
RETURN_FALSE ;
566
574
}
567
- ret = php3_list_insert (dtd , le_domxmldtdp );
575
+ ret = zend_list_insert (dtd , le_domxmldtdp );
568
576
569
577
/* construct an object with some methods */
570
578
object_init_ex (return_value , domxmldtd_class_entry_ptr );
571
579
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 );
573
582
add_property_string (return_value , "sysid" , (char * ) dtd -> SystemID , 1 );
574
583
add_property_string (return_value , "name" , (char * ) dtd -> name , 1 );
584
+ zend_list_addref (ret );
575
585
}
576
586
/* }}} */
577
587
@@ -592,12 +602,13 @@ PHP_FUNCTION(getdom)
592
602
if (!docp ) {
593
603
RETURN_FALSE ;
594
604
}
595
- ret = php3_list_insert (docp , le_domxmldocp );
605
+ ret = zend_list_insert (docp , le_domxmldocp );
596
606
597
607
/* construct an object with some methods */
598
608
object_init_ex (return_value , domxmldoc_class_entry_ptr );
599
609
add_property_long (return_value , "doc" , ret );
600
610
add_property_stringl (return_value , "version" , (char * ) docp -> version , strlen (docp -> version ), 1 );
611
+ zend_list_addref (ret );
601
612
}
602
613
/* }}} */
603
614
0 commit comments