File: icu-uc.vapi

package info (click to toggle)
geary 46.0-13
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,092 kB
  • sloc: javascript: 972; ansic: 722; sql: 247; xml: 183; python: 30; makefile: 28; sh: 24
file content (95 lines) | stat: -rw-r--r-- 2,675 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Based on icu-uc.vapi from the Dino project.

[CCode (cprefix="u_")]
namespace Icu {

    [CCode (cname = "UChar")]
    [IntegerType (rank = 5, min = 0, max = 65535)]
    struct Char {}

    [CCode (cname = "UErrorCode", cprefix = "U_", cheader_filename = "unicode/utypes.h")]
    enum ErrorCode {
        ZERO_ERROR,
        INVALID_CHAR_FOUND,
        INDEX_OUTOFBOUNDS_ERROR,
        BUFFER_OVERFLOW_ERROR,
        STRINGPREP_PROHIBITED_ERROR,
        UNASSIGNED_CODE_POINT_FOUND,
        IDNA_STD3_ASCII_RULES_ERROR;

        [CCode (cname = "u_errorName")]
        public unowned string errorName();

        [CCode (cname = "U_SUCCESS")]
        public bool is_success();

        [CCode (cname = "U_FAILURE")]
        public bool is_failure();
    }

    [CCode (cname = "UParseError", cprefix = "U_", cheader_filename = "unicode/parseerr.h")]
    struct ParseError {}

    [CCode (cname = "UText", cprefix = "utext_", free_function = "utext_close", cheader_filename = "unicode/utext.h")]
    [Compact]
    class Text {
        [CCode (cname="utext_openUTF8")]
        public static Text open_utf8(Text* existing, [CCode (array_length_type = "int64_t")] uint8[] text, ref ErrorCode status);
    }

    [CCode (cname = "UBreakIterator", cprefix = "ubrk_", free_function = "ubrk_close", cheader_filename = "unicode/ubrk.h")]
    [Compact]
    class BreakIterator {

        [CCode (cname = "UBRK_DONE")]
        public const int32 DONE;

        [CCode (cname = "UBreakIteratorType", cprefix = "UBRK_")]
        public enum Type {
            CHARACTER,
            WORD,
            LINE,
            SENTENCE;
        }

        [CCode (cname = "UWordBreak", cprefix = "UBRK_WORD_")]
        enum WordBreak {
            NONE,
            NONE_LIMIT,
            NUMBER,
            NUMBER_LIMIT,
            LETTER,
            LETTER_LIMIT,
            KANA,
            KANA_LIMIT,
            IDEO,
            IDEO_LIMIT;
        }

        public static BreakIterator open(Type type, string locale, Char* text, int32 text_len, ref ErrorCode status);

        public int32 current {
            [CCode (cname="ubrk_current")] get;
        }
        public int32 rule_status {
            [CCode (cname="ubrk_getRuleStatus")] get;
        }

        [CCode (cname="ubrk_isBoundary")]
        public bool is_boundary(int32 offset);

        public int32 first();
        public int32 last();

        public int32 next();
        public int32 previous();

        public int32 proceeding(int32 offset);
        public int32 following(int32 offset);

        [CCode (cname="ubrk_setUText")]
        public void set_utext(Text text, ref ErrorCode status);
    }


}