-
Notifications
You must be signed in to change notification settings - Fork 0
/
zpipe.h
35 lines (28 loc) · 1.04 KB
/
zpipe.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <zlib.h>
/* Compress from file `source` to file `dest` until `EOF` on `source`.
Returns:
- `Z_OK` on success,
- `Z_MEM_ERROR` if memory could not be allocated for processing,
- `Z_STREAM_ERROR` if an invalid compression level is supplied,
- `Z_VERSION_ERROR` if the version of zlib.h and the version of the library
linked do not match,
- or `Z_ERRNO` if there is an error reading or writing the
files. */
extern int z_compress(FILE* source, FILE* dest, int level);
/** Decompress from file `source` to file `dest` until stream ends or `EOF`.
Returns:
- `Z_OK` on success,
- `Z_MEM_ERROR` if memory could not be allocated for processing,
- `Z_DATA_ERROR` if the deflate data is invalid or incomplete,
- `Z_VERSION_ERROR` if the version of zlib.h and the version of the library
linked do not match, or
- `Z_ERRNO` if there is an error reading or writing the
files. */
extern int z_decompress(FILE* source, FILE* dest);
#ifdef __cplusplus
}
#endif