]> 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>
Tue, 24 Mar 2020 08:50:25 +0000 (09:50 +0100)
vapi/gio-2.0.vapi
vapi/metadata/Gio-2.0-custom.vala

index 67e3e2c39958939bf4cd23ad04678e1ceeae4275..910d47bf2b4bde5ba57d1cf970337a4f393e9dcd 100644 (file)
@@ -4741,6 +4741,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);