diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-16 11:23:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-16 11:23:26 -0700 |
commit | a35d78c0f483a65ea96c4f0c9a825bf28a386273 (patch) | |
tree | a20407fc5fbce3b190a364d10c47d807433ec9a5 /cache.h | |
parent | 184cb4d6899a2644b07c11bef71df869a851f525 (diff) | |
parent | e01503b523e79748ac91d876f506811c597d03cb (diff) | |
download | git-a35d78c0f483a65ea96c4f0c9a825bf28a386273.tar.gz |
Merge branch 'jc/zlib-wrap' into maint
* jc/zlib-wrap:
zlib: allow feeding more than 4GB in one go
zlib: zlib can only process 4GB at a time
zlib: wrap deflateBound() too
zlib: wrap deflate side of the API
zlib: wrap inflateInit2 used to accept only for gzip format
zlib: wrap remaining calls to direct inflate/inflateEnd
zlib wrapper: refactor error message formatter
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -16,13 +16,27 @@ #endif #include <zlib.h> -#if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200 -#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11) -#endif - -void git_inflate_init(z_streamp strm); -void git_inflate_end(z_streamp strm); -int git_inflate(z_streamp strm, int flush); +typedef struct git_zstream { + z_stream z; + unsigned long avail_in; + unsigned long avail_out; + unsigned long total_in; + unsigned long total_out; + unsigned char *next_in; + unsigned char *next_out; +} git_zstream; + +void git_inflate_init(git_zstream *); +void git_inflate_init_gzip_only(git_zstream *); +void git_inflate_end(git_zstream *); +int git_inflate(git_zstream *, int flush); + +void git_deflate_init(git_zstream *, int level); +void git_deflate_init_gzip(git_zstream *, int level); +void git_deflate_end(git_zstream *); +int git_deflate_end_gently(git_zstream *); +int git_deflate(git_zstream *, int flush); +unsigned long git_deflate_bound(git_zstream *, unsigned long); #if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT) #define DTYPE(de) ((de)->d_type) @@ -1009,7 +1023,7 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1, extern void pack_report(void); extern int open_pack_index(struct packed_git *); extern void close_pack_index(struct packed_git *); -extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *); +extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *); extern void close_pack_windows(struct packed_git *); extern void unuse_pack(struct pack_window **); extern void free_pack_by_name(const char *); |