]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gio-2.0: Add binding for g_io_error_from_win32_error()
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 16 Mar 2020 07:08:46 +0000 (08:08 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 19 Mar 2020 13:47:45 +0000 (14:47 +0100)
vapi/gio-2.0.vapi
vapi/metadata/Gio-2.0-custom.vala

index 05613546de2b59fffa7c2d50e3159e26da36fc7b..daa566e4235756b6565cfc1366ff00ebb2820dfa 100644 (file)
@@ -4767,6 +4767,12 @@ namespace GLib {
                public static GLib.IOError from_errno (int err_no) {
                        return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_errno (err_no), "%s", GLib.strerror (err_no));
                }
+               [CCode (cname = "g_io_error_from_win32_error")]
+               public static int _from_win32_error (int error_code);
+               [CCode (cname = "vala_g_io_error_from_win32_error")]
+               public static GLib.IOError from_win32_error (int error_code) {
+                       return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_win32_error (error_code), "%s", GLib.Win32.error_message (error_code));
+               }
                [CCode (cheader_filename = "gio/gio.h", cname = "g_io_error_from_errno")]
                public static int _from_errno (int err_no);
                [CCode (cheader_filename = "gio/gio.h")]
index f83892ded37a2d0517aac8f27afbe0ef39bf54fa..9bb88ae926e4da9f96a78c73576d621bbea00972 100644 (file)
@@ -169,6 +169,12 @@ namespace GLib {
                public static GLib.IOError from_errno (int err_no) {
                        return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_errno (err_no), "%s", GLib.strerror (err_no));
                }
+               [CCode (cname = "g_io_error_from_win32_error")]
+               public static int _from_win32_error (int error_code);
+               [CCode (cname = "vala_g_io_error_from_win32_error")]
+               public static GLib.IOError from_win32_error (int error_code) {
+                       return (GLib.IOError) new GLib.Error (GLib.IOError.quark (), GLib.IOError._from_win32_error (error_code), "%s", GLib.Win32.error_message (error_code));
+               }
        }
 
        public delegate void SimpleActionActivateCallback (SimpleAction action, Variant? parameter);