comp.h

Go to the documentation of this file.
00001 /*
00002  © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
00003  */
00004 
00005 #ifndef HEADER_COMP_H
00006 #define HEADER_COMP_H
00007 
00008 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00009 #define SYMBIAN
00010 #endif
00011 
00012 #ifdef SYMBIAN
00013 #include <e32def.h>
00014 #endif
00015 #include <openssl/crypto.h>
00016 
00017 #ifdef  __cplusplus
00018 extern "C" {
00019 #endif
00020 #ifdef SYMBIAN
00021 #include <e32def.h>
00022 #endif
00023 typedef struct comp_ctx_st COMP_CTX;
00024 
00025 typedef struct comp_method_st
00026         {
00027         int type;               /* NID for compression library */
00028         const char *name;       /* A text string to identify the library */
00029         int (*init)(COMP_CTX *ctx);
00030         void (*finish)(COMP_CTX *ctx);
00031         int (*compress)(COMP_CTX *ctx,
00032                         unsigned char *out, unsigned int olen,
00033                         unsigned char *in, unsigned int ilen);
00034         int (*expand)(COMP_CTX *ctx,
00035                       unsigned char *out, unsigned int olen,
00036                       unsigned char *in, unsigned int ilen);
00037         /* The following two do NOTHING, but are kept for backward compatibility */
00038         long (*ctrl)(void);
00039         long (*callback_ctrl)(void);
00040         } COMP_METHOD;
00041 
00042 struct comp_ctx_st
00043         {
00044         COMP_METHOD *meth;
00045         unsigned long compress_in;
00046         unsigned long compress_out;
00047         unsigned long expand_in;
00048         unsigned long expand_out;
00049 
00050         CRYPTO_EX_DATA  ex_data;
00051         };
00052 
00053 
00054 IMPORT_C COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
00055 IMPORT_C void COMP_CTX_free(COMP_CTX *ctx);
00056 IMPORT_C int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
00057         unsigned char *in, int ilen);
00058 IMPORT_C int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
00059         unsigned char *in, int ilen);
00060 IMPORT_C COMP_METHOD *COMP_rle(void );
00061 IMPORT_C COMP_METHOD *COMP_zlib(void );
00062 
00063 /* BEGIN ERROR CODES */
00064 /* The following lines are auto generated by the script mkerr.pl. Any changes
00065  * made after this point may be overwritten when the script is next run.
00066  */
00067 IMPORT_C void ERR_load_COMP_strings(void);
00068 
00069 /* Error codes for the COMP functions. */
00070 
00071 /* Function codes. */
00072 
00073 /* Reason codes. */
00074 
00075 #ifdef  __cplusplus
00076 }
00077 #endif
00078 #endif

Copyright © Nokia Corporation 2001-2008
Back to top