0b860845280ed776290959a8d2e7ce97285cbf80
[openssl.git] / crypto / comp / comp.h
1
2 #ifndef HEADER_COMP_H
3 #define HEADER_COMP_H
4
5 #ifdef  __cplusplus
6 extern "C" {
7 #endif
8
9 #include "crypto.h"
10
11 typedef struct comp_method_st
12         {
13         int type;               /* NID for compression library */
14         const char *name;       /* A text string to identify the library */
15         int (*init)();
16         void (*finish)();
17         int (*compress)();
18         int (*expand)();
19         long (*ctrl)();
20         } COMP_METHOD;
21
22 typedef struct comp_ctx_st
23         {
24         COMP_METHOD *meth;
25         unsigned long compress_in;
26         unsigned long compress_out;
27         unsigned long expand_in;
28         unsigned long expand_out;
29
30         CRYPTO_EX_DATA  ex_data;
31         } COMP_CTX;
32
33 #ifndef NOPROTO
34
35 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
36 void COMP_CTX_free(COMP_CTX *ctx);
37 int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
38         unsigned char *in, int ilen);
39 int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
40         unsigned char *in, int ilen);
41 COMP_METHOD *COMP_rle(void );
42 #ifdef ZLIB
43 COMP_METHOD *COMP_zlib(void );
44 #endif
45
46 #else
47
48 COMP_CTX *COMP_CTX_new();
49 void COMP_CTX_free();
50 int COMP_compress_block();
51 int COMP_expand_block();
52 COMP_METHOD *COMP_rle();
53 #ifdef ZLIB
54 COMP_METHOD *COMP_zlib();
55 #endif
56
57 #endif
58 /* BEGIN ERROR CODES */
59  
60 #ifdef  __cplusplus
61 }
62 #endif
63 #endif
64