diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2015-06-17 08:07:34 -0700 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-05-26 13:01:03 -0500 |
| commit | b88f1713d01e5cca5a296d564ae094dd8bc6a1f2 (patch) | |
| tree | 49dd3e66e51f5dcba0ad00ae726c63a95462ee64 /src/zstream.h | |
| parent | 1cd6599142ec89f9c7eeb8b302e8877c71e1ab4b (diff) | |
| download | libgit2-b88f1713d01e5cca5a296d564ae094dd8bc6a1f2.tar.gz | |
zstream: offer inflating, `git_zstream_inflatebuf`
Introduce `git_zstream_inflatebuf` for simple uses.
Diffstat (limited to 'src/zstream.h')
| -rw-r--r-- | src/zstream.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zstream.h b/src/zstream.h index 9b5bf6ace..f0006d32e 100644 --- a/src/zstream.h +++ b/src/zstream.h @@ -12,8 +12,14 @@ #include "common.h" #include "buffer.h" +typedef enum { + GIT_ZSTREAM_INFLATE, + GIT_ZSTREAM_DEFLATE, +} git_zstream_t; + typedef struct { z_stream z; + git_zstream_t type; const char *in; size_t in_len; int zerr; @@ -21,7 +27,7 @@ typedef struct { #define GIT_ZSTREAM_INIT {{0}} -int git_zstream_init(git_zstream *zstream); +int git_zstream_init(git_zstream *zstream, git_zstream_t type); void git_zstream_free(git_zstream *zstream); int git_zstream_set_input(git_zstream *zstream, const void *in, size_t in_len); @@ -35,5 +41,6 @@ bool git_zstream_done(git_zstream *zstream); void git_zstream_reset(git_zstream *zstream); int git_zstream_deflatebuf(git_buf *out, const void *in, size_t in_len); +int git_zstream_inflatebuf(git_buf *out, const void *in, size_t in_len); #endif /* INCLUDE_zstream_h__ */ |
