xref: /php-src/ext/dom/token_list.h (revision fc09f4b2)
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 TOKEN_LIST_H
18 #define TOKEN_LIST_H
19 
20 typedef struct dom_token_list_object {
21 	HashTable token_set;
22 	/* Used to check if the token set is up to date. */
23 	char *cached_string;
24 	php_libxml_cache_tag cache_tag;
25 	dom_object dom;
26 } dom_token_list_object;
27 
php_dom_token_list_from_obj(zend_object * obj)28 static inline dom_token_list_object *php_dom_token_list_from_obj(zend_object *obj)
29 {
30 	return (dom_token_list_object *)((char *) obj - XtOffsetOf(dom_token_list_object, dom.std));
31 }
32 
php_dom_token_list_from_dom_obj(dom_object * obj)33 static inline dom_token_list_object *php_dom_token_list_from_dom_obj(dom_object *obj)
34 {
35 	return (dom_token_list_object *)((char *) obj - XtOffsetOf(dom_token_list_object, dom));
36 }
37 
38 void dom_token_list_ctor(dom_token_list_object *intern, dom_object *element_obj);
39 void dom_token_list_free_obj(zend_object *object);
40 zval *dom_token_list_read_dimension(zend_object *object, zval *offset, int type, zval *rv);
41 int dom_token_list_has_dimension(zend_object *object, zval *offset, int check_empty);
42 zend_object_iterator *dom_token_list_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
43 
44 #endif
45