valaclassregisterfunction.vala \
valactype.vala \
valaenumregisterfunction.vala \
+ valaerrordomainregisterfunction.vala \
valagasyncmodule.vala \
valagdbusclientmodule.vala \
valagdbusmodule.vala \
}
public static string get_ccode_type_function (TypeSymbol sym) {
- assert (!((sym is Class && ((Class) sym).is_compact) || sym is ErrorCode || sym is ErrorDomain || sym is Delegate));
+ assert (!((sym is Class && ((Class) sym).is_compact) || sym is ErrorCode || sym is Delegate));
return "%s_get_type".printf (get_ccode_lower_case_name (sym));
}
} else {
return en.is_flags ? "G_TYPE_UINT" : "G_TYPE_INT";
}
+ } else if (sym is ErrorDomain) {
+ unowned ErrorDomain edomain = (ErrorDomain) sym;
+ if (get_ccode_has_type_id (edomain)) {
+ return get_ccode_upper_case_name (edomain, "TYPE_");
+ } else {
+ return "G_TYPE_ERROR";
+ }
} else {
return "G_TYPE_POINTER";
}
return get_ccode_lower_case_name (cl, "value_get_");
} else if (cl.base_class != null) {
return get_ccode_get_value_function (cl.base_class);
- } else if (type_id == "G_TYPE_POINTER") {
+ } else if (type_id == "G_TYPE_POINTER" || cl.is_error_base) {
return "g_value_get_pointer";
} else {
return "g_value_get_boxed";
return get_ccode_lower_case_name (cl, "value_set_");
} else if (cl.base_class != null) {
return get_ccode_set_value_function (cl.base_class);
- } else if (type_id == "G_TYPE_POINTER") {
+ } else if (type_id == "G_TYPE_POINTER" || cl.is_error_base) {
return "g_value_set_pointer";
} else {
return "g_value_set_boxed";
return get_ccode_lower_case_name (cl, "value_take_");
} else if (cl.base_class != null) {
return get_ccode_take_value_function (cl.base_class);
- } else if (type_id == "G_TYPE_POINTER") {
+ } else if (type_id == "G_TYPE_POINTER" || cl.is_error_base) {
return "g_value_set_pointer";
} else {
return "g_value_take_boxed";
--- /dev/null
+/* valaerrordomainregisterfunction.vala
+ *
+ * Copyright (C) 2018 Rico Tzschichholz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Rico Tzschichholz <ricotz@ubuntu.com>
+ */
+
+using GLib;
+
+/**
+ * C function to register an error domain at runtime.
+ */
+public class Vala.ErrorDomainRegisterFunction : TypeRegisterFunction {
+ /**
+ * Specifies the error domain to be registered.
+ */
+ public weak ErrorDomain error_domain_reference { get; set; }
+
+ /**
+ * Creates a new C function to register the specified error domain at runtime.
+ *
+ * @param edomain an error domain
+ * @return newly created error domain register function
+ */
+ public ErrorDomainRegisterFunction (ErrorDomain edomain) {
+ error_domain_reference = edomain;
+ }
+
+ public override TypeSymbol get_type_declaration () {
+ return error_domain_reference;
+ }
+
+ public override SymbolAccessibility get_accessibility () {
+ return error_domain_reference.access;
+ }
+}
requires_vala_extern = true;
decl_space.add_function_declaration (cquark_fun);
+ decl_space.add_type_definition (new CCodeNewline ());
+
+ if (!get_ccode_has_type_id (edomain)) {
+ return;
+ }
+
+ decl_space.add_include ("glib-object.h");
+ decl_space.add_type_declaration (new CCodeNewline ());
+
+ var fun_name = get_ccode_type_function (edomain);
+
+ var macro = "(%s ())".printf (fun_name);
+ decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (edomain), macro));
+
+ var regfun = new CCodeFunction (fun_name, "GType");
+ regfun.modifiers = CCodeModifiers.CONST;
+
+ if (edomain.is_private_symbol ()) {
+ // avoid C warning as this function is not always used
+ regfun.modifiers |= CCodeModifiers.STATIC | CCodeModifiers.UNUSED;
+ } else if (context.hide_internal && edomain.is_internal_symbol ()) {
+ regfun.modifiers |= CCodeModifiers.INTERNAL;
+ }
+
+ decl_space.add_function_declaration (regfun);
}
public override void visit_error_domain (ErrorDomain edomain) {
write_indent ();
buffer.append_printf ("<enumeration name=\"%s\"", get_gir_name (edomain));
- write_ctype_attributes (edomain);
+ if (get_ccode_has_type_id (edomain)) {
+ write_gtype_attributes (edomain);
+ } else {
+ write_ctype_attributes (edomain);
+ }
buffer.append_printf (" glib:error-domain=\"%s\"", get_ccode_quark_name (edomain));
write_symbol_attributes (edomain);
buffer.append_printf (">\n");
}
}
+ public override void visit_error_domain (ErrorDomain edomain) {
+ base.visit_error_domain (edomain);
+
+ if (get_ccode_has_type_id (edomain)) {
+ push_line (edomain.source_reference);
+ var type_fun = new ErrorDomainRegisterFunction (edomain);
+ type_fun.init_from_type (context, false, false);
+ cfile.add_type_member_definition (type_fun.get_definition ());
+ pop_line ();
+ }
+ }
+
public override void visit_method_call (MethodCall expr) {
var ma = expr.call as MemberAccess;
var mtype = expr.call.value_type as MethodType;
} else {
reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_enum_register_static"));
}
+ } else if (type_symbol is ErrorDomain) {
+ reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_enum_register_static"));
} else if (fundamental) {
reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_type_register_fundamental"));
reg_call.add_argument (new CCodeFunctionCall (new CCodeIdentifier ("g_type_fundamental_next")));
type_init.add_statement (cdecl);
+ reg_call.add_argument (new CCodeIdentifier ("values"));
+ } else if (type_symbol is ErrorDomain) {
+ unowned ErrorDomain edomain = (ErrorDomain) type_symbol;
+ var clist = new CCodeInitializerList (); /* or during visit time? */
+
+ CCodeInitializerList clist_ec = null;
+ foreach (ErrorCode ec in edomain.get_codes ()) {
+ clist_ec = new CCodeInitializerList ();
+ clist_ec.append (new CCodeConstant (get_ccode_name (ec)));
+ clist_ec.append (new CCodeConstant ("\"%s\"".printf (get_ccode_name (ec))));
+ clist_ec.append (new CCodeConstant ("\"%s\"".printf (ec.nick)));
+ clist.append (clist_ec);
+ }
+
+ clist_ec = new CCodeInitializerList ();
+ clist_ec.append (new CCodeConstant ("0"));
+ clist_ec.append (new CCodeConstant ("NULL"));
+ clist_ec.append (new CCodeConstant ("NULL"));
+ clist.append (clist_ec);
+
+ var edomain_decl = new CCodeVariableDeclarator ("values[]", clist);
+
+ cdecl = new CCodeDeclaration ("const GEnumValue");
+ cdecl.add_declarator (edomain_decl);
+ cdecl.modifiers = CCodeModifiers.STATIC;
+
+ type_init.add_statement (cdecl);
+
reg_call.add_argument (new CCodeIdentifier ("values"));
} else {
reg_call.add_argument (new CCodeIdentifier ("&g_define_type_info"));
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
FOO_ERROR_BAR
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
GObject parent_instance;
FooPrivate * priv;
GMainLoop* loop = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
static void foo_bar_data_free (gpointer _data);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
foo_bar_data_free (gpointer _data)
{
* generated from asynchronous_catch_error_scope.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
-#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FooData FooData;
typedef struct _Block1Data Block1Data;
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _FooData {
int _state_;
GObject* _source_object_;
};
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
static void foo_data_free (gpointer _data);
VALA_EXTERN void foo (GAsyncReadyCallback _callback_,
gpointer _user_data_);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
foo_data_free (gpointer _data)
{
* generated from asynchronous_catch_in_finally.vala, do not modify */
#include <glib.h>
-#include <gio/gio.h>
#include <glib-object.h>
+#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
typedef struct _FailData FailData;
typedef struct _MayFailData MayFailData;
typedef struct _FooData FooData;
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _FailData {
int _state_;
GObject* _source_object_;
GMainLoop* loop = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
static void fail_data_free (gpointer _data);
VALA_EXTERN void fail (GAsyncReadyCallback _callback_,
gpointer _user_data_);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
fail_data_free (gpointer _data)
{
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_MANAM (manam_get_type ())
#define MANAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MANAM, Manam))
#define MANAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MANAM, ManamClass))
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Manam {
GObject parent_instance;
ManamPrivate * priv;
GMainLoop* loop = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Manam, g_object_unref)
VALA_EXTERN Manam* manam_new (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
Manam*
manam_construct (GType object_type)
{
#define TYPE_FOO_FLAG (foo_flag_get_type ())
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO_STRUCT (foo_struct_get_type ())
typedef struct _FooStruct FooStruct;
typedef enum {
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _FooStruct {
gint i;
};
VALA_EXTERN GType foo_enum_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType foo_flag_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType foo_struct_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FooStruct* foo_struct_dup (const FooStruct* self);
VALA_EXTERN void foo_struct_free (FooStruct* self);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
FooStruct*
foo_struct_dup (const FooStruct* self)
{
* generated from control_flow_bug764440.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
typedef enum {
FOO_ERROR_BAR
} FooError;
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN const gchar* get_bar (GError** error);
static void _vala_main (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
const gchar*
get_bar (GError** error)
{
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
GTypeInstance parent_instance;
volatile int ref_count;
static gpointer foo_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer foo_ref (gpointer instance);
VALA_EXTERN void foo_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_foo (const gchar* name,
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static inline gpointer
foo_get_instance_private (Foo* self)
{
#endif
#endif
+#define TYPE_TEST_ERROR (test_error_get_type ())
+
#define TYPE_TEST (test_get_type ())
#define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
#define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST))
TEST_ERROR_WORSE
} TestError;
#define TEST_ERROR test_error_quark ()
+
struct _TestIface {
GTypeInterface parent_iface;
void (*test_void) (Test* self, GError** error);
};
VALA_EXTERN GQuark test_error_quark (void);
+GType test_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType test_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint test_register_object (void* object,
GDBusConnection* connection,
#endif
#endif
+#define TYPE_TEST_ERROR (test_error_get_type ())
+
#define TYPE_TEST (test_get_type ())
#define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
#define TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST, TestClass))
TEST_ERROR_WORSE
} TestError;
#define TEST_ERROR test_error_quark ()
+
struct _Test {
GObject parent_instance;
TestPrivate * priv;
GMainLoop* main_loop = NULL;
VALA_EXTERN GQuark test_error_quark (void);
+GType test_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
VALA_EXTERN guint test_register_object (void* object,
* generated from delegates_error_pos.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
-#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#if !defined(VALA_EXTERN)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
typedef gchar* (*FooFunc) (gint i, GError** error, gpointer user_data);
#define TYPE_BAR (bar_get_type ())
FOO_ERROR_BAR
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Bar {
GTypeInstance parent_instance;
volatile int ref_count;
static gpointer bar_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer bar_ref (gpointer instance);
VALA_EXTERN void bar_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_bar (const gchar* name,
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
gchar*
bar_foo (Bar* self,
GError** error,
* generated from delegates_params_array_with_throws.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
typedef void (*FooFunc) (GError** error, const gchar* _first_array, ...);
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void foo (GError** error,
gchar* _first_array,
...);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAD, "FOO_ERROR_BAD", "bad"}, {FOO_ERROR_WORSE, "FOO_ERROR_WORSE", "worse"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
_vala_array_add1 (const gchar** * array,
gint* length,
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include <glib-object.h>
#include <stdarg.h>
#if !defined(VALA_EXTERN)
typedef void (*FooFunc) (const gchar* first, ...);
typedef void (*BarFunc) (const gchar* first, ...);
+
+#define TYPE_BAZ_ERROR (baz_error_get_type ())
typedef void (*BazFunc) (const gchar* first, GError** error, ...);
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define BAZ_ERROR baz_error_quark ()
VALA_EXTERN GQuark baz_error_quark (void);
+GType baz_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void foo (const gchar* first,
...);
VALA_EXTERN void baz (const gchar* first,
return g_quark_from_static_string ("baz-error-quark");
}
+static GType
+baz_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{BAZ_ERROR_BAD, "BAZ_ERROR_BAD", "bad"}, {BAZ_ERROR_WORSE, "BAZ_ERROR_WORSE", "worse"}, {0, NULL, NULL}};
+ GType baz_error_type_id;
+ baz_error_type_id = g_enum_register_static ("BazError", values);
+ return baz_error_type_id;
+}
+
+GType
+baz_error_get_type (void)
+{
+ static volatile gsize baz_error_type_id__once = 0;
+ if (g_once_init_enter (&baz_error_type_id__once)) {
+ GType baz_error_type_id;
+ baz_error_type_id = baz_error_get_type_once ();
+ g_once_init_leave (&baz_error_type_id__once, baz_error_type_id);
+ }
+ return baz_error_type_id__once;
+}
+
void
foo (const gchar* first,
...)
typedef struct _Foo Foo;
typedef struct _FooClass FooClass;
+
+#define TYPE_ERROR (error_get_type ())
typedef struct _FooPrivate FooPrivate;
enum {
FOO_0_PROPERTY,
ERROR_FOOBAR
} Error;
#define ERROR error_quark ()
+
struct _Foo {
GObject parent_instance;
FooPrivate * priv;
VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
VALA_EXTERN GQuark error_quark (void);
+GType error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Foo* foo_new (GError** error);
VALA_EXTERN Foo* foo_construct (GType object_type,
GError** error);
return g_quark_from_static_string ("error-quark");
}
+static GType
+error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{ERROR_FOOBAR, "ERROR_FOOBAR", "foobar"}, {0, NULL, NULL}};
+ GType error_type_id;
+ error_type_id = g_enum_register_static ("Error", values);
+ return error_type_id;
+}
+
+GType
+error_get_type (void)
+{
+ static volatile gsize error_type_id__once = 0;
+ if (g_once_init_enter (&error_type_id__once)) {
+ GType error_type_id;
+ error_type_id = error_get_type_once ();
+ g_once_init_leave (&error_type_id__once, error_type_id);
+ }
+ return error_type_id__once;
+}
+
static gpointer
_g_object_ref0 (gpointer self)
{
* generated from errors_bug579101.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void do_foo (gint* i);
VALA_EXTERN gchar* do_bar (gint* i);
VALA_EXTERN gchar* do_manam (gint* i);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
do_foo (gint* i)
{
#endif
#endif
+#define TYPE_FOO (foo_get_type ())
+
#define TYPE_CLS_A (cls_a_get_type ())
#define CLS_A(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLS_A, ClsA))
#define CLS_A_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLS_A, ClsAClass))
FOO_BAR
} Foo;
#define FOO foo_quark ()
+
struct _ClsA {
GObject parent_instance;
ClsAPrivate * priv;
static gpointer cls_b_parent_class = NULL;
VALA_EXTERN GQuark foo_quark (void);
+GType foo_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType cls_a_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClsA, g_object_unref)
VALA_EXTERN ClsA* cls_a_new (GError** error);
return g_quark_from_static_string ("foo-quark");
}
+static GType
+foo_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_BAR, "FOO_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_type_id;
+ foo_type_id = g_enum_register_static ("Foo", values);
+ return foo_type_id;
+}
+
+GType
+foo_get_type (void)
+{
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
+ GType foo_type_id;
+ foo_type_id = foo_get_type_once ();
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
+ }
+ return foo_type_id__once;
+}
+
ClsA*
cls_a_construct (GType object_type,
GError** error)
* generated from errors_bug778224.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
typedef struct _Foo Foo;
typedef enum {
FOO_ERROR_BAR
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
gint i;
};
gboolean true = TRUE;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Foo foo (GError** error);
static void _vala_main (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
Foo
foo (GError** error)
{
* generated from errors_catch_error_code.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
typedef enum {
FOO_ERROR_BAR,
FOO_ERROR_FOO
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
static void _vala_main (void);
GQuark
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {FOO_ERROR_FOO, "FOO_ERROR_FOO", "foo"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
_vala_main (void)
{
* generated from errors_catch_in_finally.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void fail (GError** error);
VALA_EXTERN void may_fail (GError** error);
VALA_EXTERN void foo (GError** error);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
fail (GError** error)
{
#endif
#endif
+#define TYPE_FOO (foo_get_type ())
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define FOO foo_quark ()
VALA_EXTERN GQuark foo_quark (void);
+GType foo_get_type (void) G_GNUC_CONST ;
static void _vala_main (void);
GQuark
return g_quark_from_static_string ("foo-quark");
}
+static GType
+foo_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_MANAM, "FOO_MANAM", "manam"}, {0, NULL, NULL}};
+ GType foo_type_id;
+ foo_type_id = g_enum_register_static ("Foo", values);
+ return foo_type_id;
+}
+
+GType
+foo_get_type (void)
+{
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
+ GType foo_type_id;
+ foo_type_id = foo_get_type_once ();
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
+ }
+ return foo_type_id__once;
+}
+
static void
_vala_main (void)
{
* generated from errors_delegate_throws_error_code.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
typedef void (*FooFunc) (gpointer user_data, GError** error);
typedef enum {
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
static void _vala_main (void);
static void __lambda4_ (GError** error);
static void ___lambda4__foo_func (gpointer self,
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FOO, "FOO_ERROR_FOO", "foo"}, {FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
__lambda4_ (GError** error)
{
* generated from errors_errorcode.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <gio/gio.h>
#if !defined(VALA_EXTERN)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void bar (gint code);
static void _vala_main (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_REALLY_BAD, "FOO_ERROR_REALLY_BAD", "really-bad"}, {FOO_ERROR_NOT_SO_GOOD, "FOO_ERROR_NOT_SO_GOOD", "not-so-good"}, {FOO_ERROR_EVEN_WORSE, "FOO_ERROR_EVEN_WORSE", "even-worse"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
bar (gint code)
{
* generated from errors_errordomain_static_method.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO (foo_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define FOO foo_quark ()
VALA_EXTERN GQuark foo_quark (void);
+GType foo_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GError* foo_from_string (const gchar* _error_);
static void _vala_main (void);
return g_quark_from_static_string ("foo-quark");
}
+static GType
+foo_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_BAD, "FOO_BAD", "bad"}, {0, NULL, NULL}};
+ GType foo_type_id;
+ foo_type_id = g_enum_register_static ("Foo", values);
+ return foo_type_id;
+}
+
+GType
+foo_get_type (void)
+{
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
+ GType foo_type_id;
+ foo_type_id = foo_get_type_once ();
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
+ }
+ return foo_type_id__once;
+}
+
static void
_vala_main (void)
{
* generated from errors_errordomain.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO (foo_get_type ())
+
typedef enum {
FOO_BAD
} Foo;
#define FOO foo_quark ()
VALA_EXTERN GQuark foo_quark (void);
+GType foo_get_type (void) G_GNUC_CONST ;
static void _vala_main (void);
GQuark
return g_quark_from_static_string ("foo-quark");
}
+static GType
+foo_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_BAD, "FOO_BAD", "bad"}, {0, NULL, NULL}};
+ GType foo_type_id;
+ foo_type_id = g_enum_register_static ("Foo", values);
+ return foo_type_id;
+}
+
+GType
+foo_get_type (void)
+{
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
+ GType foo_type_id;
+ foo_type_id = foo_get_type_once ();
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
+ }
+ return foo_type_id__once;
+}
+
static void
_vala_main (void)
{
#endif
#endif
+#define TYPE_BAR_ERROR (bar_error_get_type ())
+
#define TYPE_BAR (bar_get_type ())
#define BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAR, Bar))
#define BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BAR, BarClass))
BAR_ERROR_BAR
} BarError;
#define BAR_ERROR bar_error_quark ()
+
struct _Bar {
GObject parent_instance;
BarPrivate * priv;
static gpointer bar_parent_class = NULL;
VALA_EXTERN GQuark bar_error_quark (void);
+GType bar_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
VALA_EXTERN void bar_foo (Bar* self,
return g_quark_from_static_string ("bar-error-quark");
}
+static GType
+bar_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{BAR_ERROR_FOO, "BAR_ERROR_FOO", "foo"}, {BAR_ERROR_BAR, "BAR_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType bar_error_type_id;
+ bar_error_type_id = g_enum_register_static ("BarError", values);
+ return bar_error_type_id;
+}
+
+GType
+bar_error_get_type (void)
+{
+ static volatile gsize bar_error_type_id__once = 0;
+ if (g_once_init_enter (&bar_error_type_id__once)) {
+ GType bar_error_type_id;
+ bar_error_type_id = bar_error_get_type_once ();
+ g_once_init_leave (&bar_error_type_id__once, bar_error_type_id);
+ }
+ return bar_error_type_id__once;
+}
+
void
bar_foo (Bar* self,
GError** error)
* generated from errors_loops.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
typedef enum {
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar** get_array (gint* result_length1,
GError** error);
VALA_EXTERN gboolean get_bool (GError** error);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
gchar**
get_array (gint* result_length1,
GError** error)
* generated from errors_method_throws_error_code.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
typedef enum {
FOO_ERROR_FOO,
FOO_ERROR_BAR
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void foo (GError** error);
static void _vala_main (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FOO, "FOO_ERROR_FOO", "foo"}, {FOO_ERROR_BAR, "FOO_ERROR_BAR", "bar"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
foo (GError** error)
{
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
GObject parent_instance;
FooPrivate * priv;
static gpointer foo_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
VALA_EXTERN Foo* foo_new (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
Foo*
foo_construct (GType object_type)
{
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include <glib-object.h>
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#endif
#endif
+#define TYPE_TEST_ERROR (test_error_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef enum {
static void _vala_main (gchar** args,
gint args_length1);
VALA_EXTERN GQuark test_error_quark (void);
+GType test_error_get_type (void) G_GNUC_CONST ;
static void
_vala_main (gchar** args,
return g_quark_from_static_string ("test-error-quark");
}
+static GType
+test_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{TEST_ERROR_FAIL, "TEST_ERROR_FAIL", "fail"}, {TEST_ERROR_BAD, "TEST_ERROR_BAD", "bad"}, {TEST_ERROR_WORSE, "TEST_ERROR_WORSE", "worse"}, {0, NULL, NULL}};
+ GType test_error_type_id;
+ test_error_type_id = g_enum_register_static ("TestError", values);
+ return test_error_type_id;
+}
+
+GType
+test_error_get_type (void)
+{
+ static volatile gsize test_error_type_id__once = 0;
+ if (g_once_init_enter (&test_error_type_id__once)) {
+ GType test_error_type_id;
+ test_error_type_id = test_error_get_type_once ();
+ g_once_init_leave (&test_error_type_id__once, test_error_type_id);
+ }
+ return test_error_type_id__once;
+}
+
<bitfield name="RenamedBitfield" c:type="GirTestNamedBitfield" glib:type-name="GirTestNamedBitfield" glib:get-type="gir_test_named_bitfield_get_type">
<member name="value1" c:identifier="GIR_TEST_NAMED_BITFIELD_VALUE1" value="1"/>
</bitfield>
- <enumeration name="ErrorTest" c:type="GirTestErrorTest" glib:error-domain="gir-test-error-test-quark">
+ <enumeration name="ErrorTest" c:type="GirTestErrorTest" glib:type-name="GirTestErrorTest" glib:get-type="gir_test_error_test_get_type" glib:error-domain="gir-test-error-test-quark">
<member name="failed" c:identifier="GIR_TEST_ERROR_TEST_FAILED" value="0"/>
<member name="smelly" c:identifier="GIR_TEST_ERROR_TEST_SMELLY" value="1"/>
<member name="fishy" c:identifier="GIR_TEST_ERROR_TEST_FISHY" value="23"/>
</enumeration>
- <enumeration name="RenamedError" c:type="GirTestNamedError" glib:error-domain="gir-test-named-error-quark">
+ <enumeration name="PlainErrorTest" c:type="GirTestPlainErrorTest" glib:error-domain="gir-test-plain-error-test-quark">
+ <member name="failed" c:identifier="GIR_TEST_PLAIN_ERROR_TEST_FAILED" value="0"/>
+ <member name="smelly" c:identifier="GIR_TEST_PLAIN_ERROR_TEST_SMELLY" value="1"/>
+ <member name="fishy" c:identifier="GIR_TEST_PLAIN_ERROR_TEST_FISHY" value="23"/>
+ </enumeration>
+ <enumeration name="RenamedError" c:type="GirTestNamedError" glib:type-name="GirTestNamedError" glib:get-type="gir_test_named_error_get_type" glib:error-domain="gir-test-named-error-quark">
<member name="failed" c:identifier="GIR_TEST_NAMED_ERROR_FAILED" value="0"/>
</enumeration>
<class name="TypeTest" c:type="GirTestTypeTest" c:symbol-prefix="typetest" glib:type-name="GirTestTypeTest" glib:get-type="gir_test_typetest_get_type" glib:type-struct="TypeTestClass" glib:fundamental="1" glib:ref-func="gir_test_typetest_ref" glib:unref-func="gir_test_typetest_unref" glib:set-value-func="gir_test_value_set_typetest" glib:get-value-func="gir_test_value_get_typetest">
FISHY = 23
}
+ [CCode (has_type_id = false)]
+ public errordomain PlainErrorTest {
+ FAILED,
+ SMELLY,
+ FISHY = 23
+ }
+
[GIR (name = "RenamedError")]
public errordomain NamedError {
FAILED
public errordomain NamedError {
FAILED
}
+ [CCode (cheader_filename = "girtest.h", has_type_id = false)]
+ public errordomain PlainErrorTest {
+ FAILED,
+ SMELLY,
+ FISHY
+ }
[CCode (cheader_filename = "girtest.h")]
public delegate bool DelegateErrorTest () throws GirTest.ErrorTest;
[CCode (cheader_filename = "girtest.h")]
public enum RenamedEnumeration {
VALUE1
}
- [CCode (cheader_filename = "girtest.h", cprefix = "GIR_TEST_ERROR_TEST_")]
+ [CCode (cheader_filename = "girtest.h", cprefix = "GIR_TEST_ERROR_TEST_", type_id = "gir_test_error_test_get_type ()")]
public errordomain ErrorTest {
FAILED,
SMELLY,
FISHY
}
- [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedError", cprefix = "GIR_TEST_NAMED_ERROR_")]
+ [CCode (cheader_filename = "girtest.h", cprefix = "GIR_TEST_PLAIN_ERROR_TEST_", has_type_id = false)]
+ public errordomain PlainErrorTest {
+ FAILED,
+ SMELLY,
+ FISHY
+ }
+ [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedError", cprefix = "GIR_TEST_NAMED_ERROR_", type_id = "gir_test_named_error_get_type ()")]
public errordomain RenamedError {
FAILED
}
* generated from methods_bug781061.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
typedef enum {
FOO_ERROR_FAILED
} FooError;
#define FOO_ERROR foo_error_quark ()
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void print_something_throws (gboolean ok,
const gchar* format,
GError** error,
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAILED, "FOO_ERROR_FAILED", "failed"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
print_something_throws (gboolean ok,
const gchar* format,
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_MANAM (manam_get_type ())
#define MANAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MANAM, Manam))
#define MANAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MANAM, ManamClass))
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Manam {
GObject parent_instance;
ManamPrivate * priv;
static gpointer manam_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Manam, g_object_unref)
VALA_EXTERN Manam* manam_new (void);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
Manam*
manam_construct (GType object_type)
{
* generated from methods_params_array_with_throws.vala, do not modify */
#include <glib.h>
+#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
-#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#if !defined(VALA_EXTERN)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
FOO_ERROR_WORSE
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
GTypeInstance parent_instance;
volatile int ref_count;
static gpointer foo_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void foo (GError** error,
const gchar* _first_array,
...);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAD, "FOO_ERROR_BAD", "bad"}, {FOO_ERROR_WORSE, "FOO_ERROR_WORSE", "worse"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
static void
_vala_array_add1 (const gchar** * array,
gint* length,
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_FOO (foo_get_type ())
#define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo))
#define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass))
FOO_ERROR_FAIL
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Foo {
GTypeInstance parent_instance;
volatile int ref_count;
static gpointer foo_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer foo_ref (gpointer instance);
VALA_EXTERN void foo_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_foo (const gchar* name,
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
void
foo_foo (Foo* self,
const gchar* s)
#endif
#endif
+#define TYPE_FOO_ERROR (foo_error_get_type ())
+
#define TYPE_BAR (bar_get_type ())
typedef struct _Bar Bar;
FOO_ERROR_BAD
} FooError;
#define FOO_ERROR foo_error_quark ()
+
struct _Bar {
gint i;
};
static gpointer foo_parent_class = NULL;
VALA_EXTERN GQuark foo_error_quark (void);
+GType foo_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Bar* bar_dup (const Bar* self);
VALA_EXTERN void bar_free (Bar* self);
return g_quark_from_static_string ("foo-error-quark");
}
+static GType
+foo_error_get_type_once (void)
+{
+ static const GEnumValue values[] = {{FOO_ERROR_BAD, "FOO_ERROR_BAD", "bad"}, {0, NULL, NULL}};
+ GType foo_error_type_id;
+ foo_error_type_id = g_enum_register_static ("FooError", values);
+ return foo_error_type_id;
+}
+
+GType
+foo_error_get_type (void)
+{
+ static volatile gsize foo_error_type_id__once = 0;
+ if (g_once_init_enter (&foo_error_type_id__once)) {
+ GType foo_error_type_id;
+ foo_error_type_id = foo_error_get_type_once ();
+ g_once_init_leave (&foo_error_type_id__once, foo_error_type_id);
+ }
+ return foo_error_type_id__once;
+}
+
Bar*
bar_dup (const Bar* self)
{
}
}
+ /**
+ * The nick of this error code
+ */
+ public string nick {
+ get {
+ if (_nick == null) {
+ _nick = get_attribute_string ("Description", "nick");
+ if (_nick == null) {
+ _nick = name.down ().replace ("_", "-");
+ }
+ }
+ return _nick;
+ }
+ }
+
private Expression _value;
private Constant _code;
+ private string? _nick = null;
/**
* Creates a new enum value.