libgsf-1: Update to 1.14.42+
[vala-gnome.git] / vapi / bzlib.vapi
blob844442dd8974a7f686f8a8ea8fc6643ad315cf87
1 /* bzlib.vapi
2  *
3  * Copyright (C) 2008 Maciej Piechotka
4  *
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
18  *
19  * Author:
20  *      Maciej Piechotka <uzytkownik2@gmail.com>
21  */
23 [CCode (cheader_filename = "bzlib.h")]
24 namespace BZLib {
25         [CCode (cname = "int", cprefix = "BZ_", has_type_id = false)]
26         public enum Action {
27                 RUN,
28                 FLUSH,
29                 FINISH
30         }
32         [CCode (cname = "int", cprefix = "BZ_", has_type_id = false)]
33         public enum Status {
34                 OK,
35                 RUN_OK,
36                 FLUSH_OK,
37                 FINISH_OK,
38                 STREAM_END,
39                 SEQUENCE_ERROR,
40                 MEM_ERROR,
41                 DATA_ERROR,
42                 DATA_ERROR_MAGICK,
43                 IO_ERROR,
44                 UNEXPECTED_EOF,
45                 OUTBUFF_FULL,
46                 CONFIG_ERROR
47         }
49         [CCode (cname = "bz_stream", has_type_id = false)]
50         public struct Stream {
51                 public string next_in;
52                 public uint avail_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;
59                 public void *state;
60                 public void *opaque;
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 ();
73         }
75         [CCode (cname = "BZFILE", cprefix = "BZ2_bz", free_function = "BZ2_bzclose")]
76         [Compact]
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);
83         }