5 # include <openssl/crypto.h>
7 # ifdef OPENSSL_NO_COMP
8 # error COMP is disabled.
15 typedef struct comp_ctx_st COMP_CTX
;
17 typedef struct comp_method_st
{
18 int type
; /* NID for compression library */
19 const char *name
; /* A text string to identify the library */
20 int (*init
) (COMP_CTX
*ctx
);
21 void (*finish
) (COMP_CTX
*ctx
);
22 int (*compress
) (COMP_CTX
*ctx
,
23 unsigned char *out
, unsigned int olen
,
24 unsigned char *in
, unsigned int ilen
);
25 int (*expand
) (COMP_CTX
*ctx
,
26 unsigned char *out
, unsigned int olen
,
27 unsigned char *in
, unsigned int ilen
);
29 * The following two do NOTHING, but are kept for backward compatibility
32 long (*callback_ctrl
) (void);
37 unsigned long compress_in
;
38 unsigned long compress_out
;
39 unsigned long expand_in
;
40 unsigned long expand_out
;
41 CRYPTO_EX_DATA ex_data
;
44 COMP_CTX
*COMP_CTX_new(COMP_METHOD
*meth
);
45 void COMP_CTX_free(COMP_CTX
*ctx
);
46 int COMP_compress_block(COMP_CTX
*ctx
, unsigned char *out
, int olen
,
47 unsigned char *in
, int ilen
);
48 int COMP_expand_block(COMP_CTX
*ctx
, unsigned char *out
, int olen
,
49 unsigned char *in
, int ilen
);
50 COMP_METHOD
*COMP_rle(void);
51 COMP_METHOD
*COMP_zlib(void);
52 void COMP_zlib_cleanup(void);
56 BIO_METHOD
*BIO_f_zlib(void);
60 /* BEGIN ERROR CODES */
62 * The following lines are auto generated by the script mkerr.pl. Any changes
63 * made after this point may be overwritten when the script is next run.
65 void ERR_load_COMP_strings(void);
67 /* Error codes for the COMP functions. */
70 # define COMP_F_BIO_ZLIB_FLUSH 99
71 # define COMP_F_BIO_ZLIB_NEW 100
72 # define COMP_F_BIO_ZLIB_READ 101
73 # define COMP_F_BIO_ZLIB_WRITE 102
76 # define COMP_R_ZLIB_DEFLATE_ERROR 99
77 # define COMP_R_ZLIB_INFLATE_ERROR 100
78 # define COMP_R_ZLIB_NOT_SUPPORTED 101