williamr@2: /* williamr@2: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. williamr@2: williamr@2: * Redistribution and use in source and binary forms, with or without williamr@2: * modification, are permitted provided that the following conditions are met: williamr@2: williamr@2: * Redistributions of source code must retain the above copyright notice, this williamr@2: * list of conditions and the following disclaimer. williamr@2: * Redistributions in binary form must reproduce the above copyright notice, williamr@2: * this list of conditions and the following disclaimer in the documentation williamr@2: * and/or other materials provided with the distribution. williamr@2: * Neither the name of Nokia Corporation nor the names of its contributors williamr@2: * may be used to endorse or promote products derived from this software williamr@2: * without specific prior written permission. williamr@2: williamr@2: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" williamr@2: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE williamr@2: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE williamr@2: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE williamr@2: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL williamr@2: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR williamr@2: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER williamr@2: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, williamr@2: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE williamr@2: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef HEADER_COMP_H williamr@2: #define HEADER_COMP_H williamr@2: williamr@2: #if (defined(__SYMBIAN32__) && !defined(SYMBIAN)) williamr@2: #define SYMBIAN williamr@2: #endif williamr@2: williamr@2: #ifdef SYMBIAN williamr@2: #include williamr@2: #endif williamr@2: #include williamr@2: williamr@2: #ifdef __cplusplus williamr@2: extern "C" { williamr@2: #endif williamr@2: #ifdef SYMBIAN williamr@2: #include williamr@2: #endif williamr@2: typedef struct comp_ctx_st COMP_CTX; williamr@2: williamr@2: typedef struct comp_method_st williamr@2: { williamr@2: int type; /* NID for compression library */ williamr@2: const char *name; /* A text string to identify the library */ williamr@2: int (*init)(COMP_CTX *ctx); williamr@2: void (*finish)(COMP_CTX *ctx); williamr@2: int (*compress)(COMP_CTX *ctx, williamr@2: unsigned char *out, unsigned int olen, williamr@2: unsigned char *in, unsigned int ilen); williamr@2: int (*expand)(COMP_CTX *ctx, williamr@2: unsigned char *out, unsigned int olen, williamr@2: unsigned char *in, unsigned int ilen); williamr@2: /* The following two do NOTHING, but are kept for backward compatibility */ williamr@2: long (*ctrl)(void); williamr@2: long (*callback_ctrl)(void); williamr@2: } COMP_METHOD; williamr@2: williamr@2: struct comp_ctx_st williamr@2: { williamr@2: COMP_METHOD *meth; williamr@2: unsigned long compress_in; williamr@2: unsigned long compress_out; williamr@2: unsigned long expand_in; williamr@2: unsigned long expand_out; williamr@2: williamr@2: CRYPTO_EX_DATA ex_data; williamr@2: }; williamr@2: williamr@2: williamr@2: IMPORT_C COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); williamr@2: IMPORT_C void COMP_CTX_free(COMP_CTX *ctx); williamr@2: IMPORT_C int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, williamr@2: unsigned char *in, int ilen); williamr@2: IMPORT_C int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, williamr@2: unsigned char *in, int ilen); williamr@2: IMPORT_C COMP_METHOD *COMP_rle(void ); williamr@2: IMPORT_C COMP_METHOD *COMP_zlib(void ); williamr@2: williamr@2: /* BEGIN ERROR CODES */ williamr@2: /* The following lines are auto generated by the script mkerr.pl. Any changes williamr@2: * made after this point may be overwritten when the script is next run. williamr@2: */ williamr@2: IMPORT_C void ERR_load_COMP_strings(void); williamr@2: williamr@2: /* Error codes for the COMP functions. */ williamr@2: williamr@2: /* Function codes. */ williamr@2: williamr@2: /* Reason codes. */ williamr@2: williamr@2: #ifdef __cplusplus williamr@2: } williamr@2: #endif williamr@2: #endif