comp.h
Go to the documentation of this file.00001
00002 #ifndef HEADER_COMP_H
00003 #define HEADER_COMP_H
00004
00005 #include <openssl/crypto.h>
00006
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010
00011 typedef struct comp_ctx_st COMP_CTX;
00012
00013 typedef struct comp_method_st
00014 {
00015 int type;
00016 const char *name;
00017 int (*init)(COMP_CTX *ctx);
00018 void (*finish)(COMP_CTX *ctx);
00019 int (*compress)(COMP_CTX *ctx,
00020 unsigned char *out, unsigned int olen,
00021 unsigned char *in, unsigned int ilen);
00022 int (*expand)(COMP_CTX *ctx,
00023 unsigned char *out, unsigned int olen,
00024 unsigned char *in, unsigned int ilen);
00025
00026 long (*ctrl)(void);
00027 long (*callback_ctrl)(void);
00028 } COMP_METHOD;
00029
00030 struct comp_ctx_st
00031 {
00032 COMP_METHOD *meth;
00033 unsigned long compress_in;
00034 unsigned long compress_out;
00035 unsigned long expand_in;
00036 unsigned long expand_out;
00037
00038 CRYPTO_EX_DATA ex_data;
00039 };
00040
00041
00042 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
00043 void COMP_CTX_free(COMP_CTX *ctx);
00044 int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
00045 unsigned char *in, int ilen);
00046 int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
00047 unsigned char *in, int ilen);
00048 COMP_METHOD *COMP_rle(void );
00049 COMP_METHOD *COMP_zlib(void );
00050
00051
00052
00053
00054
00055 void ERR_load_COMP_strings(void);
00056
00057
00058
00059
00060
00061
00062
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066 #endif