xref: /PHP-5.3/ext/bz2/php_bz2.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   | Author: Sterling Hughes <sterling@php.net>                           |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
20 
21 #ifndef PHP_BZ2_H
22 #define PHP_BZ2_H
23 
24 #if HAVE_BZ2
25 
26 extern zend_module_entry bz2_module_entry;
27 #define phpext_bz2_ptr &bz2_module_entry
28 
29 /* Bzip2 includes */
30 #include <bzlib.h>
31 
32 #else
33 #define phpext_bz2_ptr NULL
34 #endif
35 
36 #ifdef PHP_WIN32
37 #	ifdef PHP_BZ2_EXPORTS
38 #		define PHP_BZ2_API __declspec(dllexport)
39 #	elif defined(COMPILE_DL_BZ2)
40 #		define PHP_BZ2_API __declspec(dllimport)
41 #	else
42 #		define PHP_BZ2_API /* nothing special */
43 #	endif
44 #elif defined(__GNUC__) && __GNUC__ >= 4
45 #	define PHP_BZ2_API __attribute__ ((visibility("default")))
46 #else
47 #	define PHP_BZ2_API
48 #endif
49 
50 PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
51 PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
52 
53 #define php_stream_bz2open_from_BZFILE(bz, mode, innerstream)	_php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
54 #define php_stream_bz2open(wrapper, path, mode, options, opened_path)	_php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
55 
56 extern php_stream_filter_factory php_bz2_filter_factory;
57 extern php_stream_ops php_stream_bz2io_ops;
58 #define PHP_STREAM_IS_BZIP2	&php_stream_bz2io_ops
59 
60 /* 400kb */
61 #define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE        4
62 
63 /* BZ2 Internal Default */
64 #define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR       0
65 
66 #endif
67 
68 
69 /*
70  * Local variables:
71  * tab-width: 4
72  * c-basic-offset: 4
73  * End:
74  */
75