php_xmlreader.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. +----------------------------------------------------------------------+
  15. */
  16. #ifndef PHP_XMLREADER_H
  17. #define PHP_XMLREADER_H
  18. extern zend_module_entry xmlreader_module_entry;
  19. #define phpext_xmlreader_ptr &xmlreader_module_entry
  20. #include "php_version.h"
  21. #define PHP_XMLREADER_VERSION PHP_VERSION
  22. #ifdef ZTS
  23. #include "TSRM.h"
  24. #endif
  25. #include "ext/libxml/php_libxml.h"
  26. #include <libxml/xmlreader.h>
  27. /* If xmlreader and dom both are compiled statically,
  28. no DLL import should be used in xmlreader for dom symbols. */
  29. #ifdef PHP_WIN32
  30. # if defined(HAVE_DOM) && !defined(COMPILE_DL_DOM) && !defined(COMPILE_DL_XMLREADER)
  31. # define DOM_LOCAL_DEFINES 1
  32. # endif
  33. #endif
  34. typedef struct _xmlreader_object {
  35. xmlTextReaderPtr ptr;
  36. /* strings must be set in input buffer as copy is required */
  37. xmlParserInputBufferPtr input;
  38. void *schema;
  39. HashTable *prop_handler;
  40. zend_object std;
  41. } xmlreader_object;
  42. static inline xmlreader_object *php_xmlreader_fetch_object(zend_object *obj) {
  43. return (xmlreader_object *)((char*)(obj) - XtOffsetOf(xmlreader_object, std));
  44. }
  45. #define Z_XMLREADER_P(zv) php_xmlreader_fetch_object(Z_OBJ_P((zv)))
  46. PHP_MINIT_FUNCTION(xmlreader);
  47. PHP_MSHUTDOWN_FUNCTION(xmlreader);
  48. PHP_MINFO_FUNCTION(xmlreader);
  49. #define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
  50. zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
  51. #endif /* PHP_XMLREADER_H */