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 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * permissions and limitations under the License.
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 */
19
27#ifndef __N__Z_LIB_HEADER
28#define __N__Z_LIB_HEADER
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <zlib.h>
35#include "n_str.h"
36
43size_t GetMaxCompressedLen(size_t nLenSrc);
45size_t CompressData(unsigned char* abSrc, size_t nLenSrc, unsigned char* abDst, size_t nLenDst);
47size_t UncompressData(unsigned char* abSrc, size_t nLenSrc, unsigned char* abDst, size_t nLenDst);
48
50N_STR* zip_nstr(N_STR* src);
53
58#ifdef __cplusplus
59}
60#endif
61
62#endif // header guard
A box including a string and his lenght.
Definition n_str.h:61
size_t GetMaxCompressedLen(size_t nLenSrc)
Return the maximum compressed size.
Definition n_zlib.c:42
size_t CompressData(unsigned char *abSrc, size_t nLenSrc, unsigned char *abDst, size_t nLenDst)
Compress a string to another.
Definition n_zlib.c:55
size_t UncompressData(unsigned char *abSrc, size_t nLenSrc, unsigned char *abDst, size_t nLenDst)
Uncompress a string to another.
Definition n_zlib.c:112
N_STR * unzip_nstr(N_STR *src)
Return an uncompressed version of src.
Definition n_zlib.c:217
N_STR * zip_nstr(N_STR *src)
Return a compressed version of src.
Definition n_zlib.c:166
N_STR and string function declaration.