comp.h revision 68651
1185377Ssam 2187831Ssam#ifndef HEADER_COMP_H 3185377Ssam#define HEADER_COMP_H 4185377Ssam 5185377Ssam#include <openssl/crypto.h> 6185377Ssam 7185377Ssam#ifdef __cplusplus 8185377Ssamextern "C" { 9185377Ssam#endif 10185377Ssam 11185377Ssamtypedef struct comp_method_st 12185377Ssam { 13185377Ssam int type; /* NID for compression library */ 14185377Ssam const char *name; /* A text string to identify the library */ 15185377Ssam int (*init)(); 16185377Ssam void (*finish)(); 17187611Ssam int (*compress)(); 18185377Ssam int (*expand)(); 19185377Ssam long (*ctrl)(); 20185377Ssam long (*callback_ctrl)(); 21185377Ssam } COMP_METHOD; 22185377Ssam 23185377Ssamtypedef struct comp_ctx_st 24185377Ssam { 25185377Ssam COMP_METHOD *meth; 26185377Ssam unsigned long compress_in; 27185377Ssam unsigned long compress_out; 28185377Ssam unsigned long expand_in; 29185377Ssam unsigned long expand_out; 30185377Ssam 31185377Ssam CRYPTO_EX_DATA ex_data; 32185377Ssam } COMP_CTX; 33185377Ssam 34185377Ssam 35185377SsamCOMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 36185377Ssamvoid COMP_CTX_free(COMP_CTX *ctx); 37185377Ssamint COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 38185377Ssam unsigned char *in, int ilen); 39185377Ssamint COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 40185377Ssam unsigned char *in, int ilen); 41185377SsamCOMP_METHOD *COMP_rle(void ); 42185377Ssam#ifdef ZLIB 43187831SsamCOMP_METHOD *COMP_zlib(void ); 44185377Ssam#endif 45185377Ssam 46185377Ssam/* BEGIN ERROR CODES */ 47217930Sadrian/* The following lines are auto generated by the script mkerr.pl. Any changes 48219218Sadrian * made after this point may be overwritten when the script is next run. 49185377Ssam */ 50185377Ssam 51187831Ssam/* Error codes for the COMP functions. */ 52185377Ssam 53187831Ssam/* Function codes. */ 54185377Ssam 55185377Ssam/* Reason codes. */ 56185377Ssam 57185377Ssam#ifdef __cplusplus 58185377Ssam} 59187831Ssam#endif 60185377Ssam#endif 61185377Ssam 62185377Ssam