2
* include/proto/compression.h
3
* This file defines function prototypes for compression.
5
* Copyright 2012 (C) Exceliance, David Du Colombier <dducolombier@exceliance.fr>
6
* William Lallemand <wlallemand@exceliance.fr>
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation, version 2.1
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26
#include <types/compression.h>
28
extern unsigned int compress_min_idle;
30
int comp_append_type(struct comp *comp, const char *type);
31
int comp_append_algo(struct comp *comp, const char *algo);
33
int http_emit_chunk_size(char *out, unsigned int chksz, int add_crlf);
34
int http_compression_buffer_init(struct session *s, struct buffer *in, struct buffer *out);
35
int http_compression_buffer_add_data(struct session *s, struct buffer *in, struct buffer *out);
36
int http_compression_buffer_end(struct session *s, struct buffer **in, struct buffer **out, int end);
38
int identity_init(struct comp_ctx **comp_ctx, int level);
39
int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
40
int identity_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
41
int identity_reset(struct comp_ctx *comp_ctx);
42
int identity_end(struct comp_ctx **comp_ctx);
47
extern long zlib_used_memory;
49
int deflate_init(struct comp_ctx **comp_ctx, int level);
50
int deflate_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
51
int deflate_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
52
int deflate_reset(struct comp_ctx *comp_ctx);
53
int deflate_end(struct comp_ctx **comp_ctx);
55
int gzip_init(struct comp_ctx **comp_ctx, int level);
58
#endif /* _PROTO_COMP_H */