]> git.proxmox.com Git - libgit2.git/blob - src/zstream.h
push: remove own copy of callbacks
[libgit2.git] / src / zstream.h
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_zstream_h__
8 #define INCLUDE_zstream_h__
9
10 #include <zlib.h>
11
12 #include "common.h"
13 #include "buffer.h"
14
15 typedef struct {
16 z_stream z;
17 const char *in;
18 size_t in_len;
19 int zerr;
20 } git_zstream;
21
22 #define GIT_ZSTREAM_INIT {{0}}
23
24 int git_zstream_init(git_zstream *zstream);
25 void git_zstream_free(git_zstream *zstream);
26
27 int git_zstream_set_input(git_zstream *zstream, const void *in, size_t in_len);
28
29 size_t git_zstream_suggest_output_len(git_zstream *zstream);
30
31 int git_zstream_get_output(void *out, size_t *out_len, git_zstream *zstream);
32
33 bool git_zstream_done(git_zstream *zstream);
34
35 void git_zstream_reset(git_zstream *zstream);
36
37 int git_zstream_deflatebuf(git_buf *out, const void *in, size_t in_len);
38
39 #endif /* INCLUDE_zstream_h__ */