xref: /PHP-7.1/ext/xmlwriter/php_xmlwriter.h (revision ccd4716e)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2018 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   | Author: Rob Richards <rrichards@php.net>                             |
16   |         Pierre-A. Joye <pajoye@php.net>                              |
17   +----------------------------------------------------------------------+
18 */
19 
20 /* $Id$ */
21 
22 #ifndef PHP_XMLWRITER_H
23 #define PHP_XMLWRITER_H
24 
25 extern zend_module_entry xmlwriter_module_entry;
26 #define phpext_xmlwriter_ptr &xmlwriter_module_entry
27 
28 #include "php_version.h"
29 #define PHP_XMLWRITER_VERSION PHP_VERSION
30 
31 #ifdef ZTS
32 #include "TSRM.h"
33 #endif
34 
35 #include <libxml/tree.h>
36 #include <libxml/xmlwriter.h>
37 #include <libxml/uri.h>
38 
39 /* Resource struct, not the object :) */
40 typedef struct _xmlwriter_object {
41 	xmlTextWriterPtr ptr;
42 	xmlBufferPtr output;
43 } xmlwriter_object;
44 
45 
46 /* Extends zend object */
47 typedef struct _ze_xmlwriter_object {
48 	xmlwriter_object *xmlwriter_ptr;
49 	zend_object std;
50 } ze_xmlwriter_object;
51 
php_xmlwriter_fetch_object(zend_object * obj)52 static inline ze_xmlwriter_object *php_xmlwriter_fetch_object(zend_object *obj) {
53 	return (ze_xmlwriter_object *)((char*)(obj) - XtOffsetOf(ze_xmlwriter_object, std));
54 }
55 
56 #define Z_XMLWRITER_P(zv) php_xmlwriter_fetch_object(Z_OBJ_P((zv)))
57 
58 #endif	/* PHP_XMLWRITER_H */
59 
60 /*
61  * Local variables:
62  * tab-width: 4
63  * c-basic-offset: 4
64  * End:
65  * vim600: noet sw=4 ts=4 fdm=marker
66  * vim<600: noet sw=4 ts=4
67  */
68