Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_zlib.h
Go to the documentation of this file.
1/*
2 * Nilorea Library
3 * Copyright (C) 2005-2026 Castagnier Mickael
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
26#ifndef __N__Z_LIB_HEADER
27#define __N__Z_LIB_HEADER
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <zlib.h>
34#include "n_str.h"
35
42size_t GetMaxCompressedLen(size_t nLenSrc);
44size_t CompressData(unsigned char* abSrc, size_t nLenSrc, unsigned char* abDst, size_t nLenDst);
46size_t UncompressData(unsigned char* abSrc, size_t nLenSrc, unsigned char* abDst, size_t nLenDst);
47
49N_STR* zip_nstr(N_STR* src);
52
57#ifdef __cplusplus
58}
59#endif
60
61#endif // header guard
A box including a string and his lenght.
Definition n_str.h:60
size_t GetMaxCompressedLen(size_t nLenSrc)
Return the maximum compressed size.
Definition n_zlib.c:41
size_t CompressData(unsigned char *abSrc, size_t nLenSrc, unsigned char *abDst, size_t nLenDst)
Compress a string to another.
Definition n_zlib.c:54
size_t UncompressData(unsigned char *abSrc, size_t nLenSrc, unsigned char *abDst, size_t nLenDst)
Uncompress a string to another.
Definition n_zlib.c:111
N_STR * unzip_nstr(N_STR *src)
Return an uncompressed version of src.
Definition n_zlib.c:216
N_STR * zip_nstr(N_STR *src)
Return a compressed version of src.
Definition n_zlib.c:165
N_STR and string function declaration.