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;      /* 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 
00051 /* BEGIN ERROR CODES */
00052 /* The following lines are auto generated by the script mkerr.pl. Any changes
00053  * made after this point may be overwritten when the script is next run.
00054  */
00055 void ERR_load_COMP_strings(void);
00056 
00057 /* Error codes for the COMP functions. */
00058 
00059 /* Function codes. */
00060 
00061 /* Reason codes. */
00062 
00063 #ifdef  __cplusplus
00064 }
00065 #endif
00066 #endif

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6