3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 2) as published by the FSF - Free Software
15 /* os_compress: Compress a string with zlib. */
16 int os_compress(char *src, char *dst, int src_size, int dst_size)
18 unsigned long int zl_dst = dst_size;
20 /* We make sure to do not allow long sizes */
21 if(compress2((unsigned char *)dst,
24 (unsigned long int)src_size, 9) == Z_OK)
34 /* os_uncompress: Uncompress a string with zlib. */
35 int os_uncompress(char *src, char *dst, int src_size, int dst_size)
37 unsigned long int zl_dst = dst_size;
39 if(uncompress((unsigned char *)dst,
42 (unsigned long int)src_size) == Z_OK)