Allow tor_gzip_uncompress to extract as much as possible from truncated compressed...
[tor.git] / src / common / torgzip.h
bloba70463be6c873e154b94ef42b45ddfcf99877605
1 /* Copyright 2003 Roger Dingledine
2 * Copyright 2004-2005 Roger Dingledine, Nick Mathewson */
3 /* See LICENSE for licensing information */
4 /* $Id$ */
6 /**
7 * \file torgzip.h
8 * \brief Headers for torgzip.h
9 **/
11 #ifndef __TORGZIP_H
12 #define __TORGZIP_H
13 #define TORGZIP_H_ID "$Id$"
15 typedef enum {
16 GZIP_METHOD=1, ZLIB_METHOD=2, UNKNOWN_METHOD=3
17 } compress_method_t;
19 int
20 tor_gzip_compress(char **out, size_t *out_len,
21 const char *in, size_t in_len,
22 compress_method_t method);
23 int
24 tor_gzip_uncompress(char **out, size_t *out_len,
25 const char *in, size_t in_len,
26 compress_method_t method,
27 int complete_only);
29 int is_gzip_supported(void);
31 int detect_compression_method(const char *in, size_t in_len);
33 #endif