24b992f0c46fd6fb7b6d4d15f2f9e90083d22f30
[ossec-hids.git] / src / os_zlib / os_zlib.h
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All rights reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation
8  */
9
10
11 #ifndef __OS_ZLIB_H
12 #define __OS_ZLIB_H
13
14 #include "zlib.h"
15
16 /**
17  * @brief Compress a string with zlib.
18  * @param[in] src the source string to compress
19  * @param[out] dst the destination buffer for the compressed string, will be null-terminated on success
20  * @param[in] src_size the length of the source string
21  * @param[in] dst_size the size of the destination buffer
22  * @return 0 on failure, else the length of the compressed string
23  */
24 unsigned long int os_zlib_compress(const char *src, char *dst, unsigned long int src_size,
25                 unsigned long int dst_size);
26
27 /**
28  * @brief Uncompress a string with zlib.
29  * @param[in] src the source string to uncompress
30  * @param[out] dst the destination buffer for the uncompressed string, will be null-terminated on success
31  * @param[in] src_size the length of the source string
32  * @param[in] dst_size the size of the destination buffer
33  * @return 0 on failure, else the length of the uncompressed string
34  */
35 unsigned long int os_zlib_uncompress(const char *src, char *dst, unsigned long int src_size,
36                 unsigned long int dst_size);
37
38 #endif /* __OS_ZLIB_H */
39
40 /* EOF */