Fixes bug 644420.
[CCode (cheader_filename = "gio/gio.h")]
public delegate bool CancellableSourceFunc (GLib.Cancellable cancellable);
[CCode (cheader_filename = "gio/gio.h")]
- public delegate unowned GLib.Variant DBusInterfaceGetPropertyFunc (GLib.DBusConnection connection, string sender, string object_path, string interface_name, string property_name, GLib.Error error);
+ public delegate unowned GLib.Variant DBusInterfaceGetPropertyFunc (GLib.DBusConnection connection, string sender, string object_path, string interface_name, string property_name) throws GLib.Error;
[CCode (cheader_filename = "gio/gio.h")]
public delegate void DBusInterfaceMethodCallFunc (GLib.DBusConnection connection, string sender, string object_path, string interface_name, string method_name, GLib.Variant parameters, GLib.DBusMethodInvocation invocation);
[CCode (cheader_filename = "gio/gio.h")]
- public delegate bool DBusInterfaceSetPropertyFunc (GLib.DBusConnection connection, string sender, string object_path, string interface_name, string property_name, GLib.Variant value, GLib.Error error);
+ public delegate bool DBusInterfaceSetPropertyFunc (GLib.DBusConnection connection, string sender, string object_path, string interface_name, string property_name, GLib.Variant value) throws GLib.Error;
[CCode (cheader_filename = "gio/gio.h")]
public delegate unowned GLib.DBusMessage DBusMessageFilterFunction (GLib.DBusConnection connection, GLib.DBusMessage message, bool incoming);
[CCode (cheader_filename = "gio/gio.h")]
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate int RecentSortFunc (Gtk.RecentInfo a, Gtk.RecentInfo b);
[CCode (cheader_filename = "gtk/gtk.h", instance_pos = 5.9)]
- public delegate bool TextBufferDeserializeFunc (Gtk.TextBuffer register_buffer, Gtk.TextBuffer content_buffer, Gtk.TextIter iter, [CCode (array_length_type = "gsize")] uint8[] data, bool create_tags, GLib.Error error);
+ public delegate bool TextBufferDeserializeFunc (Gtk.TextBuffer register_buffer, Gtk.TextBuffer content_buffer, Gtk.TextIter iter, [CCode (array_length_type = "gsize")] uint8[] data, bool create_tags) throws GLib.Error;
[CCode (cheader_filename = "gtk/gtk.h")]
public delegate uchar TextBufferSerializeFunc (Gtk.TextBuffer register_buffer, Gtk.TextBuffer content_buffer, Gtk.TextIter start, Gtk.TextIter end, size_t length);
[CCode (cheader_filename = "gtk/gtk.h")]
[CCode (cheader_filename = "libgda/libgda.h")]
public delegate void ServerProviderExecCallback (Gda.ServerProvider provider, Gda.Connection cnc, uint task_id, GLib.Object result_obj, GLib.Error error);
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate bool SqlForeachFunc (Gda.SqlAnyPart p1, void* p2, GLib.Error p3);
+ public delegate bool SqlForeachFunc (Gda.SqlAnyPart p1, void* p2) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate unowned string SqlRenderingExpr (Gda.SqlExpr expr, Gda.SqlRenderingContext context, bool is_default, bool is_null, GLib.Error error);
+ public delegate unowned string SqlRenderingExpr (Gda.SqlExpr expr, Gda.SqlRenderingContext context, bool is_default, bool is_null) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate unowned string SqlRenderingFunc (Gda.SqlAnyPart node, Gda.SqlRenderingContext context, GLib.Error error);
+ public delegate unowned string SqlRenderingFunc (Gda.SqlAnyPart node, Gda.SqlRenderingContext context) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate unowned string SqlRenderingPSpecFunc (Gda.SqlParamSpec pspec, Gda.SqlExpr expr, Gda.SqlRenderingContext context, bool is_default, bool is_null, GLib.Error error);
+ public delegate unowned string SqlRenderingPSpecFunc (Gda.SqlParamSpec pspec, Gda.SqlExpr expr, Gda.SqlRenderingContext context, bool is_default, bool is_null) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate unowned string SqlRenderingValue (GLib.Value value, Gda.SqlRenderingContext context, GLib.Error error);
+ public delegate unowned string SqlRenderingValue (GLib.Value value, Gda.SqlRenderingContext context) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
public delegate bool SqlReservedKeywordsFunc (string word);
[CCode (cheader_filename = "libgda/libgda.h")]
public delegate void VConnectionHubFunc (Gda.Connection cnc, string ns);
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
- public delegate unowned GLib.List VconnectionDataModelCreateColumnsFunc (Gda.VconnectionDataModelSpec p1, GLib.Error p2);
+ public delegate unowned GLib.List VconnectionDataModelCreateColumnsFunc (Gda.VconnectionDataModelSpec p1) throws GLib.Error;
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
public delegate unowned Gda.DataModel VconnectionDataModelCreateModelFunc (Gda.VconnectionDataModelSpec p1);
[CCode (cheader_filename = "libgda/libgda.h", has_target = false)]
cb.access = SymbolAccessibility.PUBLIC;
bool check_has_target = true;
+ bool suppress_throws = false;
+ string? error_types = null;
var attributes = get_attributes (node.name);
if (attributes != null) {
return_type = new ArrayType (return_type, 1, return_type.source_reference);
cb.return_type = return_type;
}
+ } else if (nv[0] == "throws") {
+ if (eval (nv[1]) == "0") {
+ suppress_throws = true;
+ }
+ } else if (nv[0] == "error_types") {
+ error_types = eval (nv[1]);
} else if (nv[0] == "array_length_type") {
cb.array_length_type = eval (nv[1]);
} else if (nv[0] == "type_name") {
// hide user_data parameter for instance delegates
cb.has_target = true;
} else {
+ // check for GError parameter
+ if (suppress_throws == false && param_is_exception (param)) {
+ if (error_types == null)
+ cb.add_error_type (parse_type (param.type));
+ remaining_params--;
+ continue;
+ }
+
string param_name = param_node.name;
if (param_name == "string") {
// avoid conflict with string type
remaining_params--;
}
-
+
+ if (suppress_throws == false && error_types != null) {
+ var type_args = eval (error_types).split (",");
+ foreach (string type_arg in type_args) {
+ cb.add_error_type (parse_type_from_string (type_arg, true));
+ }
+ }
+
return cb;
}
continue;
}
+ // check for GError parameter
if (suppress_throws == false && param_is_exception (param)) {
if (error_types == null)
m.add_error_type (parse_type (param.type));