|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef HEADER_COMP_H |
|
21 #define HEADER_COMP_H |
|
22 |
|
23 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN)) |
|
24 #define SYMBIAN |
|
25 #endif |
|
26 |
|
27 #ifdef SYMBIAN |
|
28 #include <e32def.h> |
|
29 #endif |
|
30 #include <openssl/crypto.h> |
|
31 |
|
32 #ifdef __cplusplus |
|
33 extern "C" { |
|
34 #endif |
|
35 #ifdef SYMBIAN |
|
36 #include <e32def.h> |
|
37 #endif |
|
38 typedef struct comp_ctx_st COMP_CTX; |
|
39 |
|
40 typedef struct comp_method_st |
|
41 { |
|
42 int type; /* NID for compression library */ |
|
43 const char *name; /* A text string to identify the library */ |
|
44 int (*init)(COMP_CTX *ctx); |
|
45 void (*finish)(COMP_CTX *ctx); |
|
46 int (*compress)(COMP_CTX *ctx, |
|
47 unsigned char *out, unsigned int olen, |
|
48 unsigned char *in, unsigned int ilen); |
|
49 int (*expand)(COMP_CTX *ctx, |
|
50 unsigned char *out, unsigned int olen, |
|
51 unsigned char *in, unsigned int ilen); |
|
52 /* The following two do NOTHING, but are kept for backward compatibility */ |
|
53 long (*ctrl)(void); |
|
54 long (*callback_ctrl)(void); |
|
55 } COMP_METHOD; |
|
56 |
|
57 struct comp_ctx_st |
|
58 { |
|
59 COMP_METHOD *meth; |
|
60 unsigned long compress_in; |
|
61 unsigned long compress_out; |
|
62 unsigned long expand_in; |
|
63 unsigned long expand_out; |
|
64 |
|
65 CRYPTO_EX_DATA ex_data; |
|
66 }; |
|
67 |
|
68 |
|
69 IMPORT_C COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); |
|
70 IMPORT_C void COMP_CTX_free(COMP_CTX *ctx); |
|
71 IMPORT_C int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, |
|
72 unsigned char *in, int ilen); |
|
73 IMPORT_C int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, |
|
74 unsigned char *in, int ilen); |
|
75 IMPORT_C COMP_METHOD *COMP_rle(void ); |
|
76 IMPORT_C COMP_METHOD *COMP_zlib(void ); |
|
77 |
|
78 /* BEGIN ERROR CODES */ |
|
79 /* The following lines are auto generated by the script mkerr.pl. Any changes |
|
80 * made after this point may be overwritten when the script is next run. |
|
81 */ |
|
82 IMPORT_C void ERR_load_COMP_strings(void); |
|
83 |
|
84 /* Error codes for the COMP functions. */ |
|
85 |
|
86 /* Function codes. */ |
|
87 |
|
88 /* Reason codes. */ |
|
89 |
|
90 #ifdef __cplusplus |
|
91 } |
|
92 #endif |
|
93 #endif |