[vala/wip/glib-win32: 5/6] gio-2.0: Add binding for g_io_error_from_win32_error()



commit 36bfca5805eda1531df290b1ef62adc5a0a7f3a2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Mar 16 08:08:46 2020 +0100

    gio-2.0: Add binding for g_io_error_from_win32_error()

 vapi/gio-2.0.vapi                 | 6 ++++++
 vapi/metadata/Gio-2.0-custom.vala | 6 ++++++
 2 files changed, 12 insertions(+)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 05613546d..daa566e42 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -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")]
diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala
index f83892ded..9bb88ae92 100644
--- a/vapi/metadata/Gio-2.0-custom.vala
+++ b/vapi/metadata/Gio-2.0-custom.vala
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]