~ubuntu-branches/ubuntu/raring/vala-0.20/raring-proposed

« back to all changes in this revision

Viewing changes to vapi/bzlib.vapi

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-04-05 13:45:05 UTC
  • Revision ID: package-import@ubuntu.com-20130405134505-yyk3rec9904i7p8o
Tags: upstream-0.20.1
ImportĀ upstreamĀ versionĀ 0.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
9
 
 
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.
 
14
 
 
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
 */
 
22
 
 
23
[CCode (cheader_filename = "bzlib.h")]
 
24
namespace BZLib {
 
25
        [CCode (cname = "int", cprefix = "BZ_")]
 
26
        public enum Action {
 
27
                RUN,
 
28
                FLUSH,
 
29
                FINISH
 
30
        }
 
31
        
 
32
        [CCode (cname = "int", cprefix = "BZ_")]
 
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
        }
 
48
        
 
49
        [CCode (cname = "bz_stream")]
 
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
        }
 
74
 
 
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
        }
 
84
}