Return to php_libxml.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / libxml |
1.1 ! misho 1: /* ! 2: +----------------------------------------------------------------------+ ! 3: | PHP Version 5 | ! 4: +----------------------------------------------------------------------+ ! 5: | Copyright (c) 1997-2012 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: | Authors: Shane Caraveo <shane@php.net> | ! 16: | Wez Furlong <wez@thebrainroom.com> | ! 17: +----------------------------------------------------------------------+ ! 18: */ ! 19: ! 20: /* $Id: php_libxml.h 321634 2012-01-01 13:15:04Z felipe $ */ ! 21: ! 22: #ifndef PHP_LIBXML_H ! 23: #define PHP_LIBXML_H ! 24: ! 25: #if HAVE_LIBXML ! 26: extern zend_module_entry libxml_module_entry; ! 27: #define libxml_module_ptr &libxml_module_entry ! 28: ! 29: #ifdef PHP_WIN32 ! 30: # define PHP_LIBXML_API __declspec(dllexport) ! 31: #elif defined(__GNUC__) && __GNUC__ >= 4 ! 32: # define PHP_LIBXML_API __attribute__ ((visibility("default"))) ! 33: #else ! 34: # define PHP_LIBXML_API ! 35: #endif ! 36: ! 37: #include "ext/standard/php_smart_str.h" ! 38: #include <libxml/tree.h> ! 39: ! 40: #define LIBXML_SAVE_NOEMPTYTAG 1<<2 ! 41: ! 42: ZEND_BEGIN_MODULE_GLOBALS(libxml) ! 43: zval *stream_context; ! 44: smart_str error_buffer; ! 45: zend_llist *error_list; ! 46: ZEND_END_MODULE_GLOBALS(libxml) ! 47: ! 48: typedef struct _libxml_doc_props { ! 49: int formatoutput; ! 50: int validateonparse; ! 51: int resolveexternals; ! 52: int preservewhitespace; ! 53: int substituteentities; ! 54: int stricterror; ! 55: int recover; ! 56: HashTable *classmap; ! 57: } libxml_doc_props; ! 58: ! 59: typedef struct _php_libxml_ref_obj { ! 60: void *ptr; ! 61: int refcount; ! 62: libxml_doc_props *doc_props; ! 63: } php_libxml_ref_obj; ! 64: ! 65: typedef struct _php_libxml_node_ptr { ! 66: xmlNodePtr node; ! 67: int refcount; ! 68: void *_private; ! 69: } php_libxml_node_ptr; ! 70: ! 71: typedef struct _php_libxml_node_object { ! 72: zend_object std; ! 73: php_libxml_node_ptr *node; ! 74: php_libxml_ref_obj *document; ! 75: HashTable *properties; ! 76: } php_libxml_node_object; ! 77: ! 78: typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC); ! 79: ! 80: PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC); ! 81: PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC); ! 82: PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC); ! 83: PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC); ! 84: PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC); ! 85: PHP_LIBXML_API int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function); ! 86: /* When an explicit freeing of node and children is required */ ! 87: PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC); ! 88: /* When object dtor is called as node may still be referenced */ ! 89: PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC); ! 90: PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...); ! 91: PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...); ! 92: PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...); ! 93: PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); ! 94: PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); ! 95: PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC); ! 96: ! 97: /* Init/shutdown functions*/ ! 98: PHP_LIBXML_API void php_libxml_initialize(void); ! 99: PHP_LIBXML_API void php_libxml_shutdown(void); ! 100: ! 101: #ifdef ZTS ! 102: #define LIBXML(v) TSRMG(libxml_globals_id, zend_libxml_globals *, v) ! 103: #else ! 104: #define LIBXML(v) (libxml_globals.v) ! 105: #endif ! 106: ! 107: #else /* HAVE_LIBXML */ ! 108: #define libxml_module_ptr NULL ! 109: #endif ! 110: ! 111: #define phpext_libxml_ptr libxml_module_ptr ! 112: ! 113: #endif /* PHP_LIBXML_H */ ! 114: ! 115: /* ! 116: * Local variables: ! 117: * tab-width: 4 ! 118: * c-basic-offset: 4 ! 119: * End: ! 120: */