From: Rico Tzschichholz Date: Thu, 1 Nov 2018 17:38:02 +0000 (+0100) Subject: glib-2.0: Add RefString since 2.58 X-Git-Tag: 0.53.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60fd1f800b3e2746c95d7503b40a03f5498f0f5d;p=thirdparty%2Fvala.git glib-2.0: Add RefString since 2.58 Thanks to Jiří Janoušek See https://gitlab.gnome.org/GNOME/vala/issues/666 Fixes https://gitlab.gnome.org/GNOME/vala/issues/723 --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index a86b81df0..71caeaf2c 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -5443,6 +5443,22 @@ namespace GLib { /* Strings */ + [CCode (cprefix = "g_ref_string_", ref_function = "g_ref_string_acquire", unref_function = "g_ref_string_release", type_id = "G_TYPE_STRING")] + [Version (since = "2.58")] + public class RefString { + public RefString (string str); + public RefString.intern (string str); + public RefString.len (string str, ssize_t len); + + public size_t length { + [CCode (cname = "g_ref_string_length")] + get; + } + + [CCode (cname = "(const char*)")] + public unowned string to_string (); + } + [Compact] [GIR (name = "String")] [CCode (cname = "GString", cprefix = "g_string_", free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]