filters/gp_filter_resize_alloc: Check w and h
[gfxprim.git] / include / loaders / GP_IOZlib.h
bloba60f1a57c2553aba5a569060dd531a9cc88a8d31
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2014 Cyril Hrubis <metan@ucw.cz> *
20 * *
21 *****************************************************************************/
25 Zlib decompression stream.
29 #ifndef LOADERS_GP_IO_ZLIB_H
30 #define LOADERS_GP_IO_ZLIB_H
32 #include <loaders/GP_IO.h>
35 * Create an Zlib RAW inflate stream on the top of the existing I/O stream.
37 * The stream will read up to comp_size bytes from the parent I/O.
39 * If comp_size is 0, no limit on number bytes from the parent stream is set.
40 * However if end of compressed stream is reached the last read will attempt to
41 * seek back by the number of extra buffered bytes.
43 gp_io *gp_io_zlib(gp_io *io, size_t comp_size);
46 * Repurposes existing Zlib stream for new decompression.
48 * Returns zero on success. Returns non-zero on failure and errno is set.
50 int gp_io_zlib_reset(gp_io *io, gp_io *sub_io, size_t comp_size);
52 #endif /* LOADERS_GP_IO_ZLIB_H */