fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / hwpfilter / source / hgzip.h
blob140146c5405efe57c7cd2fcc5bc820389832a821
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_HWPFILTER_SOURCE_HGZIP_H
21 #define INCLUDED_HWPFILTER_SOURCE_HGZIP_H
23 #include <zlib.h>
25 class HStream;
26 /**
27 * @short Structure for using z_stream
29 struct gz_stream
31 z_stream stream;
32 /**
33 * The error code of z_stream operation
35 int z_err;
36 /**
37 * EOF of the input file
39 int z_eof;
40 /**
41 * Stream
43 HStream* _inputstream;
44 /**
45 * Input buffer
47 Byte *inbuf;
48 /**
49 * Output buffer
51 Byte *outbuf;
52 /**
53 * Crc32 of uncompressed data
55 uLong crc;
56 /**
57 * Stream
59 char *msg;
60 /**
61 * It becomes one when the input file type is not gz file
63 int transparent;
64 /**
65 * 'w' or 'r'
67 char mode;
70 /**
71 * Opens a gzipped stream for reading.
72 * gz_open returns NULL if the stream could not be opened or if there was
73 * insufficient memory to allocate the (de)compression state; errno
74 * can be checked to distinguish the two cases (if errno is zero, the
75 * zlib error is Z_MEM_ERROR).
76 * @param _stream Reference of stream object having binary data.
78 gz_stream *gz_open ( HStream& _stream );
79 /**
80 * Flushes all pending output if necessary, closes the compressed stream
81 * and deallocates all the (de)compression state
83 int gz_close ( gz_stream *file );
84 /**
85 * Reads the given number of uncompressed bytes from the compressed stream
86 * @param file Gzipped stream
87 * @param buf Buffer to have the data to be read
88 * @param len Length of data to be read
89 * @returns The number of bytes actually read
91 int gz_read ( gz_stream *file, voidp buf, unsigned len );
92 /**
93 * Flushes all pending output into the compressed file
94 * gz_flush should be called only when strictly necessary because it can
95 * degrade compression
96 * @param flush Is as in the deflate() function
98 int gz_flush ( gz_stream *file, int flush );
99 #endif // INCLUDED_HWPFILTER_SOURCE_HGZIP_H
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */