diff options
Diffstat (limited to 'src/lib/libcrypto/comp/comp.h')
-rw-r--r-- | src/lib/libcrypto/comp/comp.h | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/lib/libcrypto/comp/comp.h b/src/lib/libcrypto/comp/comp.h index ab48b78ae9..4b405c7d49 100644 --- a/src/lib/libcrypto/comp/comp.h +++ b/src/lib/libcrypto/comp/comp.h | |||
@@ -8,19 +8,26 @@ | |||
8 | extern "C" { | 8 | extern "C" { |
9 | #endif | 9 | #endif |
10 | 10 | ||
11 | typedef struct comp_ctx_st COMP_CTX; | ||
12 | |||
11 | typedef struct comp_method_st | 13 | typedef struct comp_method_st |
12 | { | 14 | { |
13 | int type; /* NID for compression library */ | 15 | int type; /* NID for compression library */ |
14 | const char *name; /* A text string to identify the library */ | 16 | const char *name; /* A text string to identify the library */ |
15 | int (*init)(); | 17 | int (*init)(COMP_CTX *ctx); |
16 | void (*finish)(); | 18 | void (*finish)(COMP_CTX *ctx); |
17 | int (*compress)(); | 19 | int (*compress)(COMP_CTX *ctx, |
18 | int (*expand)(); | 20 | unsigned char *out, unsigned int olen, |
19 | long (*ctrl)(); | 21 | unsigned char *in, unsigned int ilen); |
20 | long (*callback_ctrl)(); | 22 | int (*expand)(COMP_CTX *ctx, |
23 | unsigned char *out, unsigned int olen, | ||
24 | unsigned char *in, unsigned int ilen); | ||
25 | /* The following two do NOTHING, but are kept for backward compatibility */ | ||
26 | long (*ctrl)(void); | ||
27 | long (*callback_ctrl)(void); | ||
21 | } COMP_METHOD; | 28 | } COMP_METHOD; |
22 | 29 | ||
23 | typedef struct comp_ctx_st | 30 | struct comp_ctx_st |
24 | { | 31 | { |
25 | COMP_METHOD *meth; | 32 | COMP_METHOD *meth; |
26 | unsigned long compress_in; | 33 | unsigned long compress_in; |
@@ -29,7 +36,7 @@ typedef struct comp_ctx_st | |||
29 | unsigned long expand_out; | 36 | unsigned long expand_out; |
30 | 37 | ||
31 | CRYPTO_EX_DATA ex_data; | 38 | CRYPTO_EX_DATA ex_data; |
32 | } COMP_CTX; | 39 | }; |
33 | 40 | ||
34 | 41 | ||
35 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); |
@@ -40,6 +47,13 @@ int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, | |||
40 | unsigned char *in, int ilen); | 47 | unsigned char *in, int ilen); |
41 | COMP_METHOD *COMP_rle(void ); | 48 | COMP_METHOD *COMP_rle(void ); |
42 | COMP_METHOD *COMP_zlib(void ); | 49 | COMP_METHOD *COMP_zlib(void ); |
50 | void COMP_zlib_cleanup(void); | ||
51 | |||
52 | #ifdef HEADER_BIO_H | ||
53 | #ifdef ZLIB | ||
54 | BIO_METHOD *BIO_f_zlib(void); | ||
55 | #endif | ||
56 | #endif | ||
43 | 57 | ||
44 | /* BEGIN ERROR CODES */ | 58 | /* BEGIN ERROR CODES */ |
45 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
@@ -50,8 +64,15 @@ void ERR_load_COMP_strings(void); | |||
50 | /* Error codes for the COMP functions. */ | 64 | /* Error codes for the COMP functions. */ |
51 | 65 | ||
52 | /* Function codes. */ | 66 | /* Function codes. */ |
67 | #define COMP_F_BIO_ZLIB_FLUSH 99 | ||
68 | #define COMP_F_BIO_ZLIB_NEW 100 | ||
69 | #define COMP_F_BIO_ZLIB_READ 101 | ||
70 | #define COMP_F_BIO_ZLIB_WRITE 102 | ||
53 | 71 | ||
54 | /* Reason codes. */ | 72 | /* Reason codes. */ |
73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 | ||
74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 | ||
75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 | ||
55 | 76 | ||
56 | #ifdef __cplusplus | 77 | #ifdef __cplusplus |
57 | } | 78 | } |