php_xmlwriter.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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: Rob Richards <rrichards@php.net> |
  14. | Pierre-A. Joye <pajoye@php.net> |
  15. +----------------------------------------------------------------------+
  16. */
  17. #ifndef PHP_XMLWRITER_H
  18. #define PHP_XMLWRITER_H
  19. extern zend_module_entry xmlwriter_module_entry;
  20. #define phpext_xmlwriter_ptr &xmlwriter_module_entry
  21. #include "php_version.h"
  22. #define PHP_XMLWRITER_VERSION PHP_VERSION
  23. #ifdef ZTS
  24. #include "TSRM.h"
  25. #endif
  26. #include <libxml/tree.h>
  27. #include <libxml/xmlwriter.h>
  28. #include <libxml/uri.h>
  29. /* Extends zend object */
  30. typedef struct _ze_xmlwriter_object {
  31. xmlTextWriterPtr ptr;
  32. xmlBufferPtr output;
  33. zend_object std;
  34. } ze_xmlwriter_object;
  35. static inline ze_xmlwriter_object *php_xmlwriter_fetch_object(zend_object *obj) {
  36. return (ze_xmlwriter_object *)((char*)(obj) - XtOffsetOf(ze_xmlwriter_object, std));
  37. }
  38. #define Z_XMLWRITER_P(zv) php_xmlwriter_fetch_object(Z_OBJ_P((zv)))
  39. #endif /* PHP_XMLWRITER_H */