summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/comp/c_rle.c
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2001-10-01 21:58:54 +0000
committercvs2svn <admin@example.com>2001-10-01 21:58:54 +0000
commit2b482d950b0e856294fcd4c1068c1b21939a7240 (patch)
treeaa05f6be64877f76547f1b54ad84f7bfcb291f5d /src/lib/libcrypto/comp/c_rle.c
parentd7b0aad33e28dafbbef67eb5b84ecb05a844fc88 (diff)
downloadopenbsd-OPENBSD_3_0_BASE.tar.gz
openbsd-OPENBSD_3_0_BASE.tar.bz2
openbsd-OPENBSD_3_0_BASE.zip
This commit was manufactured by cvs2git to create tag 'OPENBSD_3_0_BASE'.OPENBSD_3_0_BASE
Diffstat (limited to 'src/lib/libcrypto/comp/c_rle.c')
-rw-r--r--src/lib/libcrypto/comp/c_rle.c61
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
7static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
8 unsigned int olen, unsigned char *in, unsigned int ilen);
9static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
10 unsigned int olen, unsigned char *in, unsigned int ilen);
11
12static 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
22COMP_METHOD *COMP_rle(void)
23 {
24 return(&rle_method);
25 }
26
27static 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
43static 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