3
* Copyright (C) 2008 Maciej Piechotka
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
* Maciej Piechotka <uzytkownik2@gmail.com>
23
[CCode (cheader_filename = "bzlib.h")]
25
[CCode (cname = "int", cprefix = "BZ_")]
32
[CCode (cname = "int", cprefix = "BZ_")]
49
[CCode (cname = "bz_stream")]
50
public struct Stream {
51
public string next_in;
53
public uint totoal_in_lo32;
54
public uint total_in_hi32;
55
public string next_out;
56
public uint avail_out;
57
public uint totoal_out_lo32;
58
public uint total_out_hi32;
61
[CCode (cname = "BZ2_bzCompressInit")]
62
public Status compress_init (int block_size_100k, int verbosity, int work_factor);
63
[CCode (cname = "BZ2_bzCompress")]
64
public Status compress (Action action);
65
[CCode (cname = "BZ2_bzCompressEnd")]
66
public Status compress_end ();
67
[CCode (cname = "BZ2_bzDecompressInit")]
68
public Status decompress_init (int verbosity, int small);
69
[CCode (cname = "BZ2_bzDecompress")]
70
public Status decompress ();
71
[CCode (cname = "BZ2_bzDecompressEnd")]
72
public Status decompress_end ();
75
[CCode (cname = "BZFILE", cprefix = "BZ2_bz", free_function = "BZ2_bzclose")]
77
public class BZFileStream {
78
public static BZFileStream open (string path, string mode = "rb");
79
public static BZFileStream dopen (int fd, string mode);
80
public int read (uint8[] buf);
81
public int write (uint8[] buf);
82
public unowned string error (out Status status);