comp.h 2.0 KB
Newer Older
R
Rich Salz 已提交
1 2
/*
 * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
R
Rich Salz 已提交
3
 *
R
Rich Salz 已提交
4 5 6 7
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
R
Rich Salz 已提交
8 9
 */

10
#ifndef HEADER_COMP_H
11
# define HEADER_COMP_H
12

R
Rich Salz 已提交
13
# include <openssl/opensslconf.h>
14

R
Rich Salz 已提交
15 16 17 18
# ifndef OPENSSL_NO_COMP
# include <openssl/crypto.h>
# ifdef  __cplusplus
extern "C" {
19 20
# endif

21 22 23


COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
R
Rich Salz 已提交
24 25 26 27
const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
int COMP_CTX_get_type(const COMP_CTX* comp);
int COMP_get_type(const COMP_METHOD *meth);
const char *COMP_get_name(const COMP_METHOD *meth);
28
void COMP_CTX_free(COMP_CTX *ctx);
R
Rich Salz 已提交
29

30
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
31
                        unsigned char *in, int ilen);
32
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
33
                      unsigned char *in, int ilen);
R
Rich Salz 已提交
34

35
COMP_METHOD *COMP_zlib(void);
36 37

#if OPENSSL_API_COMPAT < 0x10100000L
M
Matt Caswell 已提交
38
#define COMP_zlib_cleanup() while(0) continue
39
#endif
D
Dr. Stephen Henson 已提交
40

41 42
# ifdef HEADER_BIO_H
#  ifdef ZLIB
43
const BIO_METHOD *BIO_f_zlib(void);
44 45
#  endif
# endif
46 47

/* BEGIN ERROR CODES */
48 49
/*
 * The following lines are auto generated by the script mkerr.pl. Any changes
50 51
 * made after this point may be overwritten when the script is next run.
 */
R
Rich Salz 已提交
52

53
void ERR_load_COMP_strings(void);
54 55 56 57

/* Error codes for the COMP functions. */

/* Function codes. */
58 59 60 61
# define COMP_F_BIO_ZLIB_FLUSH                            99
# define COMP_F_BIO_ZLIB_NEW                              100
# define COMP_F_BIO_ZLIB_READ                             101
# define COMP_F_BIO_ZLIB_WRITE                            102
62 63

/* Reason codes. */
64 65 66
# define COMP_R_ZLIB_DEFLATE_ERROR                        99
# define COMP_R_ZLIB_INFLATE_ERROR                        100
# define COMP_R_ZLIB_NOT_SUPPORTED                        101
67

R
Rich Salz 已提交
68
#  ifdef  __cplusplus
69
}
R
Rich Salz 已提交
70
#  endif
R
Rich Salz 已提交
71
# endif
72
#endif