Annotation of embedaddon/php/ext/libxml/php_libxml.h, revision 1.1.1.2
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:
1.1.1.2 ! misho 20: /* $Id$ */
1.1 misho 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;
1.1.1.2 ! misho 46: struct _php_libxml_entity_resolver {
! 47: zend_fcall_info fci;
! 48: zend_fcall_info_cache fcc;
! 49: } entity_loader;
1.1 misho 50: ZEND_END_MODULE_GLOBALS(libxml)
51:
52: typedef struct _libxml_doc_props {
53: int formatoutput;
54: int validateonparse;
55: int resolveexternals;
56: int preservewhitespace;
57: int substituteentities;
58: int stricterror;
59: int recover;
60: HashTable *classmap;
61: } libxml_doc_props;
62:
63: typedef struct _php_libxml_ref_obj {
64: void *ptr;
65: int refcount;
66: libxml_doc_props *doc_props;
67: } php_libxml_ref_obj;
68:
69: typedef struct _php_libxml_node_ptr {
70: xmlNodePtr node;
71: int refcount;
72: void *_private;
73: } php_libxml_node_ptr;
74:
75: typedef struct _php_libxml_node_object {
76: zend_object std;
77: php_libxml_node_ptr *node;
78: php_libxml_ref_obj *document;
79: HashTable *properties;
80: } php_libxml_node_object;
81:
82: typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC);
83:
84: PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC);
85: PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC);
86: PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC);
87: PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC);
88: PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC);
89: PHP_LIBXML_API int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
90: /* When an explicit freeing of node and children is required */
91: PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC);
92: /* When object dtor is called as node may still be referenced */
93: PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC);
94: PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...);
95: PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
96: PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
97: PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
98: PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
99: PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
100:
101: /* Init/shutdown functions*/
102: PHP_LIBXML_API void php_libxml_initialize(void);
103: PHP_LIBXML_API void php_libxml_shutdown(void);
104:
105: #ifdef ZTS
106: #define LIBXML(v) TSRMG(libxml_globals_id, zend_libxml_globals *, v)
107: #else
108: #define LIBXML(v) (libxml_globals.v)
109: #endif
110:
111: #else /* HAVE_LIBXML */
112: #define libxml_module_ptr NULL
113: #endif
114:
115: #define phpext_libxml_ptr libxml_module_ptr
116:
117: #endif /* PHP_LIBXML_H */
118:
119: /*
120: * Local variables:
121: * tab-width: 4
122: * c-basic-offset: 4
123: * End:
124: */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>