1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 7 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2016 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: Sterling Hughes <sterling@php.net> |
16 | Marcus Boerger <helly@php.net> |
17 | Rob Richards <rrichards@php.net> |
18 +----------------------------------------------------------------------+
19 */
20
21 /* $Id$ */
22
23 #ifndef PHP_SIMPLEXML_EXPORTS_H
24 #define PHP_SIMPLEXML_EXPORTS_H
25
26 #include "php_simplexml.h"
27
28 #define SKIP_TEXT(__p) \
29 if ((__p)->type == XML_TEXT_NODE) { \
30 goto next_iter; \
31 }
32
33 #define GET_NODE(__s, __n) { \
34 if ((__s)->node && (__s)->node->node) { \
35 __n = (__s)->node->node; \
36 } else { \
37 __n = NULL; \
38 php_error_docref(NULL, E_WARNING, "Node no longer exists"); \
39 } \
40 }
41
42 PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce);
43
44 static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ {
45 return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo));
46 }
47 /* }}} */
48
49 #define Z_SXEOBJ_P(zv) php_sxe_fetch_object(Z_OBJ_P((zv)))
50
51 typedef struct {
52 zend_object_iterator intern;
53 php_sxe_object *sxe;
54 } php_sxe_iterator;
55
56 #endif /* PHP_SIMPLEXML_EXPORTS_H */
57
58 /**
59 * Local Variables:
60 * c-basic-offset: 4
61 * tab-width: 4
62 * indent-tabs-mode: t
63 * End:
64 * vim600: fdm=marker
65 * vim: noet sw=4 ts=4
66 */