Eneboo - Documentación para desarrolladores
|
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; /* NID for compression library */ 00016 const char *name; /* A text string to identify the library */ 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 /* The following two do NOTHING, but are kept for backward compatibility */ 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 void COMP_zlib_cleanup(void); 00051 00052 #ifdef HEADER_BIO_H 00053 #ifdef ZLIB 00054 BIO_METHOD *BIO_f_zlib(void); 00055 #endif 00056 #endif 00057 00058 /* BEGIN ERROR CODES */ 00059 /* The following lines are auto generated by the script mkerr.pl. Any changes 00060 * made after this point may be overwritten when the script is next run. 00061 */ 00062 void ERR_load_COMP_strings(void); 00063 00064 /* Error codes for the COMP functions. */ 00065 00066 /* Function codes. */ 00067 #define COMP_F_BIO_ZLIB_FLUSH 99 00068 #define COMP_F_BIO_ZLIB_NEW 100 00069 #define COMP_F_BIO_ZLIB_READ 101 00070 #define COMP_F_BIO_ZLIB_WRITE 102 00071 00072 /* Reason codes. */ 00073 #define COMP_R_ZLIB_DEFLATE_ERROR 99 00074 #define COMP_R_ZLIB_INFLATE_ERROR 100 00075 #define COMP_R_ZLIB_NOT_SUPPORTED 101 00076 00077 #ifdef __cplusplus 00078 } 00079 #endif 00080 #endif