diff options
author | cvs2svn <admin@example.com> | 2002-03-12 00:05:45 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2002-03-12 00:05:45 +0000 |
commit | 3779f2f4a8b544a7e4c362915322726b66cff114 (patch) | |
tree | b6d77e66cbfdf6c0d8953fba2917f26f86fa50f6 /src/lib/libcrypto/comp/c_rle.c | |
parent | f39945c2b3b0f9e4950384bdb8effdac6eed9199 (diff) | |
download | openbsd-OPENBSD_3_1_BASE.tar.gz openbsd-OPENBSD_3_1_BASE.tar.bz2 openbsd-OPENBSD_3_1_BASE.zip |
This commit was manufactured by cvs2git to create tag 'OPENBSD_3_1_BASE'.OPENBSD_3_1_BASE
Diffstat (limited to 'src/lib/libcrypto/comp/c_rle.c')
-rw-r--r-- | src/lib/libcrypto/comp/c_rle.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/lib/libcrypto/comp/c_rle.c b/src/lib/libcrypto/comp/c_rle.c deleted file mode 100644 index 1a819e3737..0000000000 --- a/src/lib/libcrypto/comp/c_rle.c +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | #include <openssl/objects.h> | ||
5 | #include <openssl/comp.h> | ||
6 | |||
7 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, | ||
8 | unsigned int olen, unsigned char *in, unsigned int ilen); | ||
9 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | ||
10 | unsigned int olen, unsigned char *in, unsigned int ilen); | ||
11 | |||
12 | static COMP_METHOD rle_method={ | ||
13 | NID_rle_compression, | ||
14 | LN_rle_compression, | ||
15 | NULL, | ||
16 | NULL, | ||
17 | rle_compress_block, | ||
18 | rle_expand_block, | ||
19 | NULL, | ||
20 | }; | ||
21 | |||
22 | COMP_METHOD *COMP_rle(void) | ||
23 | { | ||
24 | return(&rle_method); | ||
25 | } | ||
26 | |||
27 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, | ||
28 | unsigned int olen, unsigned char *in, unsigned int ilen) | ||
29 | { | ||
30 | /* int i; */ | ||
31 | |||
32 | if (olen < (ilen+1)) | ||
33 | { | ||
34 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | ||
35 | return(-1); | ||
36 | } | ||
37 | |||
38 | *(out++)=0; | ||
39 | memcpy(out,in,ilen); | ||
40 | return(ilen+1); | ||
41 | } | ||
42 | |||
43 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | ||
44 | unsigned int olen, unsigned char *in, unsigned int ilen) | ||
45 | { | ||
46 | int i; | ||
47 | |||
48 | if (olen < (ilen-1)) | ||
49 | { | ||
50 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | ||
51 | return(-1); | ||
52 | } | ||
53 | |||
54 | i= *(in++); | ||
55 | if (i == 0) | ||
56 | { | ||
57 | memcpy(out,in,ilen-1); | ||
58 | } | ||
59 | return(ilen-1); | ||
60 | } | ||
61 | |||