xref: /php-src/ext/xmlwriter/php_xmlwriter.h (revision 01b3fc03)
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 
18 #ifndef PHP_XMLWRITER_H
19 #define PHP_XMLWRITER_H
20 
21 extern zend_module_entry xmlwriter_module_entry;
22 #define phpext_xmlwriter_ptr &xmlwriter_module_entry
23 
24 #include "php_version.h"
25 #define PHP_XMLWRITER_VERSION PHP_VERSION
26 
27 #ifdef ZTS
28 #include "TSRM.h"
29 #endif
30 
31 #include <libxml/tree.h>
32 #include <libxml/xmlwriter.h>
33 #include <libxml/uri.h>
34 
35 /* Extends zend object */
36 typedef struct _ze_xmlwriter_object {
37 	xmlTextWriterPtr ptr;
38 	xmlBufferPtr output;
39 	zend_object std;
40 } ze_xmlwriter_object;
41 
php_xmlwriter_fetch_object(zend_object * obj)42 static inline ze_xmlwriter_object *php_xmlwriter_fetch_object(zend_object *obj) {
43 	return (ze_xmlwriter_object *)((char*)(obj) - XtOffsetOf(ze_xmlwriter_object, std));
44 }
45 
46 #define Z_XMLWRITER_P(zv) php_xmlwriter_fetch_object(Z_OBJ_P((zv)))
47 
48 #endif	/* PHP_XMLWRITER_H */
49