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, 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);
12 static COMP_METHOD rle_method={
23 COMP_METHOD *COMP_rle(void)
28 static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
29 unsigned int olen, unsigned char *in, unsigned int ilen)
33 if (ilen == 0 || olen < (ilen-1))
35 /* ZZZZZZZZZZZZZZZZZZZZZZ */
44 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
45 unsigned int olen, unsigned char *in, unsigned int ilen)
51 /* ZZZZZZZZZZZZZZZZZZZZZZ */
58 memcpy(out,in,ilen-1);