diff options
author | cvs2svn <admin@example.com> | 2008-07-28 23:44:11 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2008-07-28 23:44:11 +0000 |
commit | 466614843d3969042821d3844ede52cbbbef414e (patch) | |
tree | dd1b8dd6247047a42f65a4669d862134a8e90160 /src/lib/libcrypto/comp/c_rle.c | |
parent | 10837c3c47f1b9d7d1a061fff2327a4e280ba338 (diff) | |
download | openbsd-OPENBSD_4_4_BASE.tar.gz openbsd-OPENBSD_4_4_BASE.tar.bz2 openbsd-OPENBSD_4_4_BASE.zip |
This commit was manufactured by cvs2git to create tag 'OPENBSD_4_4_BASE'.OPENBSD_4_4_BASE
Diffstat (limited to 'src/lib/libcrypto/comp/c_rle.c')
-rw-r--r-- | src/lib/libcrypto/comp/c_rle.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/lib/libcrypto/comp/c_rle.c b/src/lib/libcrypto/comp/c_rle.c deleted file mode 100644 index efd366fa22..0000000000 --- a/src/lib/libcrypto/comp/c_rle.c +++ /dev/null | |||
@@ -1,62 +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 | NULL, | ||
21 | }; | ||
22 | |||
23 | COMP_METHOD *COMP_rle(void) | ||
24 | { | ||
25 | return(&rle_method); | ||
26 | } | ||
27 | |||
28 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, | ||
29 | unsigned int olen, unsigned char *in, unsigned int ilen) | ||
30 | { | ||
31 | /* int i; */ | ||
32 | |||
33 | if (olen < (ilen+1)) | ||
34 | { | ||
35 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | ||
36 | return(-1); | ||
37 | } | ||
38 | |||
39 | *(out++)=0; | ||
40 | memcpy(out,in,ilen); | ||
41 | return(ilen+1); | ||
42 | } | ||
43 | |||
44 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | ||
45 | unsigned int olen, unsigned char *in, unsigned int ilen) | ||
46 | { | ||
47 | int i; | ||
48 | |||
49 | if (olen < (ilen-1)) | ||
50 | { | ||
51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | ||
52 | return(-1); | ||
53 | } | ||
54 | |||
55 | i= *(in++); | ||
56 | if (i == 0) | ||
57 | { | ||
58 | memcpy(out,in,ilen-1); | ||
59 | } | ||
60 | return(ilen-1); | ||
61 | } | ||
62 | |||