1 /* $OpenBSD: comp.h,v 1.9 2022/01/14 08:21:12 tb Exp $ */
2 
3 #ifndef HEADER_COMP_H
4 #define HEADER_COMP_H
5 
6 #include <openssl/crypto.h>
7 
8 #ifdef  __cplusplus
9 extern "C" {
10 #endif
11 
12 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
13 void COMP_CTX_free(COMP_CTX *ctx);
14 int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
15     unsigned char *in, int ilen);
16 int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
17     unsigned char *in, int ilen);
18 COMP_METHOD *COMP_rle(void );
19 COMP_METHOD *COMP_zlib(void );
20 void COMP_zlib_cleanup(void);
21 
22 #ifdef HEADER_BIO_H
23 #ifdef ZLIB
24 BIO_METHOD *BIO_f_zlib(void);
25 #endif
26 #endif
27 
28 void ERR_load_COMP_strings(void);
29 
30 /* Error codes for the COMP functions. */
31 
32 /* Function codes. */
33 #define COMP_F_BIO_ZLIB_FLUSH				 99
34 #define COMP_F_BIO_ZLIB_NEW				 100
35 #define COMP_F_BIO_ZLIB_READ				 101
36 #define COMP_F_BIO_ZLIB_WRITE				 102
37 
38 /* Reason codes. */
39 #define COMP_R_ZLIB_DEFLATE_ERROR			 99
40 #define COMP_R_ZLIB_INFLATE_ERROR			 100
41 #define COMP_R_ZLIB_NOT_SUPPORTED			 101
42 
43 #ifdef  __cplusplus
44 }
45 #endif
46 #endif
47