-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathphp_brotli.h
64 lines (52 loc) · 1.42 KB
/
php_brotli.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef PHP_BROTLI_H
#define PHP_BROTLI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Don't forget to check BROTLI_LIB_VERSION in config.m4/w32 */
#define BROTLI_EXT_VERSION "0.15.2"
#define BROTLI_NS "Brotli"
/* brotli */
#include "brotli/encode.h"
#include "brotli/decode.h"
extern zend_module_entry brotli_module_entry;
#define phpext_brotli_ptr &brotli_module_entry
#ifdef PHP_WIN32
# define PHP_BROTLI_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_BROTLI_API __attribute__ ((visibility("default")))
#else
# define PHP_BROTLI_API
#endif
#ifdef ZTS
# include "TSRM.h"
#endif
typedef struct _php_brotli_state_context {
BrotliEncoderState *encoder;
BrotliDecoderState *decoder;
} php_brotli_state_context;
typedef struct _php_brotli_context {
php_brotli_state_context state;
size_t available_in;
const uint8_t *next_in;
size_t available_out;
uint8_t *next_out;
uint8_t *output;
} php_brotli_context;
ZEND_BEGIN_MODULE_GLOBALS(brotli)
zend_long output_compression;
zend_long output_compression_default;
zend_long output_compression_level;
zend_bool handler_registered;
int compression_coding;
php_brotli_context *ob_handler;
ZEND_END_MODULE_GLOBALS(brotli)
#ifdef ZTS
# define BROTLI_G(v) TSRMG(brotli_globals_id, zend_brotli_globals *, v)
#else
# define BROTLI_G(v) (brotli_globals.v)
#endif
#ifdef __cplusplus
}
#endif
#endif /* PHP_BROTLI_H */