1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ssl/libcrypto/src/crypto/comp/comp.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,99 @@
1.4 +/*
1.5 +Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.6 +
1.7 +Redistribution and use in source and binary forms, with or without
1.8 +modification, are permitted provided that the following conditions are met:
1.9 +
1.10 +* Redistributions of source code must retain the above copyright notice, this
1.11 + list of conditions and the following disclaimer.
1.12 +* Redistributions in binary form must reproduce the above copyright notice,
1.13 + this list of conditions and the following disclaimer in the documentation
1.14 + and/or other materials provided with the distribution.
1.15 +* Neither the name of Nokia Corporation nor the names of its contributors
1.16 + may be used to endorse or promote products derived from this software
1.17 + without specific prior written permission.
1.18 +
1.19 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1.20 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.21 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1.22 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
1.23 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.24 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1.25 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1.26 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1.27 +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1.28 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.29 +
1.30 +Description:
1.31 +*/
1.32 +
1.33 +
1.34 +#ifndef HEADER_COMP_H
1.35 +#define HEADER_COMP_H
1.36 +#ifdef SYMBIAN
1.37 +#include <e32def.h>
1.38 +#endif
1.39 +#include <openssl/crypto.h>
1.40 +
1.41 +#ifdef __cplusplus
1.42 +extern "C" {
1.43 +#endif
1.44 +#ifdef SYMBIAN
1.45 +#include <e32def.h>
1.46 +#endif
1.47 +typedef struct comp_ctx_st COMP_CTX;
1.48 +
1.49 +typedef struct comp_method_st
1.50 + {
1.51 + int type; /* NID for compression library */
1.52 + const char *name; /* A text string to identify the library */
1.53 + int (*init)(COMP_CTX *ctx);
1.54 + void (*finish)(COMP_CTX *ctx);
1.55 + int (*compress)(COMP_CTX *ctx,
1.56 + unsigned char *out, unsigned int olen,
1.57 + unsigned char *in, unsigned int ilen);
1.58 + int (*expand)(COMP_CTX *ctx,
1.59 + unsigned char *out, unsigned int olen,
1.60 + unsigned char *in, unsigned int ilen);
1.61 + /* The following two do NOTHING, but are kept for backward compatibility */
1.62 + long (*ctrl)(void);
1.63 + long (*callback_ctrl)(void);
1.64 + } COMP_METHOD;
1.65 +
1.66 +struct comp_ctx_st
1.67 + {
1.68 + COMP_METHOD *meth;
1.69 + unsigned long compress_in;
1.70 + unsigned long compress_out;
1.71 + unsigned long expand_in;
1.72 + unsigned long expand_out;
1.73 +
1.74 + CRYPTO_EX_DATA ex_data;
1.75 + };
1.76 +
1.77 +
1.78 +IMPORT_C COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
1.79 +IMPORT_C void COMP_CTX_free(COMP_CTX *ctx);
1.80 +IMPORT_C int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
1.81 + unsigned char *in, int ilen);
1.82 +IMPORT_C int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
1.83 + unsigned char *in, int ilen);
1.84 +IMPORT_C COMP_METHOD *COMP_rle(void );
1.85 +IMPORT_C COMP_METHOD *COMP_zlib(void );
1.86 +
1.87 +/* BEGIN ERROR CODES */
1.88 +/* The following lines are auto generated by the script mkerr.pl. Any changes
1.89 + * made after this point may be overwritten when the script is next run.
1.90 + */
1.91 +IMPORT_C void ERR_load_COMP_strings(void);
1.92 +
1.93 +/* Error codes for the COMP functions. */
1.94 +
1.95 +/* Function codes. */
1.96 +
1.97 +/* Reason codes. */
1.98 +
1.99 +#ifdef __cplusplus
1.100 +}
1.101 +#endif
1.102 +#endif