4 #include <openssl/objects.h>
5 #include <openssl/comp.h>
7 static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
8 unsigned int olen, unsigned char *in,
10 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
11 unsigned int olen, unsigned char *in,
14 static COMP_METHOD rle_method = {
25 COMP_METHOD *COMP_rle(void)
30 static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
31 unsigned int olen, unsigned char *in,
41 memcpy(out, in, ilen);
45 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
46 unsigned int olen, unsigned char *in,
54 if (olen < (ilen - 1))
61 memcpy(out, in, ilen - 1);