diff options
author | Marvin W <git@larma.de> | 2019-12-22 04:10:53 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-12-23 16:58:53 +0100 |
commit | a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d (patch) | |
tree | cbb079649066c2001b6d6881137108e70eed9d3f /xmpp-vala/vapi | |
parent | 3218dc0211ac717230fe03fad82681a626d968b5 (diff) | |
download | dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.tar.gz dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.zip |
Properly check Jids everywhere
Diffstat (limited to 'xmpp-vala/vapi')
-rw-r--r-- | xmpp-vala/vapi/icu-uc.vapi | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/xmpp-vala/vapi/icu-uc.vapi b/xmpp-vala/vapi/icu-uc.vapi new file mode 100644 index 00000000..14764440 --- /dev/null +++ b/xmpp-vala/vapi/icu-uc.vapi @@ -0,0 +1,56 @@ +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, + UNASSIGNED_CODE_POINT_FOUND, + IDNA_STD3_ASCII_RULES_ERROR + ; + [CCode (cname = "u_errorName")] + public unowned string errorName(); +} + +[CCode (cname = "UErrorCode", cprefix = "U_", cheader_filename = "unicode/parseerr.h")] +struct ParseError {} + +[CCode (cname = "UStringPrepProfile", cprefix = "usprep_", free_function = "usprep_close", cheader_filename = "unicode/usprep.h")] +[Compact] +class PrepProfile { + public static PrepProfile open(string path, string file_name, ref ErrorCode status); + public static PrepProfile openByType(PrepType type, ref ErrorCode status); + public int32 prepare(Char* src, int32 src_length, Char* dest, int32 dest_capacity, PrepOptions options, out ParseError parse_error, ref ErrorCode status); +} +[CCode (cname = "UStringPrepProfileType", cprefix = "USPREP_")] +enum PrepType { + RFC3491_NAMEPREP, + RFC3920_NODEPREP, + RFC3920_RESOURCEPREP +} +[CCode (cname = "int32_t", cprefix = "USPREP_")] +enum PrepOptions { + DEFAULT, + ALLOW_UNASSIGNED +} + +[CCode (cname = "UIDNA", cprefix = "uidna_", free_function = "uidna_close", cheader_filename = "unicode/uidna.h")] +[Compact] +class IDNA { + public static int32 IDNToUnicode(Char* src, int32 src_length, Char* dest, int32 dest_capacity, IDNAOptions options, out ParseError parse_error, ref ErrorCode status); + public static int32 IDNToASCII(Char* src, int32 src_length, Char* dest, int32 dest_capacity, IDNAOptions options, out ParseError parse_error, ref ErrorCode status); +} + +[CCode (cname = "uint32_t", cprefix = "UIDNA_")] +enum IDNAOptions { + DEFAULT, + ALLOW_UNASSIGNED, + USE_STD3_RULES +} + +} |