xref: /PHP-5.3/ext/zlib/php_zlib.h (revision a2045ff3)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2013 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: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
16    |          Stefan R�hrich <sr@linux.de>                                |
17    +----------------------------------------------------------------------+
18 */
19 
20 /* $Id$ */
21 
22 #ifndef PHP_ZLIB_H
23 #define PHP_ZLIB_H
24 
25 #include <zlib.h>
26 
27 ZEND_BEGIN_MODULE_GLOBALS(zlib)
28 	/* variables for transparent gzip encoding */
29 	int compression_coding;
30 	z_stream stream;
31 	uLong crc;
32 	int ob_gzhandler_status;
33 	long output_compression;
34 	long output_compression_level;
35 	char *output_handler;
36 ZEND_END_MODULE_GLOBALS(zlib)
37 
38 PHPAPI ZEND_EXTERN_MODULE_GLOBALS(zlib)
39 
40 extern php_stream_filter_factory php_zlib_filter_factory;
41 extern zend_module_entry php_zlib_module_entry;
42 #define zlib_module_ptr &php_zlib_module_entry
43 
44 int php_ob_gzhandler_check(TSRMLS_D);
45 
46 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
47 extern php_stream_wrapper php_stream_gzip_wrapper;
48 
49 #ifdef ZTS
50 #define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
51 #else
52 #define ZLIBG(v) (zlib_globals.v)
53 #endif
54 
55 #define phpext_zlib_ptr zlib_module_ptr
56 
57 #define CODING_GZIP		1
58 #define CODING_DEFLATE	2
59 
60 #endif /* PHP_ZLIB_H */
61 
62 /*
63  * Local variables:
64  * tab-width: 4
65  * c-basic-offset: 4
66  * indent-tabs-mode: t
67  * End:
68  */
69