php_simplexml_exports.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. | Author: Sterling Hughes <sterling@php.net> |
  14. | Marcus Boerger <helly@php.net> |
  15. | Rob Richards <rrichards@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_SIMPLEXML_EXPORTS_H
  19. #define PHP_SIMPLEXML_EXPORTS_H
  20. #include "php_simplexml.h"
  21. #define SKIP_TEXT(__p) \
  22. if ((__p)->type == XML_TEXT_NODE) { \
  23. goto next_iter; \
  24. }
  25. #define GET_NODE(__s, __n) { \
  26. if ((__s)->node && (__s)->node->node) { \
  27. __n = (__s)->node->node; \
  28. } else { \
  29. __n = NULL; \
  30. zend_throw_error(NULL, "SimpleXMLElement is not properly initialized"); \
  31. } \
  32. }
  33. PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce);
  34. static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ {
  35. return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo));
  36. }
  37. /* }}} */
  38. #define Z_SXEOBJ_P(zv) php_sxe_fetch_object(Z_OBJ_P((zv)))
  39. typedef struct {
  40. zend_object_iterator intern;
  41. php_sxe_object *sxe;
  42. } php_sxe_iterator;
  43. PHP_SXE_API void php_sxe_rewind_iterator(php_sxe_object *sxe);
  44. PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe);
  45. #endif /* PHP_SIMPLEXML_EXPORTS_H */