1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
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
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, const char *path, const 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, const 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
61 #define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE 4
62
63
64 #define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR 0
65
66 #endif
67
68
69
70
71
72
73
74