regenerated fix some methods and rename IOErrorEnum to IOError support
authorRaffaele Sandrini <raffaele@sandrini.ch>
Tue, 19 Feb 2008 15:40:07 +0000 (15:40 +0000)
committerRaffaele Sandrini <rasa@src.gnome.org>
Tue, 19 Feb 2008 15:40:07 +0000 (15:40 +0000)
2008-02-19  Raffaele Sandrini  <raffaele@sandrini.ch>

* vapi/gio-2.0.vapi: regenerated
* vapi/packages/gio-2.0/gio-2.0.metadata: fix some methods and rename
  IOErrorEnum to IOError
* vapigen/valagidlparser.vala: support renaming of enums, check more
  carefully whether an error formal parameter of a function is meant as
  exception

svn path=/trunk/; revision=1020

ChangeLog
vapi/gio-2.0.vapi
vapi/packages/gio-2.0/gio-2.0.metadata
vapigen/valagidlparser.vala

index 44b4095..5f1b46f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-02-19  Raffaele Sandrini  <raffaele@sandrini.ch>
+
+       reviewed by: <delete if not using a buddy>
+
+       * gobject/valaccodegenerator.vala:
+       * vapi/gio-2.0.vapi:
+       * vapi/glib-2.0.vapi:
+       * vapi/packages/gio-2.0/gio-2.0.metadata:
+       * vapigen/valagidlparser.vala:
+
 2008-02-18  Jürg Billeter  <j@bitron.ch>
 
        * vapi/Makefile.am, vapi/libusb.vapi: add libusb bindings,
index f97a085..cb342a3 100644 (file)
@@ -54,7 +54,7 @@ namespace GLib {
                MOUNTABLE,
        }
        [CCode (cprefix = "G_IO_ERROR_", cheader_filename = "gio/gio.h")]
-       public enum IOErrorEnum {
+       public enum IOError {
                FAILED,
                NOT_FOUND,
                EXISTS,
@@ -276,11 +276,11 @@ namespace GLib {
                public short read_int16 (GLib.Cancellable cancellable) throws GLib.Error;
                public int read_int32 (GLib.Cancellable cancellable) throws GLib.Error;
                public int64 read_int64 (GLib.Cancellable cancellable) throws GLib.Error;
-               public weak string read_line (ulong length, GLib.Cancellable cancellable) throws GLib.Error;
+               public weak string read_line (out ulong length, GLib.Cancellable cancellable) throws GLib.Error;
                public ushort read_uint16 (GLib.Cancellable cancellable) throws GLib.Error;
                public uint read_uint32 (GLib.Cancellable cancellable) throws GLib.Error;
                public uint64 read_uint64 (GLib.Cancellable cancellable) throws GLib.Error;
-               public weak string read_until (string stop_chars, ulong length, GLib.Cancellable cancellable) throws GLib.Error;
+               public weak string read_until (string stop_chars, out ulong length, GLib.Cancellable cancellable) throws GLib.Error;
                public void set_byte_order (GLib.DataStreamByteOrder order);
                public void set_newline_type (GLib.DataStreamNewlineType type);
                public weak GLib.DataStreamByteOrder byte_order { get; set; }
@@ -455,7 +455,7 @@ namespace GLib {
                public bool has_pending ();
                public bool is_closed ();
                public long read (pointer buffer, ulong count, GLib.Cancellable cancellable) throws GLib.Error;
-               public bool read_all (pointer buffer, ulong count, ulong bytes_read, GLib.Cancellable cancellable) throws GLib.Error;
+               public bool read_all (pointer buffer, ulong count, out ulong bytes_read, GLib.Cancellable cancellable) throws GLib.Error;
                public bool set_pending () throws GLib.Error;
                public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
                public virtual bool close_finish (GLib.AsyncResult _result) throws GLib.Error;
@@ -546,12 +546,12 @@ namespace GLib {
                public pointer get_source_tag ();
                public SimpleAsyncResult (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, pointer source_tag);
                public SimpleAsyncResult.error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Quark domain, int code, string format);
-               public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data) throws GLib.Error;
+               public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Error error);
                public bool propagate_error () throws GLib.Error;
                public void run_in_thread (GLib.SimpleAsyncThreadFunc func, int io_priority, GLib.Cancellable cancellable);
                public void set_error (GLib.Quark domain, int code, string format);
                public void set_error_va (GLib.Quark domain, int code, string format, pointer args);
-               public void set_from_error () throws GLib.Error;
+               public void set_from_error (GLib.Error error);
                public void set_handle_cancellation (bool handle_cancellation);
                public void set_op_res_gboolean (bool op_res);
                public void set_op_res_gpointer (pointer op_res, GLib.DestroyNotify destroy_op_res);
@@ -895,7 +895,7 @@ namespace GLib {
        [CCode (cname = "g_content_types_get_registered", cheader_filename = "gio/gio.h")]
        public static weak GLib.List g_content_types_get_registered ();
        [CCode (cname = "g_io_error_from_errno", cheader_filename = "gio/gio.h")]
-       public static GLib.IOErrorEnum g_io_error_from_errno (int err_no);
+       public static GLib.IOError g_io_error_from_errno (int err_no);
        [CCode (cname = "g_io_error_quark", cheader_filename = "gio/gio.h")]
        public static GLib.Quark g_io_error_quark ();
        [CCode (cname = "g_io_modules_load_all_in_directory", cheader_filename = "gio/gio.h")]
@@ -907,5 +907,5 @@ namespace GLib {
        [CCode (cname = "g_simple_async_report_error_in_idle", cheader_filename = "gio/gio.h")]
        public static void g_simple_async_report_error_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Quark domain, int code, string format);
        [CCode (cname = "g_simple_async_report_gerror_in_idle", cheader_filename = "gio/gio.h")]
-       public static void g_simple_async_report_gerror_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data) throws GLib.Error;
+       public static void g_simple_async_report_gerror_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Error error);
 }
index eb4376d..1ac91ad 100644 (file)
@@ -6,4 +6,7 @@ g_file_new_for_path transfer_ownership="1"
 g_file_new_for_uri transfer_ownership="1"
 GMountOperation::reply has_emitter="1"
 g_themed_icon_new_from_names.iconnames is_array="1"
-
+g_input_stream_read_all.bytes_read is_out="1"
+g_data_input_stream_read_line.length is_out="1"
+g_data_input_stream_read_until.length is_out="1"
+GIOErrorEnum rename_to="IOError"
index 49ff146..cbc1bd3 100644 (file)
@@ -731,6 +731,8 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                return null;
                                        }
+                               } else if (nv[0] == "rename_to") {
+                                       en.name = eval (nv[1]);
                                }
                        }
                }
@@ -1105,6 +1107,8 @@ public class Vala.GIdlParser : CodeVisitor {
                                        type.type_name = eval (nv[1]);
                                } else if (nv[0] == "namespace") {
                                        type.namespace_name = eval (nv[1]);
+                               } else if (nv[0] == "rename_to") {
+                                       type.type_name = eval (nv[1]);
                                }
                        }
                }
@@ -1241,7 +1245,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                }
                        }
 
-                       if (suppress_throws == false && param.type.is_error) {
+                       if (suppress_throws == false && param_is_exception (param)) {
                                m.add_error_domain (parse_type (param.type));
                                continue;
                        }
@@ -1322,6 +1326,17 @@ public class Vala.GIdlParser : CodeVisitor {
                return m;
        }
 
+       private bool param_is_exception (IdlNodeParam param) {
+               if (!param.type.is_error) {
+                       return false;
+               }
+               var s = param.type.unparsed.chomp ();
+               if (s.has_suffix ("**")) {
+                       return true;
+               }
+               return false;
+       }
+
        private Method parse_function (IdlNodeFunction! f, bool is_interface = false) {
                weak IdlNode node = (IdlNode) f;