xref: /php-src/ext/dom/nodelist.h (revision e7af2bfd)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Authors: Niels Dossche <nielsdos@php.net>                            |
14    +----------------------------------------------------------------------+
15 */
16 
17 #ifndef PHP_NODELIST_H
18 #define PHP_NODELIST_H
19 
20 enum dom_nodelist_dimension_index_type {
21 	DOM_NODELIST_DIM_ILLEGAL,
22 	DOM_NODELIST_DIM_STRING,
23 	DOM_NODELIST_DIM_LONG,
24 };
25 
26 typedef struct dom_nodelist_dimension_index {
27 	union {
28 		zend_long lval;
29 		zend_string *str;
30 	};
31 	enum dom_nodelist_dimension_index_type type;
32 } dom_nodelist_dimension_index;
33 
34 void php_dom_nodelist_get_item_into_zval(dom_nnodemap_object *objmap, zend_long index, zval *return_value);
35 zend_long php_dom_get_nodelist_length(dom_object *obj);
36 dom_nodelist_dimension_index dom_modern_nodelist_get_index(const zval *offset);
37 zval *dom_modern_nodelist_read_dimension(zend_object *object, zval *offset, int type, zval *rv);
38 int dom_modern_nodelist_has_dimension(zend_object *object, zval *member, int check_empty);
39 
40 #endif
41