Logo Search packages:      
Sourcecode: vala-0.14 version File versions  Download package

valaccodedelegatemodule.c

/* valaccodedelegatemodule.c generated by valac, the Vala compiler
 * generated from valaccodedelegatemodule.vala, do not modify */

/* valaccodedelegatemodule.vala
 *
 * Copyright (C) 2006-2010  Jürg Billeter
 * Copyright (C) 2006-2008  Raffaele Sandrini
 *
 * 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:
 *    Jürg Billeter <j@bitron.ch>
 *    Raffaele Sandrini <raffaele@sandrini.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <valaccode.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>


#define VALA_TYPE_CCODE_BASE_MODULE (vala_ccode_base_module_get_type ())
#define VALA_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModule))
#define VALA_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))
#define VALA_IS_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_IS_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_CCODE_BASE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))

typedef struct _ValaCCodeBaseModule ValaCCodeBaseModule;
typedef struct _ValaCCodeBaseModuleClass ValaCCodeBaseModuleClass;
typedef struct _ValaCCodeBaseModulePrivate ValaCCodeBaseModulePrivate;

#define VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT (vala_ccode_base_module_emit_context_get_type ())
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContext))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))

typedef struct _ValaCCodeBaseModuleEmitContext ValaCCodeBaseModuleEmitContext;
typedef struct _ValaCCodeBaseModuleEmitContextClass ValaCCodeBaseModuleEmitContextClass;

#define VALA_TYPE_CCODE_STRUCT_MODULE (vala_ccode_struct_module_get_type ())
#define VALA_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModule))
#define VALA_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))
#define VALA_IS_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_IS_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_CCODE_STRUCT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))

typedef struct _ValaCCodeStructModule ValaCCodeStructModule;
typedef struct _ValaCCodeStructModuleClass ValaCCodeStructModuleClass;
typedef struct _ValaCCodeStructModulePrivate ValaCCodeStructModulePrivate;

#define VALA_TYPE_CCODE_METHOD_MODULE (vala_ccode_method_module_get_type ())
#define VALA_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModule))
#define VALA_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))
#define VALA_IS_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_IS_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_CCODE_METHOD_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))

typedef struct _ValaCCodeMethodModule ValaCCodeMethodModule;
typedef struct _ValaCCodeMethodModuleClass ValaCCodeMethodModuleClass;
typedef struct _ValaCCodeMethodModulePrivate ValaCCodeMethodModulePrivate;

#define VALA_TYPE_CCODE_CONTROL_FLOW_MODULE (vala_ccode_control_flow_module_get_type ())
#define VALA_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModule))
#define VALA_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_CCODE_CONTROL_FLOW_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))

typedef struct _ValaCCodeControlFlowModule ValaCCodeControlFlowModule;
typedef struct _ValaCCodeControlFlowModuleClass ValaCCodeControlFlowModuleClass;
typedef struct _ValaCCodeControlFlowModulePrivate ValaCCodeControlFlowModulePrivate;

#define VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE (vala_ccode_member_access_module_get_type ())
#define VALA_CCODE_MEMBER_ACCESS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModule))
#define VALA_CCODE_MEMBER_ACCESS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModuleClass))
#define VALA_IS_CCODE_MEMBER_ACCESS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE))
#define VALA_IS_CCODE_MEMBER_ACCESS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE))
#define VALA_CCODE_MEMBER_ACCESS_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_MEMBER_ACCESS_MODULE, ValaCCodeMemberAccessModuleClass))

typedef struct _ValaCCodeMemberAccessModule ValaCCodeMemberAccessModule;
typedef struct _ValaCCodeMemberAccessModuleClass ValaCCodeMemberAccessModuleClass;
typedef struct _ValaCCodeMemberAccessModulePrivate ValaCCodeMemberAccessModulePrivate;

#define VALA_TYPE_CCODE_ASSIGNMENT_MODULE (vala_ccode_assignment_module_get_type ())
#define VALA_CCODE_ASSIGNMENT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModule))
#define VALA_CCODE_ASSIGNMENT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModuleClass))
#define VALA_IS_CCODE_ASSIGNMENT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE))
#define VALA_IS_CCODE_ASSIGNMENT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_ASSIGNMENT_MODULE))
#define VALA_CCODE_ASSIGNMENT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_ASSIGNMENT_MODULE, ValaCCodeAssignmentModuleClass))

typedef struct _ValaCCodeAssignmentModule ValaCCodeAssignmentModule;
typedef struct _ValaCCodeAssignmentModuleClass ValaCCodeAssignmentModuleClass;
typedef struct _ValaCCodeAssignmentModulePrivate ValaCCodeAssignmentModulePrivate;

#define VALA_TYPE_CCODE_METHOD_CALL_MODULE (vala_ccode_method_call_module_get_type ())
#define VALA_CCODE_METHOD_CALL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModule))
#define VALA_CCODE_METHOD_CALL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModuleClass))
#define VALA_IS_CCODE_METHOD_CALL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE))
#define VALA_IS_CCODE_METHOD_CALL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_METHOD_CALL_MODULE))
#define VALA_CCODE_METHOD_CALL_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_METHOD_CALL_MODULE, ValaCCodeMethodCallModuleClass))

typedef struct _ValaCCodeMethodCallModule ValaCCodeMethodCallModule;
typedef struct _ValaCCodeMethodCallModuleClass ValaCCodeMethodCallModuleClass;
typedef struct _ValaCCodeMethodCallModulePrivate ValaCCodeMethodCallModulePrivate;

#define VALA_TYPE_CCODE_ARRAY_MODULE (vala_ccode_array_module_get_type ())
#define VALA_CCODE_ARRAY_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModule))
#define VALA_CCODE_ARRAY_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModuleClass))
#define VALA_IS_CCODE_ARRAY_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_ARRAY_MODULE))
#define VALA_IS_CCODE_ARRAY_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_ARRAY_MODULE))
#define VALA_CCODE_ARRAY_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_ARRAY_MODULE, ValaCCodeArrayModuleClass))

typedef struct _ValaCCodeArrayModule ValaCCodeArrayModule;
typedef struct _ValaCCodeArrayModuleClass ValaCCodeArrayModuleClass;
typedef struct _ValaCCodeArrayModulePrivate ValaCCodeArrayModulePrivate;

#define VALA_TYPE_CCODE_DELEGATE_MODULE (vala_ccode_delegate_module_get_type ())
#define VALA_CCODE_DELEGATE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModule))
#define VALA_CCODE_DELEGATE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModuleClass))
#define VALA_IS_CCODE_DELEGATE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE))
#define VALA_IS_CCODE_DELEGATE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_DELEGATE_MODULE))
#define VALA_CCODE_DELEGATE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModuleClass))

typedef struct _ValaCCodeDelegateModule ValaCCodeDelegateModule;
typedef struct _ValaCCodeDelegateModuleClass ValaCCodeDelegateModuleClass;
typedef struct _ValaCCodeDelegateModulePrivate ValaCCodeDelegateModulePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
#define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

#define VALA_TYPE_GLIB_VALUE (vala_glib_value_get_type ())
#define VALA_GLIB_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_GLIB_VALUE, ValaGLibValue))
#define VALA_GLIB_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_GLIB_VALUE, ValaGLibValueClass))
#define VALA_IS_GLIB_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_GLIB_VALUE))
#define VALA_IS_GLIB_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_GLIB_VALUE))
#define VALA_GLIB_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_GLIB_VALUE, ValaGLibValueClass))

typedef struct _ValaGLibValue ValaGLibValue;
typedef struct _ValaGLibValueClass ValaGLibValueClass;
typedef struct _ValaGLibValuePrivate ValaGLibValuePrivate;
#define _vala_iterator_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterator_unref (var), NULL)))

struct _ValaCCodeBaseModule {
      ValaCodeGenerator parent_instance;
      ValaCCodeBaseModulePrivate * priv;
      ValaSymbol* root_symbol;
      ValaCCodeBaseModuleEmitContext* emit_context;
      ValaCCodeFile* header_file;
      ValaCCodeFile* internal_header_file;
      ValaCCodeFile* cfile;
      ValaCCodeBaseModuleEmitContext* class_init_context;
      ValaCCodeBaseModuleEmitContext* base_init_context;
      ValaCCodeBaseModuleEmitContext* class_finalize_context;
      ValaCCodeBaseModuleEmitContext* base_finalize_context;
      ValaCCodeBaseModuleEmitContext* instance_init_context;
      ValaCCodeBaseModuleEmitContext* instance_finalize_context;
      ValaCCodeStruct* param_spec_struct;
      ValaCCodeStruct* closure_struct;
      ValaCCodeEnum* prop_enum;
      ValaSet* user_marshal_set;
      ValaSet* predefined_marshal_set;
      gint next_regex_id;
      gboolean in_constructor;
      gboolean in_static_or_class_context;
      gint next_coroutine_state;
      ValaDataType* void_type;
      ValaDataType* bool_type;
      ValaDataType* char_type;
      ValaDataType* uchar_type;
      ValaDataType* unichar_type;
      ValaDataType* short_type;
      ValaDataType* ushort_type;
      ValaDataType* int_type;
      ValaDataType* uint_type;
      ValaDataType* long_type;
      ValaDataType* ulong_type;
      ValaDataType* int8_type;
      ValaDataType* uint8_type;
      ValaDataType* int16_type;
      ValaDataType* uint16_type;
      ValaDataType* int32_type;
      ValaDataType* uint32_type;
      ValaDataType* int64_type;
      ValaDataType* uint64_type;
      ValaDataType* string_type;
      ValaDataType* regex_type;
      ValaDataType* float_type;
      ValaDataType* double_type;
      ValaTypeSymbol* gtype_type;
      ValaTypeSymbol* gobject_type;
      ValaErrorType* gerror_type;
      ValaClass* glist_type;
      ValaClass* gslist_type;
      ValaClass* gnode_type;
      ValaClass* gvaluearray_type;
      ValaTypeSymbol* gstringbuilder_type;
      ValaTypeSymbol* garray_type;
      ValaTypeSymbol* gbytearray_type;
      ValaTypeSymbol* gptrarray_type;
      ValaTypeSymbol* gthreadpool_type;
      ValaDataType* gdestroynotify_type;
      ValaDataType* gquark_type;
      ValaStruct* gvalue_type;
      ValaClass* gvariant_type;
      ValaStruct* mutex_type;
      ValaTypeSymbol* type_module_type;
      ValaTypeSymbol* dbus_proxy_type;
      gboolean in_plugin;
      gchar* module_init_param_name;
      gboolean gvaluecollector_h_needed;
      gboolean requires_array_free;
      gboolean requires_array_move;
      gboolean requires_array_length;
      ValaSet* wrappers;
};

struct _ValaCCodeBaseModuleClass {
      ValaCodeGeneratorClass parent_class;
      void (*append_vala_array_free) (ValaCCodeBaseModule* self);
      void (*append_vala_array_move) (ValaCCodeBaseModule* self);
      void (*append_vala_array_length) (ValaCCodeBaseModule* self);
      gboolean (*generate_enum_declaration) (ValaCCodeBaseModule* self, ValaEnum* en, ValaCCodeFile* decl_space);
      void (*generate_class_struct_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_struct_declaration) (ValaCCodeBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
      void (*generate_delegate_declaration) (ValaCCodeBaseModule* self, ValaDelegate* d, ValaCCodeFile* decl_space);
      void (*generate_cparameters) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaCCodeFunction* func, ValaCCodeFunctionDeclarator* vdeclarator, ValaMap* carg_map, ValaCCodeFunctionCall* vcall, gint direction);
      ValaCCodeExpression* (*get_dup_func_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaSourceReference* source_reference, gboolean is_chainup);
      gchar* (*append_struct_array_free) (ValaCCodeBaseModule* self, ValaStruct* st);
      ValaCCodeExpression* (*destroy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, gboolean is_macro_definition);
      void (*append_scope_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, ValaCodeNode* stop_at);
      ValaTargetValue* (*get_local_cvalue) (ValaCCodeBaseModule* self, ValaLocalVariable* local);
      ValaTargetValue* (*get_parameter_cvalue) (ValaCCodeBaseModule* self, ValaParameter* param);
      ValaTargetValue* (*get_field_cvalue) (ValaCCodeBaseModule* self, ValaField* field, ValaTargetValue* instance);
      ValaTargetValue* (*load_this_parameter) (ValaCCodeBaseModule* self, ValaTypeSymbol* sym);
      void (*store_value) (ValaCCodeBaseModule* self, ValaTargetValue* lvalue, ValaTargetValue* value);
      gchar* (*get_delegate_target_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaCCodeExpression* (*get_delegate_target_cexpression) (ValaCCodeBaseModule* self, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify);
      ValaCCodeExpression* (*get_delegate_target_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      ValaCCodeExpression* (*get_delegate_target_destroy_notify_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      gchar* (*get_delegate_target_destroy_notify_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaTargetValue* (*copy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, ValaCodeNode* node);
      void (*generate_class_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_interface_declaration) (ValaCCodeBaseModule* self, ValaInterface* iface, ValaCCodeFile* decl_space);
      void (*generate_method_declaration) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space);
      void (*generate_error_domain_declaration) (ValaCCodeBaseModule* self, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
      ValaCCodeExpression* (*deserialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* variant_expr, ValaCCodeExpression* expr, ValaCCodeExpression* error_expr, gboolean* may_fail);
      ValaCCodeExpression* (*serialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* expr);
      ValaCCodeExpression* (*get_implicit_cast_expression) (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaCodeNode* node);
      gboolean (*is_gobject_property) (ValaCCodeBaseModule* self, ValaProperty* prop);
      gchar* (*get_custom_creturn_type) (ValaCCodeBaseModule* self, ValaMethod* m);
      void (*generate_dynamic_method_wrapper) (ValaCCodeBaseModule* self, ValaDynamicMethod* method);
      gboolean (*method_has_wrapper) (ValaCCodeBaseModule* self, ValaMethod* method);
      ValaCCodeFunctionCall* (*get_param_spec) (ValaCCodeBaseModule* self, ValaProperty* prop);
      ValaCCodeFunctionCall* (*get_signal_creation) (ValaCCodeBaseModule* self, ValaSignal* sig, ValaTypeSymbol* type);
      void (*register_dbus_info) (ValaCCodeBaseModule* self, ValaCCodeBlock* block, ValaObjectTypeSymbol* bindable);
      gchar* (*get_dynamic_property_getter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_property_setter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_signal_cname) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_after_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_disconnect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_array_length_cname) (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
      gchar* (*get_parameter_array_length_cname) (ValaCCodeBaseModule* self, ValaParameter* param, gint dim);
      ValaCCodeExpression* (*get_array_length_cexpression) (ValaCCodeBaseModule* self, ValaExpression* array_expr, gint dim);
      ValaCCodeExpression* (*get_array_length_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value, gint dim);
      gchar* (*get_array_size_cname) (ValaCCodeBaseModule* self, const gchar* array_cname);
      void (*add_simple_check) (ValaCCodeBaseModule* self, ValaCodeNode* node, gboolean always_fails);
      gchar* (*generate_ready_function) (ValaCCodeBaseModule* self, ValaMethod* m);
};

struct _ValaCCodeStructModule {
      ValaCCodeBaseModule parent_instance;
      ValaCCodeStructModulePrivate * priv;
};

struct _ValaCCodeStructModuleClass {
      ValaCCodeBaseModuleClass parent_class;
};

struct _ValaCCodeMethodModule {
      ValaCCodeStructModule parent_instance;
      ValaCCodeMethodModulePrivate * priv;
};

struct _ValaCCodeMethodModuleClass {
      ValaCCodeStructModuleClass parent_class;
      void (*generate_method_result_declaration) (ValaCCodeMethodModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaCCodeFunction* cfunc, ValaMap* cparam_map, ValaMap* carg_map);
      ValaCCodeParameter* (*generate_parameter) (ValaCCodeMethodModule* self, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map);
};

struct _ValaCCodeControlFlowModule {
      ValaCCodeMethodModule parent_instance;
      ValaCCodeControlFlowModulePrivate * priv;
};

struct _ValaCCodeControlFlowModuleClass {
      ValaCCodeMethodModuleClass parent_class;
};

struct _ValaCCodeMemberAccessModule {
      ValaCCodeControlFlowModule parent_instance;
      ValaCCodeMemberAccessModulePrivate * priv;
};

struct _ValaCCodeMemberAccessModuleClass {
      ValaCCodeControlFlowModuleClass parent_class;
};

struct _ValaCCodeAssignmentModule {
      ValaCCodeMemberAccessModule parent_instance;
      ValaCCodeAssignmentModulePrivate * priv;
};

struct _ValaCCodeAssignmentModuleClass {
      ValaCCodeMemberAccessModuleClass parent_class;
};

struct _ValaCCodeMethodCallModule {
      ValaCCodeAssignmentModule parent_instance;
      ValaCCodeMethodCallModulePrivate * priv;
};

struct _ValaCCodeMethodCallModuleClass {
      ValaCCodeAssignmentModuleClass parent_class;
};

struct _ValaCCodeArrayModule {
      ValaCCodeMethodCallModule parent_instance;
      ValaCCodeArrayModulePrivate * priv;
};

struct _ValaCCodeArrayModuleClass {
      ValaCCodeMethodCallModuleClass parent_class;
};

00358 struct _ValaCCodeDelegateModule {
      ValaCCodeArrayModule parent_instance;
      ValaCCodeDelegateModulePrivate * priv;
};

00363 struct _ValaCCodeDelegateModuleClass {
      ValaCCodeArrayModuleClass parent_class;
};

struct _ValaGLibValue {
      ValaTargetValue parent_instance;
      ValaGLibValuePrivate * priv;
      ValaCCodeExpression* cvalue;
      gboolean non_null;
      gchar* ctype;
      ValaList* array_length_cvalues;
      ValaCCodeExpression* array_size_cvalue;
      gboolean array_null_terminated;
      ValaCCodeExpression* array_length_cexpr;
      ValaCCodeExpression* delegate_target_cvalue;
      ValaCCodeExpression* delegate_target_destroy_notify_cvalue;
};

struct _ValaGLibValueClass {
      ValaTargetValueClass parent_class;
};


static gpointer vala_ccode_delegate_module_parent_class = NULL;

GType vala_ccode_base_module_get_type (void) G_GNUC_CONST;
gpointer vala_ccode_base_module_emit_context_ref (gpointer instance);
void vala_ccode_base_module_emit_context_unref (gpointer instance);
GParamSpec* vala_ccode_base_module_param_spec_emit_context (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_ccode_base_module_value_set_emit_context (GValue* value, gpointer v_object);
void vala_ccode_base_module_value_take_emit_context (GValue* value, gpointer v_object);
gpointer vala_ccode_base_module_value_get_emit_context (const GValue* value);
GType vala_ccode_base_module_emit_context_get_type (void) G_GNUC_CONST;
GType vala_ccode_struct_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_method_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_control_flow_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_member_access_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_assignment_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_method_call_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_array_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_delegate_module_get_type (void) G_GNUC_CONST;
enum  {
      VALA_CCODE_DELEGATE_MODULE_DUMMY_PROPERTY
};
static void vala_ccode_delegate_module_real_generate_delegate_declaration (ValaCCodeBaseModule* base, ValaDelegate* d, ValaCCodeFile* decl_space);
gboolean vala_ccode_base_module_add_symbol_declaration (ValaCCodeBaseModule* self, ValaCCodeFile* decl_space, ValaSymbol* sym, const gchar* name);
void vala_ccode_base_module_generate_type_declaration (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeFile* decl_space);
ValaCCodeParameter* vala_ccode_method_module_generate_parameter (ValaCCodeMethodModule* self, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map);
gchar* vala_ccode_base_module_get_parameter_array_length_cname (ValaCCodeBaseModule* self, ValaParameter* param, gint dim);
gchar* vala_ccode_base_module_get_delegate_target_cname (ValaCCodeBaseModule* self, const gchar* delegate_cname);
gchar* vala_ccode_base_module_get_variable_cname (ValaCCodeBaseModule* self, const gchar* name);
gchar* vala_ccode_base_module_get_delegate_target_destroy_notify_cname (ValaCCodeBaseModule* self, const gchar* delegate_cname);
gchar* vala_ccode_base_module_get_array_length_cname (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
static void vala_ccode_delegate_module_real_visit_delegate (ValaCodeVisitor* base, ValaDelegate* d);
void vala_ccode_base_module_generate_delegate_declaration (ValaCCodeBaseModule* self, ValaDelegate* d, ValaCCodeFile* decl_space);
static gchar* vala_ccode_delegate_module_real_get_delegate_target_cname (ValaCCodeBaseModule* base, const gchar* delegate_cname);
static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_cexpression (ValaCCodeBaseModule* base, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify);
ValaCCodeExpression* vala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (ValaCCodeBaseModule* self, ValaTargetValue* value);
ValaCCodeExpression* vala_ccode_base_module_get_delegate_target_cvalue (ValaCCodeBaseModule* self, ValaTargetValue* value);
static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_cvalue (ValaCCodeBaseModule* base, ValaTargetValue* value);
GType vala_glib_value_get_type (void) G_GNUC_CONST;
static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cvalue (ValaCCodeBaseModule* base, ValaTargetValue* value);
static gchar* vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cname (ValaCCodeBaseModule* base, const gchar* delegate_cname);
static ValaCCodeExpression* vala_ccode_delegate_module_real_get_implicit_cast_expression (ValaCCodeBaseModule* base, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaCodeNode* node);
static gchar* vala_ccode_delegate_module_generate_delegate_wrapper (ValaCCodeDelegateModule* self, ValaMethod* m, ValaDelegateType* dt, ValaCodeNode* node);
ValaCCodeExpression* vala_ccode_base_module_get_implicit_cast_expression (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaCodeNode* node);
gchar* vala_ccode_base_module_get_dynamic_signal_cname (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
gboolean vala_ccode_base_module_add_wrapper (ValaCCodeBaseModule* self, const gchar* wrapper_name);
void vala_ccode_base_module_push_function (ValaCCodeBaseModule* self, ValaCCodeFunction* func);
gint vala_ccode_base_module_get_param_pos (ValaCCodeBaseModule* self, gdouble param_pos, gboolean ellipsis);
ValaCCodeFunction* vala_ccode_base_module_get_ccode (ValaCCodeBaseModule* self);
gint vala_ccode_base_module_get_block_id (ValaCCodeBaseModule* self, ValaBlock* b);
ValaBlock* vala_ccode_base_module_get_current_closure_block (ValaCCodeBaseModule* self);
ValaDataType* vala_ccode_base_module_get_this_type (ValaCCodeBaseModule* self);
ValaCCodeExpression* vala_ccode_base_module_get_destroy_func_expression (ValaCCodeBaseModule* self, ValaDataType* type, gboolean is_chainup);
void vala_ccode_base_module_pop_function (ValaCCodeBaseModule* self);
static ValaCCodeParameter* vala_ccode_delegate_module_real_generate_parameter (ValaCCodeMethodModule* base, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map);
ValaCCodeExpression* vala_ccode_base_module_get_variable_cexpression (ValaCCodeBaseModule* self, const gchar* name);
ValaCCodeDelegateModule* vala_ccode_delegate_module_new (void);
ValaCCodeDelegateModule* vala_ccode_delegate_module_construct (GType object_type);
ValaCCodeArrayModule* vala_ccode_array_module_new (void);
ValaCCodeArrayModule* vala_ccode_array_module_construct (GType object_type);


static gpointer _vala_code_node_ref0 (gpointer self) {
      return self ? vala_code_node_ref (self) : NULL;
}


static void vala_ccode_delegate_module_real_generate_delegate_declaration (ValaCCodeBaseModule* base, ValaDelegate* d, ValaCCodeFile* decl_space) {
      ValaCCodeDelegateModule * self;
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      gboolean _tmp2_;
      gboolean _tmp3_;
      ValaDataType* _tmp4_ = NULL;
      gchar* _tmp5_ = NULL;
      gchar* return_type_cname;
      ValaDataType* _tmp6_ = NULL;
      gboolean _tmp7_;
      gchar* _tmp9_ = NULL;
      gchar* _tmp10_;
      gboolean _tmp11_;
      gchar* _tmp14_ = NULL;
      gchar* _tmp15_;
      ValaCCodeFunctionDeclarator* _tmp16_ = NULL;
      ValaCCodeFunctionDeclarator* _tmp17_;
      ValaCCodeFunctionDeclarator* cfundecl;
      gboolean _tmp57_ = FALSE;
      gboolean _tmp58_;
      gboolean _tmp96_;
      ValaList* _tmp98_ = NULL;
      ValaList* _tmp99_;
      gint _tmp100_;
      gboolean _tmp101_;
      ValaCCodeTypeDefinition* _tmp103_ = NULL;
      ValaCCodeTypeDefinition* ctypedef;
      gboolean _tmp104_;
      self = (ValaCCodeDelegateModule*) base;
      g_return_if_fail (d != NULL);
      g_return_if_fail (decl_space != NULL);
      _tmp0_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_base_module_add_symbol_declaration ((ValaCCodeBaseModule*) self, decl_space, (ValaSymbol*) d, _tmp1_);
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      if (_tmp3_) {
            return;
      }
      _tmp4_ = vala_delegate_get_return_type (d);
      _tmp5_ = vala_data_type_get_cname (_tmp4_);
      return_type_cname = _tmp5_;
      _tmp6_ = vala_delegate_get_return_type (d);
      _tmp7_ = vala_data_type_is_real_non_null_struct_type (_tmp6_);
      if (_tmp7_) {
            gchar* _tmp8_;
            _tmp8_ = g_strdup ("void");
            _g_free0 (return_type_cname);
            return_type_cname = _tmp8_;
      }
      _tmp9_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
      _tmp10_ = _tmp9_;
      _tmp11_ = g_strcmp0 (return_type_cname, _tmp10_) == 0;
      _g_free0 (_tmp10_);
      if (_tmp11_) {
            gchar* _tmp12_;
            _tmp12_ = g_strdup ("GCallback");
            _g_free0 (return_type_cname);
            return_type_cname = _tmp12_;
      } else {
            ValaDataType* _tmp13_ = NULL;
            _tmp13_ = vala_delegate_get_return_type (d);
            vala_ccode_base_module_generate_type_declaration ((ValaCCodeBaseModule*) self, _tmp13_, decl_space);
      }
      _tmp14_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
      _tmp15_ = _tmp14_;
      _tmp16_ = vala_ccode_function_declarator_new (_tmp15_);
      _tmp17_ = _tmp16_;
      _g_free0 (_tmp15_);
      cfundecl = _tmp17_;
      {
            ValaList* _tmp18_ = NULL;
            ValaList* _param_list;
            gint _tmp19_;
            gint _param_size;
            gint _param_index;
            _tmp18_ = vala_delegate_get_parameters (d);
            _param_list = _tmp18_;
            _tmp19_ = vala_collection_get_size ((ValaCollection*) _param_list);
            _param_size = _tmp19_;
            _param_index = -1;
            while (TRUE) {
                  gpointer _tmp20_ = NULL;
                  ValaParameter* param;
                  ValaHashMap* _tmp21_ = NULL;
                  ValaHashMap* _tmp22_;
                  ValaCCodeParameter* _tmp23_ = NULL;
                  ValaCCodeParameter* _tmp24_;
                  ValaCCodeParameter* cparam;
                  gboolean _tmp25_ = FALSE;
                  gboolean _tmp26_;
                  ValaDataType* _tmp38_ = NULL;
                  _param_index = _param_index + 1;
                  if (!(_param_index < _param_size)) {
                        break;
                  }
                  _tmp20_ = vala_list_get (_param_list, _param_index);
                  param = (ValaParameter*) _tmp20_;
                  _tmp21_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
                  _tmp22_ = _tmp21_;
                  _tmp23_ = vala_ccode_method_module_generate_parameter ((ValaCCodeMethodModule*) self, param, decl_space, (ValaMap*) _tmp22_, NULL);
                  _tmp24_ = _tmp23_;
                  _vala_map_unref0 (_tmp22_);
                  cparam = _tmp24_;
                  vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                  _tmp26_ = vala_variable_get_no_array_length ((ValaVariable*) param);
                  if (!_tmp26_) {
                        ValaDataType* _tmp27_ = NULL;
                        _tmp27_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp25_ = VALA_IS_ARRAY_TYPE (_tmp27_);
                  } else {
                        _tmp25_ = FALSE;
                  }
                  if (_tmp25_) {
                        ValaDataType* _tmp28_ = NULL;
                        ValaArrayType* _tmp29_;
                        ValaArrayType* array_type;
                        gchar* _tmp30_;
                        gchar* length_ctype;
                        ValaParameterDirection _tmp31_;
                        _tmp28_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp29_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp28_));
                        array_type = _tmp29_;
                        _tmp30_ = g_strdup ("int");
                        length_ctype = _tmp30_;
                        _tmp31_ = vala_parameter_get_direction (param);
                        if (_tmp31_ != VALA_PARAMETER_DIRECTION_IN) {
                              gchar* _tmp32_;
                              _tmp32_ = g_strdup ("int*");
                              _g_free0 (length_ctype);
                              length_ctype = _tmp32_;
                        }
                        {
                              gint dim;
                              dim = 1;
                              {
                                    gboolean _tmp33_;
                                    _tmp33_ = TRUE;
                                    while (TRUE) {
                                          gint _tmp34_;
                                          gchar* _tmp35_ = NULL;
                                          gchar* _tmp36_;
                                          ValaCCodeParameter* _tmp37_ = NULL;
                                          if (!_tmp33_) {
                                                dim++;
                                          }
                                          _tmp33_ = FALSE;
                                          _tmp34_ = vala_array_type_get_rank (array_type);
                                          if (!(dim <= _tmp34_)) {
                                                break;
                                          }
                                          _tmp35_ = vala_ccode_base_module_get_parameter_array_length_cname ((ValaCCodeBaseModule*) self, param, dim);
                                          _tmp36_ = _tmp35_;
                                          _tmp37_ = vala_ccode_parameter_new (_tmp36_, length_ctype);
                                          _vala_ccode_node_unref0 (cparam);
                                          cparam = _tmp37_;
                                          _g_free0 (_tmp36_);
                                          vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                                    }
                              }
                        }
                        _g_free0 (length_ctype);
                        _vala_code_node_unref0 (array_type);
                  }
                  _tmp38_ = vala_variable_get_variable_type ((ValaVariable*) param);
                  if (VALA_IS_DELEGATE_TYPE (_tmp38_)) {
                        ValaDataType* _tmp39_ = NULL;
                        ValaDelegateType* _tmp40_;
                        ValaDelegateType* deleg_type;
                        ValaDelegate* _tmp41_ = NULL;
                        ValaDelegate* _tmp42_;
                        ValaDelegate* param_d;
                        gboolean _tmp43_;
                        _tmp39_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp40_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp39_));
                        deleg_type = _tmp40_;
                        _tmp41_ = vala_delegate_type_get_delegate_symbol (deleg_type);
                        _tmp42_ = _vala_code_node_ref0 (_tmp41_);
                        param_d = _tmp42_;
                        _tmp43_ = vala_delegate_get_has_target (param_d);
                        if (_tmp43_) {
                              const gchar* _tmp44_ = NULL;
                              gchar* _tmp45_ = NULL;
                              gchar* _tmp46_;
                              gchar* _tmp47_ = NULL;
                              gchar* _tmp48_;
                              ValaCCodeParameter* _tmp49_ = NULL;
                              gboolean _tmp50_;
                              _tmp44_ = vala_symbol_get_name ((ValaSymbol*) param);
                              _tmp45_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp44_);
                              _tmp46_ = _tmp45_;
                              _tmp47_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, _tmp46_);
                              _tmp48_ = _tmp47_;
                              _tmp49_ = vala_ccode_parameter_new (_tmp48_, "void*");
                              _vala_ccode_node_unref0 (cparam);
                              cparam = _tmp49_;
                              _g_free0 (_tmp48_);
                              _g_free0 (_tmp46_);
                              vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                              _tmp50_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                              if (_tmp50_) {
                                    const gchar* _tmp51_ = NULL;
                                    gchar* _tmp52_ = NULL;
                                    gchar* _tmp53_;
                                    gchar* _tmp54_ = NULL;
                                    gchar* _tmp55_;
                                    ValaCCodeParameter* _tmp56_ = NULL;
                                    _tmp51_ = vala_symbol_get_name ((ValaSymbol*) param);
                                    _tmp52_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp51_);
                                    _tmp53_ = _tmp52_;
                                    _tmp54_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, _tmp53_);
                                    _tmp55_ = _tmp54_;
                                    _tmp56_ = vala_ccode_parameter_new (_tmp55_, "GDestroyNotify*");
                                    _vala_ccode_node_unref0 (cparam);
                                    cparam = _tmp56_;
                                    _g_free0 (_tmp55_);
                                    _g_free0 (_tmp53_);
                                    vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                              }
                        }
                        _vala_code_node_unref0 (param_d);
                        _vala_code_node_unref0 (deleg_type);
                  }
                  _vala_ccode_node_unref0 (cparam);
                  _vala_code_node_unref0 (param);
            }
            _vala_iterable_unref0 (_param_list);
      }
      _tmp58_ = vala_delegate_get_no_array_length (d);
      if (!_tmp58_) {
            ValaDataType* _tmp59_ = NULL;
            _tmp59_ = vala_delegate_get_return_type (d);
            _tmp57_ = VALA_IS_ARRAY_TYPE (_tmp59_);
      } else {
            _tmp57_ = FALSE;
      }
      if (_tmp57_) {
            ValaDataType* _tmp60_ = NULL;
            ValaArrayType* _tmp61_;
            ValaArrayType* array_type;
            const gchar* _tmp62_ = NULL;
            const gchar* _tmp63_ = NULL;
            gchar* _tmp65_;
            gchar* array_length_type;
            gchar* _tmp66_;
            _tmp60_ = vala_delegate_get_return_type (d);
            _tmp61_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp60_));
            array_type = _tmp61_;
            _tmp63_ = vala_delegate_get_array_length_type (d);
            if (_tmp63_ != NULL) {
                  const gchar* _tmp64_ = NULL;
                  _tmp64_ = vala_delegate_get_array_length_type (d);
                  _tmp62_ = _tmp64_;
            } else {
                  _tmp62_ = "int";
            }
            _tmp65_ = g_strdup (_tmp62_);
            array_length_type = _tmp65_;
            _tmp66_ = g_strconcat (array_length_type, "*", NULL);
            _g_free0 (array_length_type);
            array_length_type = _tmp66_;
            {
                  gint dim;
                  dim = 1;
                  {
                        gboolean _tmp67_;
                        _tmp67_ = TRUE;
                        while (TRUE) {
                              gint _tmp68_;
                              gchar* _tmp69_ = NULL;
                              gchar* _tmp70_;
                              ValaCCodeParameter* _tmp71_ = NULL;
                              ValaCCodeParameter* _tmp72_;
                              ValaCCodeParameter* cparam;
                              if (!_tmp67_) {
                                    dim++;
                              }
                              _tmp67_ = FALSE;
                              _tmp68_ = vala_array_type_get_rank (array_type);
                              if (!(dim <= _tmp68_)) {
                                    break;
                              }
                              _tmp69_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, "result", dim);
                              _tmp70_ = _tmp69_;
                              _tmp71_ = vala_ccode_parameter_new (_tmp70_, array_length_type);
                              _tmp72_ = _tmp71_;
                              _g_free0 (_tmp70_);
                              cparam = _tmp72_;
                              vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                              _vala_ccode_node_unref0 (cparam);
                        }
                  }
            }
            _g_free0 (array_length_type);
            _vala_code_node_unref0 (array_type);
      } else {
            ValaDataType* _tmp73_ = NULL;
            _tmp73_ = vala_delegate_get_return_type (d);
            if (VALA_IS_DELEGATE_TYPE (_tmp73_)) {
                  ValaDataType* _tmp74_ = NULL;
                  ValaDelegateType* _tmp75_;
                  ValaDelegateType* deleg_type;
                  ValaDelegate* _tmp76_ = NULL;
                  ValaDelegate* _tmp77_;
                  ValaDelegate* result_d;
                  gboolean _tmp78_;
                  _tmp74_ = vala_delegate_get_return_type (d);
                  _tmp75_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp74_));
                  deleg_type = _tmp75_;
                  _tmp76_ = vala_delegate_type_get_delegate_symbol (deleg_type);
                  _tmp77_ = _vala_code_node_ref0 (_tmp76_);
                  result_d = _tmp77_;
                  _tmp78_ = vala_delegate_get_has_target (result_d);
                  if (_tmp78_) {
                        gchar* _tmp79_ = NULL;
                        gchar* _tmp80_;
                        ValaCCodeParameter* _tmp81_ = NULL;
                        ValaCCodeParameter* _tmp82_;
                        ValaCCodeParameter* cparam;
                        gboolean _tmp83_;
                        _tmp79_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, "result");
                        _tmp80_ = _tmp79_;
                        _tmp81_ = vala_ccode_parameter_new (_tmp80_, "void**");
                        _tmp82_ = _tmp81_;
                        _g_free0 (_tmp80_);
                        cparam = _tmp82_;
                        vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                        _tmp83_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                        if (_tmp83_) {
                              gchar* _tmp84_ = NULL;
                              gchar* _tmp85_;
                              ValaCCodeParameter* _tmp86_ = NULL;
                              _tmp84_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, "result");
                              _tmp85_ = _tmp84_;
                              _tmp86_ = vala_ccode_parameter_new (_tmp85_, "GDestroyNotify*");
                              _vala_ccode_node_unref0 (cparam);
                              cparam = _tmp86_;
                              _g_free0 (_tmp85_);
                              vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                        }
                        _vala_ccode_node_unref0 (cparam);
                  }
                  _vala_code_node_unref0 (result_d);
                  _vala_code_node_unref0 (deleg_type);
            } else {
                  ValaDataType* _tmp87_ = NULL;
                  gboolean _tmp88_;
                  _tmp87_ = vala_delegate_get_return_type (d);
                  _tmp88_ = vala_data_type_is_real_non_null_struct_type (_tmp87_);
                  if (_tmp88_) {
                        ValaDataType* _tmp89_ = NULL;
                        gchar* _tmp90_ = NULL;
                        gchar* _tmp91_;
                        gchar* _tmp92_ = NULL;
                        gchar* _tmp93_;
                        ValaCCodeParameter* _tmp94_ = NULL;
                        ValaCCodeParameter* _tmp95_;
                        ValaCCodeParameter* cparam;
                        _tmp89_ = vala_delegate_get_return_type (d);
                        _tmp90_ = vala_data_type_get_cname (_tmp89_);
                        _tmp91_ = _tmp90_;
                        _tmp92_ = g_strdup_printf ("%s*", _tmp91_);
                        _tmp93_ = _tmp92_;
                        _tmp94_ = vala_ccode_parameter_new ("result", _tmp93_);
                        _tmp95_ = _tmp94_;
                        _g_free0 (_tmp93_);
                        _g_free0 (_tmp91_);
                        cparam = _tmp95_;
                        vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
                        _vala_ccode_node_unref0 (cparam);
                  }
            }
      }
      _tmp96_ = vala_delegate_get_has_target (d);
      if (_tmp96_) {
            ValaCCodeParameter* _tmp97_ = NULL;
            ValaCCodeParameter* cparam;
            _tmp97_ = vala_ccode_parameter_new ("user_data", "void*");
            cparam = _tmp97_;
            vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
            _vala_ccode_node_unref0 (cparam);
      }
      _tmp98_ = vala_code_node_get_error_types ((ValaCodeNode*) d);
      _tmp99_ = _tmp98_;
      _tmp100_ = vala_collection_get_size ((ValaCollection*) _tmp99_);
      _tmp101_ = _tmp100_ > 0;
      _vala_iterable_unref0 (_tmp99_);
      if (_tmp101_) {
            ValaCCodeParameter* _tmp102_ = NULL;
            ValaCCodeParameter* cparam;
            _tmp102_ = vala_ccode_parameter_new ("error", "GError**");
            cparam = _tmp102_;
            vala_ccode_function_declarator_add_parameter (cfundecl, cparam);
            _vala_ccode_node_unref0 (cparam);
      }
      _tmp103_ = vala_ccode_type_definition_new (return_type_cname, (ValaCCodeDeclarator*) cfundecl);
      ctypedef = _tmp103_;
      _tmp104_ = vala_symbol_get_deprecated ((ValaSymbol*) d);
      vala_ccode_type_definition_set_deprecated (ctypedef, _tmp104_);
      vala_ccode_file_add_type_definition (decl_space, (ValaCCodeNode*) ctypedef);
      _vala_ccode_node_unref0 (ctypedef);
      _vala_ccode_node_unref0 (cfundecl);
      _g_free0 (return_type_cname);
}


static void vala_ccode_delegate_module_real_visit_delegate (ValaCodeVisitor* base, ValaDelegate* d) {
      ValaCCodeDelegateModule * self;
      gboolean _tmp0_;
      gboolean _tmp1_;
      self = (ValaCCodeDelegateModule*) base;
      g_return_if_fail (d != NULL);
      vala_code_node_accept_children ((ValaCodeNode*) d, (ValaCodeVisitor*) self);
      vala_ccode_base_module_generate_delegate_declaration ((ValaCCodeBaseModule*) self, d, ((ValaCCodeBaseModule*) self)->cfile);
      _tmp0_ = vala_symbol_is_internal_symbol ((ValaSymbol*) d);
      if (!_tmp0_) {
            vala_ccode_base_module_generate_delegate_declaration ((ValaCCodeBaseModule*) self, d, ((ValaCCodeBaseModule*) self)->header_file);
      }
      _tmp1_ = vala_symbol_is_private_symbol ((ValaSymbol*) d);
      if (!_tmp1_) {
            vala_ccode_base_module_generate_delegate_declaration ((ValaCCodeBaseModule*) self, d, ((ValaCCodeBaseModule*) self)->internal_header_file);
      }
}


static gchar* vala_ccode_delegate_module_real_get_delegate_target_cname (ValaCCodeBaseModule* base, const gchar* delegate_cname) {
      ValaCCodeDelegateModule * self;
      gchar* result = NULL;
      gchar* _tmp0_ = NULL;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (delegate_cname != NULL, NULL);
      _tmp0_ = g_strdup_printf ("%s_target", delegate_cname);
      result = _tmp0_;
      return result;
}


static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_cexpression (ValaCCodeBaseModule* base, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify) {
      ValaCCodeDelegateModule * self;
      ValaCCodeExpression* _delegate_target_destroy_notify = NULL;
      ValaCCodeExpression* result = NULL;
      ValaTargetValue* _tmp0_ = NULL;
      ValaCCodeExpression* _tmp1_ = NULL;
      ValaTargetValue* _tmp2_ = NULL;
      ValaCCodeExpression* _tmp3_ = NULL;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (delegate_expr != NULL, NULL);
      _tmp0_ = vala_expression_get_target_value (delegate_expr);
      _tmp1_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cvalue ((ValaCCodeBaseModule*) self, _tmp0_);
      _vala_ccode_node_unref0 (_delegate_target_destroy_notify);
      _delegate_target_destroy_notify = _tmp1_;
      _tmp2_ = vala_expression_get_target_value (delegate_expr);
      _tmp3_ = vala_ccode_base_module_get_delegate_target_cvalue ((ValaCCodeBaseModule*) self, _tmp2_);
      result = _tmp3_;
      if (delegate_target_destroy_notify) {
            *delegate_target_destroy_notify = _delegate_target_destroy_notify;
      } else {
            _vala_ccode_node_unref0 (_delegate_target_destroy_notify);
      }
      return result;
}


static gpointer _vala_ccode_node_ref0 (gpointer self) {
      return self ? vala_ccode_node_ref (self) : NULL;
}


static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_cvalue (ValaCCodeBaseModule* base, ValaTargetValue* value) {
      ValaCCodeDelegateModule * self;
      ValaCCodeExpression* result = NULL;
      ValaCCodeExpression* _tmp0_;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (value != NULL, NULL);
      _tmp0_ = _vala_ccode_node_ref0 (VALA_GLIB_VALUE (value)->delegate_target_cvalue);
      result = _tmp0_;
      return result;
}


static ValaCCodeExpression* vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cvalue (ValaCCodeBaseModule* base, ValaTargetValue* value) {
      ValaCCodeDelegateModule * self;
      ValaCCodeExpression* result = NULL;
      ValaCCodeExpression* _tmp0_;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (value != NULL, NULL);
      _tmp0_ = _vala_ccode_node_ref0 (VALA_GLIB_VALUE (value)->delegate_target_destroy_notify_cvalue);
      result = _tmp0_;
      return result;
}


static gchar* vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cname (ValaCCodeBaseModule* base, const gchar* delegate_cname) {
      ValaCCodeDelegateModule * self;
      gchar* result = NULL;
      gchar* _tmp0_ = NULL;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (delegate_cname != NULL, NULL);
      _tmp0_ = g_strdup_printf ("%s_target_destroy_notify", delegate_cname);
      result = _tmp0_;
      return result;
}


static ValaCCodeExpression* vala_ccode_delegate_module_real_get_implicit_cast_expression (ValaCCodeBaseModule* base, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaCodeNode* node) {
      ValaCCodeDelegateModule * self;
      ValaCCodeExpression* result = NULL;
      gboolean _tmp0_ = FALSE;
      ValaCCodeExpression* _tmp15_ = NULL;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (source_cexpr != NULL, NULL);
      if (VALA_IS_DELEGATE_TYPE (target_type)) {
            _tmp0_ = VALA_IS_METHOD_TYPE (expression_type);
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            ValaDelegateType* _tmp1_;
            ValaDelegateType* dt;
            ValaMethodType* _tmp2_;
            ValaMethodType* mt;
            ValaMethod* _tmp3_ = NULL;
            ValaMethod* _tmp4_;
            ValaMethod* method;
            ValaMethod* _tmp5_ = NULL;
            gchar* _tmp11_ = NULL;
            gchar* _tmp12_;
            ValaCCodeIdentifier* _tmp13_ = NULL;
            ValaCCodeExpression* _tmp14_;
            _tmp1_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (target_type));
            dt = _tmp1_;
            _tmp2_ = _vala_code_node_ref0 (VALA_METHOD_TYPE (expression_type));
            mt = _tmp2_;
            _tmp3_ = vala_method_type_get_method_symbol (mt);
            _tmp4_ = _vala_code_node_ref0 (_tmp3_);
            method = _tmp4_;
            _tmp5_ = vala_method_get_base_method (method);
            if (_tmp5_ != NULL) {
                  ValaMethod* _tmp6_ = NULL;
                  ValaMethod* _tmp7_;
                  _tmp6_ = vala_method_get_base_method (method);
                  _tmp7_ = _vala_code_node_ref0 (_tmp6_);
                  _vala_code_node_unref0 (method);
                  method = _tmp7_;
            } else {
                  ValaMethod* _tmp8_ = NULL;
                  _tmp8_ = vala_method_get_base_interface_method (method);
                  if (_tmp8_ != NULL) {
                        ValaMethod* _tmp9_ = NULL;
                        ValaMethod* _tmp10_;
                        _tmp9_ = vala_method_get_base_interface_method (method);
                        _tmp10_ = _vala_code_node_ref0 (_tmp9_);
                        _vala_code_node_unref0 (method);
                        method = _tmp10_;
                  }
            }
            _tmp11_ = vala_ccode_delegate_module_generate_delegate_wrapper (self, method, dt, node);
            _tmp12_ = _tmp11_;
            _tmp13_ = vala_ccode_identifier_new (_tmp12_);
            _tmp14_ = (ValaCCodeExpression*) _tmp13_;
            _g_free0 (_tmp12_);
            result = _tmp14_;
            _vala_code_node_unref0 (method);
            _vala_code_node_unref0 (mt);
            _vala_code_node_unref0 (dt);
            return result;
      }
      _tmp15_ = VALA_CCODE_BASE_MODULE_CLASS (vala_ccode_delegate_module_parent_class)->get_implicit_cast_expression ((ValaCCodeBaseModule*) VALA_CCODE_ARRAY_MODULE (self), source_cexpr, expression_type, target_type, node);
      result = _tmp15_;
      return result;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
      return self ? vala_iterable_ref (self) : NULL;
}


static gchar* vala_ccode_delegate_module_generate_delegate_wrapper (ValaCCodeDelegateModule* self, ValaMethod* m, ValaDelegateType* dt, ValaCodeNode* node) {
      gchar* result = NULL;
      ValaDelegate* _tmp0_ = NULL;
      ValaDelegate* _tmp1_;
      ValaDelegate* d;
      gchar* delegate_name = NULL;
      ValaSymbol* _tmp2_ = NULL;
      ValaSymbol* _tmp3_;
      ValaSignal* _tmp4_;
      ValaSignal* sig;
      ValaSignal* _tmp5_;
      ValaDynamicSignal* _tmp6_;
      ValaDynamicSignal* dynamic_sig;
      gchar* _tmp17_ = NULL;
      gchar* _tmp18_;
      gchar* _tmp19_ = NULL;
      gchar* _tmp20_;
      gchar* wrapper_name;
      gboolean _tmp21_;
      ValaDataType* _tmp22_ = NULL;
      gchar* _tmp23_ = NULL;
      gchar* return_type_cname;
      ValaDataType* _tmp24_ = NULL;
      gboolean _tmp25_;
      ValaCCodeFunction* _tmp27_ = NULL;
      ValaCCodeFunction* function;
      ValaHashMap* _tmp28_ = NULL;
      ValaHashMap* cparam_map;
      gboolean _tmp29_;
      ValaDataType* _tmp33_ = NULL;
      ValaList* _tmp38_ = NULL;
      ValaList* d_params;
      gboolean _tmp51_ = FALSE;
      gboolean _tmp52_;
      ValaList* _tmp96_ = NULL;
      ValaList* _tmp97_;
      gint _tmp98_;
      gboolean _tmp99_;
      gint last_pos;
      gint min_pos = 0;
      ValaHashMap* _tmp112_ = NULL;
      ValaHashMap* carg_map;
      gint i;
      gboolean _tmp113_ = FALSE;
      ValaMemberBinding _tmp114_;
      gboolean first;
      gboolean _tmp213_ = FALSE;
      gboolean _tmp214_;
      ValaList* _tmp250_ = NULL;
      ValaList* _tmp251_;
      gint _tmp252_;
      gboolean _tmp253_;
      gchar* _tmp257_ = NULL;
      gchar* _tmp258_;
      ValaCCodeIdentifier* _tmp259_ = NULL;
      ValaCCodeIdentifier* _tmp260_;
      ValaCCodeFunctionCall* _tmp261_ = NULL;
      ValaCCodeFunctionCall* _tmp262_;
      ValaCCodeFunctionCall* ccall;
      gboolean _tmp273_;
      gboolean _tmp278_ = FALSE;
      ValaDataType* _tmp279_ = NULL;
      gboolean _tmp286_ = FALSE;
      gboolean _tmp287_ = FALSE;
      gboolean _tmp288_;
      gboolean _tmp317_ = FALSE;
      ValaDataType* _tmp318_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      g_return_val_if_fail (m != NULL, NULL);
      g_return_val_if_fail (dt != NULL, NULL);
      _tmp0_ = vala_delegate_type_get_delegate_symbol (dt);
      _tmp1_ = _vala_code_node_ref0 (_tmp0_);
      d = _tmp1_;
      _tmp2_ = vala_symbol_get_parent_symbol ((ValaSymbol*) d);
      _tmp3_ = _tmp2_;
      _tmp4_ = _vala_code_node_ref0 (VALA_IS_SIGNAL (_tmp3_) ? ((ValaSignal*) _tmp3_) : NULL);
      sig = _tmp4_;
      _tmp5_ = sig;
      _tmp6_ = _vala_code_node_ref0 (VALA_IS_DYNAMIC_SIGNAL (_tmp5_) ? ((ValaDynamicSignal*) _tmp5_) : NULL);
      dynamic_sig = _tmp6_;
      if (dynamic_sig != NULL) {
            gchar* _tmp7_ = NULL;
            _tmp7_ = vala_ccode_base_module_get_dynamic_signal_cname ((ValaCCodeBaseModule*) self, dynamic_sig);
            _g_free0 (delegate_name);
            delegate_name = _tmp7_;
      } else {
            if (sig != NULL) {
                  ValaSymbol* _tmp8_ = NULL;
                  gchar* _tmp9_ = NULL;
                  gchar* _tmp10_;
                  gchar* _tmp11_ = NULL;
                  gchar* _tmp12_;
                  gchar* _tmp13_;
                  _tmp8_ = vala_symbol_get_parent_symbol ((ValaSymbol*) sig);
                  _tmp9_ = vala_symbol_get_lower_case_cprefix (_tmp8_);
                  _tmp10_ = _tmp9_;
                  _tmp11_ = vala_signal_get_cname (sig);
                  _tmp12_ = _tmp11_;
                  _tmp13_ = g_strconcat (_tmp10_, _tmp12_, NULL);
                  _g_free0 (delegate_name);
                  delegate_name = _tmp13_;
                  _g_free0 (_tmp12_);
                  _g_free0 (_tmp10_);
            } else {
                  gchar* _tmp14_ = NULL;
                  gchar* _tmp15_;
                  gchar* _tmp16_ = NULL;
                  _tmp14_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
                  _tmp15_ = _tmp14_;
                  _tmp16_ = vala_symbol_camel_case_to_lower_case (_tmp15_);
                  _g_free0 (delegate_name);
                  delegate_name = _tmp16_;
                  _g_free0 (_tmp15_);
            }
      }
      _tmp17_ = vala_method_get_cname (m);
      _tmp18_ = _tmp17_;
      _tmp19_ = g_strdup_printf ("_%s_%s", _tmp18_, delegate_name);
      _tmp20_ = _tmp19_;
      _g_free0 (_tmp18_);
      wrapper_name = _tmp20_;
      _tmp21_ = vala_ccode_base_module_add_wrapper ((ValaCCodeBaseModule*) self, wrapper_name);
      if (!_tmp21_) {
            result = wrapper_name;
            _vala_code_node_unref0 (dynamic_sig);
            _vala_code_node_unref0 (sig);
            _g_free0 (delegate_name);
            _vala_code_node_unref0 (d);
            return result;
      }
      _tmp22_ = vala_delegate_get_return_type (d);
      _tmp23_ = vala_data_type_get_cname (_tmp22_);
      return_type_cname = _tmp23_;
      _tmp24_ = vala_delegate_get_return_type (d);
      _tmp25_ = vala_data_type_is_real_non_null_struct_type (_tmp24_);
      if (_tmp25_) {
            gchar* _tmp26_;
            _tmp26_ = g_strdup ("void");
            _g_free0 (return_type_cname);
            return_type_cname = _tmp26_;
      }
      _tmp27_ = vala_ccode_function_new (wrapper_name, return_type_cname);
      function = _tmp27_;
      vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      vala_ccode_base_module_push_function ((ValaCCodeBaseModule*) self, function);
      _tmp28_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
      cparam_map = _tmp28_;
      _tmp29_ = vala_delegate_get_has_target (d);
      if (_tmp29_) {
            ValaCCodeParameter* _tmp30_ = NULL;
            ValaCCodeParameter* cparam;
            gdouble _tmp31_;
            gint _tmp32_;
            _tmp30_ = vala_ccode_parameter_new ("self", "gpointer");
            cparam = _tmp30_;
            _tmp31_ = vala_delegate_get_cinstance_parameter_position (d);
            _tmp32_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp31_, FALSE);
            vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp32_), cparam);
            _vala_ccode_node_unref0 (cparam);
      }
      _tmp33_ = vala_delegate_get_sender_type (d);
      if (_tmp33_ != NULL) {
            ValaDataType* _tmp34_ = NULL;
            ValaParameter* _tmp35_ = NULL;
            ValaParameter* param;
            ValaCCodeParameter* _tmp36_ = NULL;
            ValaCCodeParameter* _tmp37_;
            _tmp34_ = vala_delegate_get_sender_type (d);
            _tmp35_ = vala_parameter_new ("_sender", _tmp34_, NULL);
            param = _tmp35_;
            _tmp36_ = vala_ccode_method_module_generate_parameter ((ValaCCodeMethodModule*) self, param, ((ValaCCodeBaseModule*) self)->cfile, (ValaMap*) cparam_map, NULL);
            _tmp37_ = _tmp36_;
            _vala_ccode_node_unref0 (_tmp37_);
            _vala_code_node_unref0 (param);
      }
      _tmp38_ = vala_delegate_get_parameters (d);
      d_params = _tmp38_;
      {
            ValaList* _tmp39_;
            ValaList* _param_list;
            gint _tmp40_;
            gint _param_size;
            gint _param_index;
            _tmp39_ = _vala_iterable_ref0 (d_params);
            _param_list = _tmp39_;
            _tmp40_ = vala_collection_get_size ((ValaCollection*) _param_list);
            _param_size = _tmp40_;
            _param_index = -1;
            while (TRUE) {
                  gpointer _tmp41_ = NULL;
                  ValaParameter* param;
                  gboolean _tmp42_ = FALSE;
                  gboolean _tmp43_ = FALSE;
                  ValaCCodeParameter* _tmp49_ = NULL;
                  ValaCCodeParameter* _tmp50_;
                  _param_index = _param_index + 1;
                  if (!(_param_index < _param_size)) {
                        break;
                  }
                  _tmp41_ = vala_list_get (_param_list, _param_index);
                  param = (ValaParameter*) _tmp41_;
                  if (dynamic_sig != NULL) {
                        ValaDataType* _tmp44_ = NULL;
                        _tmp44_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp43_ = VALA_IS_ARRAY_TYPE (_tmp44_);
                  } else {
                        _tmp43_ = FALSE;
                  }
                  if (_tmp43_) {
                        ValaDataType* _tmp45_ = NULL;
                        ValaDataType* _tmp46_ = NULL;
                        ValaTypeSymbol* _tmp47_ = NULL;
                        ValaTypeSymbol* _tmp48_ = NULL;
                        _tmp45_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp46_ = vala_array_type_get_element_type (VALA_ARRAY_TYPE (_tmp45_));
                        _tmp47_ = vala_data_type_get_data_type (_tmp46_);
                        _tmp48_ = vala_data_type_get_data_type (((ValaCCodeBaseModule*) self)->string_type);
                        _tmp42_ = _tmp47_ == _tmp48_;
                  } else {
                        _tmp42_ = FALSE;
                  }
                  if (_tmp42_) {
                        vala_variable_set_no_array_length ((ValaVariable*) param, TRUE);
                        vala_variable_set_array_null_terminated ((ValaVariable*) param, TRUE);
                  }
                  _tmp49_ = vala_ccode_method_module_generate_parameter ((ValaCCodeMethodModule*) self, param, ((ValaCCodeBaseModule*) self)->cfile, (ValaMap*) cparam_map, NULL);
                  _tmp50_ = _tmp49_;
                  _vala_ccode_node_unref0 (_tmp50_);
                  _vala_code_node_unref0 (param);
            }
            _vala_iterable_unref0 (_param_list);
      }
      _tmp52_ = vala_delegate_get_no_array_length (d);
      if (!_tmp52_) {
            ValaDataType* _tmp53_ = NULL;
            _tmp53_ = vala_delegate_get_return_type (d);
            _tmp51_ = VALA_IS_ARRAY_TYPE (_tmp53_);
      } else {
            _tmp51_ = FALSE;
      }
      if (_tmp51_) {
            ValaDataType* _tmp54_ = NULL;
            ValaArrayType* _tmp55_;
            ValaArrayType* array_type;
            const gchar* _tmp56_ = NULL;
            const gchar* _tmp57_ = NULL;
            gchar* _tmp59_;
            gchar* array_length_type;
            gchar* _tmp60_;
            _tmp54_ = vala_delegate_get_return_type (d);
            _tmp55_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp54_));
            array_type = _tmp55_;
            _tmp57_ = vala_delegate_get_array_length_type (d);
            if (_tmp57_ != NULL) {
                  const gchar* _tmp58_ = NULL;
                  _tmp58_ = vala_delegate_get_array_length_type (d);
                  _tmp56_ = _tmp58_;
            } else {
                  _tmp56_ = "int";
            }
            _tmp59_ = g_strdup (_tmp56_);
            array_length_type = _tmp59_;
            _tmp60_ = g_strconcat (array_length_type, "*", NULL);
            _g_free0 (array_length_type);
            array_length_type = _tmp60_;
            {
                  gint dim;
                  dim = 1;
                  {
                        gboolean _tmp61_;
                        _tmp61_ = TRUE;
                        while (TRUE) {
                              gint _tmp62_;
                              gchar* _tmp63_ = NULL;
                              gchar* _tmp64_;
                              ValaCCodeParameter* _tmp65_ = NULL;
                              ValaCCodeParameter* _tmp66_;
                              ValaCCodeParameter* cparam;
                              gdouble _tmp67_;
                              gint _tmp68_;
                              if (!_tmp61_) {
                                    dim++;
                              }
                              _tmp61_ = FALSE;
                              _tmp62_ = vala_array_type_get_rank (array_type);
                              if (!(dim <= _tmp62_)) {
                                    break;
                              }
                              _tmp63_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, "result", dim);
                              _tmp64_ = _tmp63_;
                              _tmp65_ = vala_ccode_parameter_new (_tmp64_, array_length_type);
                              _tmp66_ = _tmp65_;
                              _g_free0 (_tmp64_);
                              cparam = _tmp66_;
                              _tmp67_ = vala_delegate_get_carray_length_parameter_position (d);
                              _tmp68_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp67_ + (0.01 * dim), FALSE);
                              vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp68_), cparam);
                              _vala_ccode_node_unref0 (cparam);
                        }
                  }
            }
            _g_free0 (array_length_type);
            _vala_code_node_unref0 (array_type);
      } else {
            ValaDataType* _tmp69_ = NULL;
            _tmp69_ = vala_delegate_get_return_type (d);
            if (VALA_IS_DELEGATE_TYPE (_tmp69_)) {
                  ValaDataType* _tmp70_ = NULL;
                  ValaDelegateType* _tmp71_;
                  ValaDelegateType* deleg_type;
                  ValaDelegate* _tmp72_ = NULL;
                  gboolean _tmp73_;
                  _tmp70_ = vala_delegate_get_return_type (d);
                  _tmp71_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp70_));
                  deleg_type = _tmp71_;
                  _tmp72_ = vala_delegate_type_get_delegate_symbol (deleg_type);
                  _tmp73_ = vala_delegate_get_has_target (_tmp72_);
                  if (_tmp73_) {
                        gchar* _tmp74_ = NULL;
                        gchar* _tmp75_;
                        ValaCCodeParameter* _tmp76_ = NULL;
                        ValaCCodeParameter* _tmp77_;
                        ValaCCodeParameter* cparam;
                        gdouble _tmp78_;
                        gint _tmp79_;
                        gboolean _tmp80_;
                        _tmp74_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, "result");
                        _tmp75_ = _tmp74_;
                        _tmp76_ = vala_ccode_parameter_new (_tmp75_, "void**");
                        _tmp77_ = _tmp76_;
                        _g_free0 (_tmp75_);
                        cparam = _tmp77_;
                        _tmp78_ = vala_delegate_get_cdelegate_target_parameter_position (d);
                        _tmp79_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp78_, FALSE);
                        vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp79_), cparam);
                        _tmp80_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                        if (_tmp80_) {
                              gchar* _tmp81_ = NULL;
                              gchar* _tmp82_;
                              ValaCCodeParameter* _tmp83_ = NULL;
                              gdouble _tmp84_;
                              gint _tmp85_;
                              _tmp81_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, "result");
                              _tmp82_ = _tmp81_;
                              _tmp83_ = vala_ccode_parameter_new (_tmp82_, "GDestroyNotify*");
                              _vala_ccode_node_unref0 (cparam);
                              cparam = _tmp83_;
                              _g_free0 (_tmp82_);
                              _tmp84_ = vala_delegate_get_cdelegate_target_parameter_position (d);
                              _tmp85_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp84_ + 0.01, FALSE);
                              vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp85_), cparam);
                        }
                        _vala_ccode_node_unref0 (cparam);
                  }
                  _vala_code_node_unref0 (deleg_type);
            } else {
                  ValaDataType* _tmp86_ = NULL;
                  gboolean _tmp87_;
                  _tmp86_ = vala_delegate_get_return_type (d);
                  _tmp87_ = vala_data_type_is_real_non_null_struct_type (_tmp86_);
                  if (_tmp87_) {
                        ValaDataType* _tmp88_ = NULL;
                        gchar* _tmp89_ = NULL;
                        gchar* _tmp90_;
                        gchar* _tmp91_ = NULL;
                        gchar* _tmp92_;
                        ValaCCodeParameter* _tmp93_ = NULL;
                        ValaCCodeParameter* _tmp94_;
                        ValaCCodeParameter* cparam;
                        gint _tmp95_;
                        _tmp88_ = vala_delegate_get_return_type (d);
                        _tmp89_ = vala_data_type_get_cname (_tmp88_);
                        _tmp90_ = _tmp89_;
                        _tmp91_ = g_strdup_printf ("%s*", _tmp90_);
                        _tmp92_ = _tmp91_;
                        _tmp93_ = vala_ccode_parameter_new ("result", _tmp92_);
                        _tmp94_ = _tmp93_;
                        _g_free0 (_tmp92_);
                        _g_free0 (_tmp90_);
                        cparam = _tmp94_;
                        _tmp95_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, (gdouble) (-3), FALSE);
                        vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp95_), cparam);
                        _vala_ccode_node_unref0 (cparam);
                  }
            }
      }
      _tmp96_ = vala_code_node_get_error_types ((ValaCodeNode*) m);
      _tmp97_ = _tmp96_;
      _tmp98_ = vala_collection_get_size ((ValaCollection*) _tmp97_);
      _tmp99_ = _tmp98_ > 0;
      _vala_iterable_unref0 (_tmp97_);
      if (_tmp99_) {
            ValaCCodeParameter* _tmp100_ = NULL;
            ValaCCodeParameter* cparam;
            gint _tmp101_;
            _tmp100_ = vala_ccode_parameter_new ("error", "GError**");
            cparam = _tmp100_;
            _tmp101_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, (gdouble) (-1), FALSE);
            vala_map_set ((ValaMap*) cparam_map, GINT_TO_POINTER (_tmp101_), cparam);
            _vala_ccode_node_unref0 (cparam);
      }
      last_pos = -1;
      while (TRUE) {
            gpointer _tmp110_ = NULL;
            ValaCCodeParameter* _tmp111_;
            min_pos = -1;
            {
                  ValaSet* _tmp102_ = NULL;
                  ValaSet* _tmp103_;
                  ValaIterator* _tmp104_ = NULL;
                  ValaIterator* _tmp105_;
                  ValaIterator* _pos_it;
                  _tmp102_ = vala_map_get_keys ((ValaMap*) cparam_map);
                  _tmp103_ = _tmp102_;
                  _tmp104_ = vala_iterable_iterator ((ValaIterable*) _tmp103_);
                  _tmp105_ = _tmp104_;
                  _vala_iterable_unref0 (_tmp103_);
                  _pos_it = _tmp105_;
                  while (TRUE) {
                        gboolean _tmp106_;
                        gpointer _tmp107_ = NULL;
                        gint pos;
                        gboolean _tmp108_ = FALSE;
                        _tmp106_ = vala_iterator_next (_pos_it);
                        if (!_tmp106_) {
                              break;
                        }
                        _tmp107_ = vala_iterator_get (_pos_it);
                        pos = GPOINTER_TO_INT (_tmp107_);
                        if (pos > last_pos) {
                              gboolean _tmp109_ = FALSE;
                              if (min_pos == (-1)) {
                                    _tmp109_ = TRUE;
                              } else {
                                    _tmp109_ = pos < min_pos;
                              }
                              _tmp108_ = _tmp109_;
                        } else {
                              _tmp108_ = FALSE;
                        }
                        if (_tmp108_) {
                              min_pos = pos;
                        }
                  }
                  _vala_iterator_unref0 (_pos_it);
            }
            if (min_pos == (-1)) {
                  break;
            }
            _tmp110_ = vala_map_get ((ValaMap*) cparam_map, GINT_TO_POINTER (min_pos));
            _tmp111_ = (ValaCCodeParameter*) _tmp110_;
            vala_ccode_function_add_parameter (function, _tmp111_);
            _vala_ccode_node_unref0 (_tmp111_);
            last_pos = min_pos;
      }
      _tmp112_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_EXPRESSION, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
      carg_map = _tmp112_;
      i = 0;
      _tmp114_ = vala_method_get_binding (m);
      if (_tmp114_ == VALA_MEMBER_BINDING_INSTANCE) {
            _tmp113_ = TRUE;
      } else {
            gboolean _tmp115_;
            _tmp115_ = vala_method_get_closure (m);
            _tmp113_ = _tmp115_;
      }
      if (_tmp113_) {
            ValaCCodeExpression* arg = NULL;
            gboolean _tmp116_;
            gdouble _tmp130_;
            gint _tmp131_;
            _tmp116_ = vala_delegate_get_has_target (d);
            if (_tmp116_) {
                  ValaCCodeIdentifier* _tmp117_ = NULL;
                  _tmp117_ = vala_ccode_identifier_new ("self");
                  _vala_ccode_node_unref0 (arg);
                  arg = (ValaCCodeExpression*) _tmp117_;
            } else {
                  gboolean _tmp118_ = FALSE;
                  gint _tmp119_;
                  _tmp119_ = vala_collection_get_size ((ValaCollection*) d_params);
                  if (_tmp119_ == 0) {
                        _tmp118_ = TRUE;
                  } else {
                        gboolean _tmp120_;
                        _tmp120_ = vala_method_get_closure (m);
                        _tmp118_ = _tmp120_;
                  }
                  if (_tmp118_) {
                        ValaSourceReference* _tmp121_ = NULL;
                        ValaCCodeConstant* _tmp123_ = NULL;
                        if (node != NULL) {
                              ValaSourceReference* _tmp122_ = NULL;
                              _tmp122_ = vala_code_node_get_source_reference (node);
                              _tmp121_ = _tmp122_;
                        } else {
                              _tmp121_ = NULL;
                        }
                        vala_report_error (_tmp121_, "Cannot create delegate without target for instance method or closure");
                        _tmp123_ = vala_ccode_constant_new ("NULL");
                        _vala_ccode_node_unref0 (arg);
                        arg = (ValaCCodeExpression*) _tmp123_;
                  } else {
                        gpointer _tmp124_ = NULL;
                        ValaParameter* _tmp125_;
                        const gchar* _tmp126_ = NULL;
                        gchar* _tmp127_ = NULL;
                        gchar* _tmp128_;
                        ValaCCodeIdentifier* _tmp129_ = NULL;
                        _tmp124_ = vala_list_get (d_params, 0);
                        _tmp125_ = (ValaParameter*) _tmp124_;
                        _tmp126_ = vala_symbol_get_name ((ValaSymbol*) _tmp125_);
                        _tmp127_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp126_);
                        _tmp128_ = _tmp127_;
                        _tmp129_ = vala_ccode_identifier_new (_tmp128_);
                        _vala_ccode_node_unref0 (arg);
                        arg = (ValaCCodeExpression*) _tmp129_;
                        _g_free0 (_tmp128_);
                        _vala_code_node_unref0 (_tmp125_);
                        i = 1;
                  }
            }
            _tmp130_ = vala_method_get_cinstance_parameter_position (m);
            _tmp131_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp130_, FALSE);
            vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp131_), arg);
            _vala_ccode_node_unref0 (arg);
      }
      first = TRUE;
      {
            ValaList* _tmp132_ = NULL;
            ValaList* _param_list;
            gint _tmp133_;
            gint _param_size;
            gint _param_index;
            _tmp132_ = vala_method_get_parameters (m);
            _param_list = _tmp132_;
            _tmp133_ = vala_collection_get_size ((ValaCollection*) _param_list);
            _param_size = _tmp133_;
            _param_index = -1;
            while (TRUE) {
                  gpointer _tmp134_ = NULL;
                  ValaParameter* param;
                  gboolean _tmp135_ = FALSE;
                  gboolean _tmp136_ = FALSE;
                  ValaCCodeExpression* arg = NULL;
                  gpointer _tmp148_ = NULL;
                  ValaParameter* _tmp149_;
                  const gchar* _tmp150_ = NULL;
                  gchar* _tmp151_ = NULL;
                  gchar* _tmp152_;
                  ValaCCodeIdentifier* _tmp153_ = NULL;
                  gdouble _tmp154_;
                  gint _tmp155_;
                  gboolean _tmp156_ = FALSE;
                  gboolean _tmp157_;
                  _param_index = _param_index + 1;
                  if (!(_param_index < _param_size)) {
                        break;
                  }
                  _tmp134_ = vala_list_get (_param_list, _param_index);
                  param = (ValaParameter*) _tmp134_;
                  if (first) {
                        ValaDataType* _tmp137_ = NULL;
                        _tmp137_ = vala_delegate_get_sender_type (d);
                        _tmp136_ = _tmp137_ != NULL;
                  } else {
                        _tmp136_ = FALSE;
                  }
                  if (_tmp136_) {
                        ValaList* _tmp138_ = NULL;
                        ValaList* _tmp139_;
                        gint _tmp140_;
                        ValaList* _tmp141_ = NULL;
                        ValaList* _tmp142_;
                        gint _tmp143_;
                        _tmp138_ = vala_method_get_parameters (m);
                        _tmp139_ = _tmp138_;
                        _tmp140_ = vala_collection_get_size ((ValaCollection*) _tmp139_);
                        _tmp141_ = vala_delegate_get_parameters (d);
                        _tmp142_ = _tmp141_;
                        _tmp143_ = vala_collection_get_size ((ValaCollection*) _tmp142_);
                        _tmp135_ = _tmp140_ == (_tmp143_ + 1);
                        _vala_iterable_unref0 (_tmp142_);
                        _vala_iterable_unref0 (_tmp139_);
                  } else {
                        _tmp135_ = FALSE;
                  }
                  if (_tmp135_) {
                        gdouble _tmp144_;
                        gint _tmp145_;
                        ValaCCodeIdentifier* _tmp146_ = NULL;
                        ValaCCodeIdentifier* _tmp147_;
                        _tmp144_ = vala_parameter_get_cparameter_position (param);
                        _tmp145_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp144_, FALSE);
                        _tmp146_ = vala_ccode_identifier_new ("_sender");
                        _tmp147_ = _tmp146_;
                        vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp145_), (ValaCCodeExpression*) _tmp147_);
                        _vala_ccode_node_unref0 (_tmp147_);
                        first = FALSE;
                        _vala_code_node_unref0 (param);
                        continue;
                  }
                  _tmp148_ = vala_list_get (d_params, i);
                  _tmp149_ = (ValaParameter*) _tmp148_;
                  _tmp150_ = vala_symbol_get_name ((ValaSymbol*) _tmp149_);
                  _tmp151_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp150_);
                  _tmp152_ = _tmp151_;
                  _tmp153_ = vala_ccode_identifier_new (_tmp152_);
                  _vala_ccode_node_unref0 (arg);
                  arg = (ValaCCodeExpression*) _tmp153_;
                  _g_free0 (_tmp152_);
                  _vala_code_node_unref0 (_tmp149_);
                  _tmp154_ = vala_parameter_get_cparameter_position (param);
                  _tmp155_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp154_, FALSE);
                  vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp155_), arg);
                  _tmp157_ = vala_variable_get_no_array_length ((ValaVariable*) param);
                  if (!_tmp157_) {
                        ValaDataType* _tmp158_ = NULL;
                        _tmp158_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp156_ = VALA_IS_ARRAY_TYPE (_tmp158_);
                  } else {
                        _tmp156_ = FALSE;
                  }
                  if (_tmp156_) {
                        ValaDataType* _tmp159_ = NULL;
                        ValaArrayType* _tmp160_;
                        ValaArrayType* array_type;
                        _tmp159_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        _tmp160_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp159_));
                        array_type = _tmp160_;
                        {
                              gint dim;
                              dim = 1;
                              {
                                    gboolean _tmp161_;
                                    _tmp161_ = TRUE;
                                    while (TRUE) {
                                          gint _tmp162_;
                                          ValaCCodeExpression* clength = NULL;
                                          gpointer _tmp163_ = NULL;
                                          ValaParameter* _tmp164_;
                                          gboolean _tmp165_;
                                          gboolean _tmp166_;
                                          gdouble _tmp187_;
                                          gint _tmp188_;
                                          if (!_tmp161_) {
                                                dim++;
                                          }
                                          _tmp161_ = FALSE;
                                          _tmp162_ = vala_array_type_get_rank (array_type);
                                          if (!(dim <= _tmp162_)) {
                                                break;
                                          }
                                          _tmp163_ = vala_list_get (d_params, i);
                                          _tmp164_ = (ValaParameter*) _tmp163_;
                                          _tmp165_ = vala_variable_get_array_null_terminated ((ValaVariable*) _tmp164_);
                                          _tmp166_ = _tmp165_;
                                          _vala_code_node_unref0 (_tmp164_);
                                          if (_tmp166_) {
                                                ValaCCodeIdentifier* _tmp167_ = NULL;
                                                ValaCCodeIdentifier* _tmp168_;
                                                ValaCCodeFunctionCall* _tmp169_ = NULL;
                                                ValaCCodeFunctionCall* _tmp170_;
                                                ValaCCodeFunctionCall* len_call;
                                                gpointer _tmp171_ = NULL;
                                                ValaParameter* _tmp172_;
                                                const gchar* _tmp173_ = NULL;
                                                ValaCCodeIdentifier* _tmp174_ = NULL;
                                                ValaCCodeIdentifier* _tmp175_;
                                                ValaCCodeExpression* _tmp176_;
                                                ((ValaCCodeBaseModule*) self)->requires_array_length = TRUE;
                                                _tmp167_ = vala_ccode_identifier_new ("_vala_array_length");
                                                _tmp168_ = _tmp167_;
                                                _tmp169_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp168_);
                                                _tmp170_ = _tmp169_;
                                                _vala_ccode_node_unref0 (_tmp168_);
                                                len_call = _tmp170_;
                                                _tmp171_ = vala_list_get (d_params, i);
                                                _tmp172_ = (ValaParameter*) _tmp171_;
                                                _tmp173_ = vala_symbol_get_name ((ValaSymbol*) _tmp172_);
                                                _tmp174_ = vala_ccode_identifier_new (_tmp173_);
                                                _tmp175_ = _tmp174_;
                                                vala_ccode_function_call_add_argument (len_call, (ValaCCodeExpression*) _tmp175_);
                                                _vala_ccode_node_unref0 (_tmp175_);
                                                _vala_code_node_unref0 (_tmp172_);
                                                _tmp176_ = _vala_ccode_node_ref0 ((ValaCCodeExpression*) len_call);
                                                _vala_ccode_node_unref0 (clength);
                                                clength = _tmp176_;
                                                _vala_ccode_node_unref0 (len_call);
                                          } else {
                                                gpointer _tmp177_ = NULL;
                                                ValaParameter* _tmp178_;
                                                gboolean _tmp179_;
                                                gboolean _tmp180_;
                                                _tmp177_ = vala_list_get (d_params, i);
                                                _tmp178_ = (ValaParameter*) _tmp177_;
                                                _tmp179_ = vala_variable_get_no_array_length ((ValaVariable*) _tmp178_);
                                                _tmp180_ = _tmp179_;
                                                _vala_code_node_unref0 (_tmp178_);
                                                if (_tmp180_) {
                                                      ValaCCodeConstant* _tmp181_ = NULL;
                                                      _tmp181_ = vala_ccode_constant_new ("-1");
                                                      _vala_ccode_node_unref0 (clength);
                                                      clength = (ValaCCodeExpression*) _tmp181_;
                                                } else {
                                                      gpointer _tmp182_ = NULL;
                                                      ValaParameter* _tmp183_;
                                                      gchar* _tmp184_ = NULL;
                                                      gchar* _tmp185_;
                                                      ValaCCodeIdentifier* _tmp186_ = NULL;
                                                      _tmp182_ = vala_list_get (d_params, i);
                                                      _tmp183_ = (ValaParameter*) _tmp182_;
                                                      _tmp184_ = vala_ccode_base_module_get_parameter_array_length_cname ((ValaCCodeBaseModule*) self, _tmp183_, dim);
                                                      _tmp185_ = _tmp184_;
                                                      _tmp186_ = vala_ccode_identifier_new (_tmp185_);
                                                      _vala_ccode_node_unref0 (clength);
                                                      clength = (ValaCCodeExpression*) _tmp186_;
                                                      _g_free0 (_tmp185_);
                                                      _vala_code_node_unref0 (_tmp183_);
                                                }
                                          }
                                          _tmp187_ = vala_parameter_get_carray_length_parameter_position (param);
                                          _tmp188_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp187_ + (0.01 * dim), FALSE);
                                          vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp188_), clength);
                                          _vala_ccode_node_unref0 (clength);
                                    }
                              }
                        }
                        _vala_code_node_unref0 (array_type);
                  } else {
                        ValaDataType* _tmp189_ = NULL;
                        _tmp189_ = vala_variable_get_variable_type ((ValaVariable*) param);
                        if (VALA_IS_DELEGATE_TYPE (_tmp189_)) {
                              ValaDataType* _tmp190_ = NULL;
                              ValaDelegateType* _tmp191_;
                              ValaDelegateType* deleg_type;
                              ValaDelegate* _tmp192_ = NULL;
                              gboolean _tmp193_;
                              _tmp190_ = vala_variable_get_variable_type ((ValaVariable*) param);
                              _tmp191_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp190_));
                              deleg_type = _tmp191_;
                              _tmp192_ = vala_delegate_type_get_delegate_symbol (deleg_type);
                              _tmp193_ = vala_delegate_get_has_target (_tmp192_);
                              if (_tmp193_) {
                                    gpointer _tmp194_ = NULL;
                                    ValaParameter* _tmp195_;
                                    const gchar* _tmp196_ = NULL;
                                    gchar* _tmp197_ = NULL;
                                    gchar* _tmp198_;
                                    ValaCCodeIdentifier* _tmp199_ = NULL;
                                    ValaCCodeIdentifier* _tmp200_;
                                    ValaCCodeIdentifier* ctarget;
                                    gdouble _tmp201_;
                                    gint _tmp202_;
                                    gboolean _tmp203_;
                                    _tmp194_ = vala_list_get (d_params, i);
                                    _tmp195_ = (ValaParameter*) _tmp194_;
                                    _tmp196_ = vala_symbol_get_name ((ValaSymbol*) _tmp195_);
                                    _tmp197_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, _tmp196_);
                                    _tmp198_ = _tmp197_;
                                    _tmp199_ = vala_ccode_identifier_new (_tmp198_);
                                    _tmp200_ = _tmp199_;
                                    _g_free0 (_tmp198_);
                                    _vala_code_node_unref0 (_tmp195_);
                                    ctarget = _tmp200_;
                                    _tmp201_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                                    _tmp202_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp201_, FALSE);
                                    vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp202_), (ValaCCodeExpression*) ctarget);
                                    _tmp203_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                                    if (_tmp203_) {
                                          gpointer _tmp204_ = NULL;
                                          ValaParameter* _tmp205_;
                                          const gchar* _tmp206_ = NULL;
                                          gchar* _tmp207_ = NULL;
                                          gchar* _tmp208_;
                                          ValaCCodeIdentifier* _tmp209_ = NULL;
                                          ValaCCodeIdentifier* _tmp210_;
                                          ValaCCodeIdentifier* ctarget_destroy_notify;
                                          gdouble _tmp211_;
                                          gint _tmp212_;
                                          _tmp204_ = vala_list_get (d_params, i);
                                          _tmp205_ = (ValaParameter*) _tmp204_;
                                          _tmp206_ = vala_symbol_get_name ((ValaSymbol*) _tmp205_);
                                          _tmp207_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, _tmp206_);
                                          _tmp208_ = _tmp207_;
                                          _tmp209_ = vala_ccode_identifier_new (_tmp208_);
                                          _tmp210_ = _tmp209_;
                                          _g_free0 (_tmp208_);
                                          _vala_code_node_unref0 (_tmp205_);
                                          ctarget_destroy_notify = _tmp210_;
                                          _tmp211_ = vala_method_get_cdelegate_target_parameter_position (m);
                                          _tmp212_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp211_ + 0.01, FALSE);
                                          vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp212_), (ValaCCodeExpression*) ctarget_destroy_notify);
                                          _vala_ccode_node_unref0 (ctarget_destroy_notify);
                                    }
                                    _vala_ccode_node_unref0 (ctarget);
                              }
                              _vala_code_node_unref0 (deleg_type);
                        }
                  }
                  i++;
                  _vala_ccode_node_unref0 (arg);
                  _vala_code_node_unref0 (param);
            }
            _vala_iterable_unref0 (_param_list);
      }
      _tmp214_ = vala_method_get_no_array_length (m);
      if (!_tmp214_) {
            ValaDataType* _tmp215_ = NULL;
            _tmp215_ = vala_method_get_return_type (m);
            _tmp213_ = VALA_IS_ARRAY_TYPE (_tmp215_);
      } else {
            _tmp213_ = FALSE;
      }
      if (_tmp213_) {
            ValaDataType* _tmp216_ = NULL;
            ValaArrayType* _tmp217_;
            ValaArrayType* array_type;
            _tmp216_ = vala_method_get_return_type (m);
            _tmp217_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp216_));
            array_type = _tmp217_;
            {
                  gint dim;
                  dim = 1;
                  {
                        gboolean _tmp218_;
                        _tmp218_ = TRUE;
                        while (TRUE) {
                              gint _tmp219_;
                              ValaCCodeExpression* clength = NULL;
                              gboolean _tmp220_;
                              gdouble _tmp225_;
                              gint _tmp226_;
                              if (!_tmp218_) {
                                    dim++;
                              }
                              _tmp218_ = FALSE;
                              _tmp219_ = vala_array_type_get_rank (array_type);
                              if (!(dim <= _tmp219_)) {
                                    break;
                              }
                              _tmp220_ = vala_delegate_get_no_array_length (d);
                              if (_tmp220_) {
                                    ValaCCodeConstant* _tmp221_ = NULL;
                                    _tmp221_ = vala_ccode_constant_new ("NULL");
                                    _vala_ccode_node_unref0 (clength);
                                    clength = (ValaCCodeExpression*) _tmp221_;
                              } else {
                                    gchar* _tmp222_ = NULL;
                                    gchar* _tmp223_;
                                    ValaCCodeIdentifier* _tmp224_ = NULL;
                                    _tmp222_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, "result", dim);
                                    _tmp223_ = _tmp222_;
                                    _tmp224_ = vala_ccode_identifier_new (_tmp223_);
                                    _vala_ccode_node_unref0 (clength);
                                    clength = (ValaCCodeExpression*) _tmp224_;
                                    _g_free0 (_tmp223_);
                              }
                              _tmp225_ = vala_method_get_carray_length_parameter_position (m);
                              _tmp226_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp225_ + (0.01 * dim), FALSE);
                              vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp226_), clength);
                              _vala_ccode_node_unref0 (clength);
                        }
                  }
            }
            _vala_code_node_unref0 (array_type);
      } else {
            ValaDataType* _tmp227_ = NULL;
            _tmp227_ = vala_method_get_return_type (m);
            if (VALA_IS_DELEGATE_TYPE (_tmp227_)) {
                  ValaDataType* _tmp228_ = NULL;
                  ValaDelegateType* _tmp229_;
                  ValaDelegateType* deleg_type;
                  ValaDelegate* _tmp230_ = NULL;
                  gboolean _tmp231_;
                  _tmp228_ = vala_method_get_return_type (m);
                  _tmp229_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp228_));
                  deleg_type = _tmp229_;
                  _tmp230_ = vala_delegate_type_get_delegate_symbol (deleg_type);
                  _tmp231_ = vala_delegate_get_has_target (_tmp230_);
                  if (_tmp231_) {
                        gchar* _tmp232_ = NULL;
                        gchar* _tmp233_;
                        ValaCCodeIdentifier* _tmp234_ = NULL;
                        ValaCCodeIdentifier* _tmp235_;
                        ValaCCodeIdentifier* ctarget;
                        gdouble _tmp236_;
                        gint _tmp237_;
                        gboolean _tmp238_;
                        _tmp232_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, "result");
                        _tmp233_ = _tmp232_;
                        _tmp234_ = vala_ccode_identifier_new (_tmp233_);
                        _tmp235_ = _tmp234_;
                        _g_free0 (_tmp233_);
                        ctarget = _tmp235_;
                        _tmp236_ = vala_method_get_cdelegate_target_parameter_position (m);
                        _tmp237_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp236_, FALSE);
                        vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp237_), (ValaCCodeExpression*) ctarget);
                        _tmp238_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                        if (_tmp238_) {
                              gchar* _tmp239_ = NULL;
                              gchar* _tmp240_;
                              ValaCCodeIdentifier* _tmp241_ = NULL;
                              ValaCCodeIdentifier* _tmp242_;
                              ValaCCodeIdentifier* ctarget_destroy_notify;
                              gdouble _tmp243_;
                              gint _tmp244_;
                              _tmp239_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, "result");
                              _tmp240_ = _tmp239_;
                              _tmp241_ = vala_ccode_identifier_new (_tmp240_);
                              _tmp242_ = _tmp241_;
                              _g_free0 (_tmp240_);
                              ctarget_destroy_notify = _tmp242_;
                              _tmp243_ = vala_method_get_cdelegate_target_parameter_position (m);
                              _tmp244_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp243_ + 0.01, FALSE);
                              vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp244_), (ValaCCodeExpression*) ctarget_destroy_notify);
                              _vala_ccode_node_unref0 (ctarget_destroy_notify);
                        }
                        _vala_ccode_node_unref0 (ctarget);
                  }
                  _vala_code_node_unref0 (deleg_type);
            } else {
                  ValaDataType* _tmp245_ = NULL;
                  gboolean _tmp246_;
                  _tmp245_ = vala_method_get_return_type (m);
                  _tmp246_ = vala_data_type_is_real_non_null_struct_type (_tmp245_);
                  if (_tmp246_) {
                        gint _tmp247_;
                        ValaCCodeIdentifier* _tmp248_ = NULL;
                        ValaCCodeIdentifier* _tmp249_;
                        _tmp247_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, (gdouble) (-3), FALSE);
                        _tmp248_ = vala_ccode_identifier_new ("result");
                        _tmp249_ = _tmp248_;
                        vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp247_), (ValaCCodeExpression*) _tmp249_);
                        _vala_ccode_node_unref0 (_tmp249_);
                  }
            }
      }
      _tmp250_ = vala_code_node_get_error_types ((ValaCodeNode*) m);
      _tmp251_ = _tmp250_;
      _tmp252_ = vala_collection_get_size ((ValaCollection*) _tmp251_);
      _tmp253_ = _tmp252_ > 0;
      _vala_iterable_unref0 (_tmp251_);
      if (_tmp253_) {
            gint _tmp254_;
            ValaCCodeIdentifier* _tmp255_ = NULL;
            ValaCCodeIdentifier* _tmp256_;
            _tmp254_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, (gdouble) (-1), FALSE);
            _tmp255_ = vala_ccode_identifier_new ("error");
            _tmp256_ = _tmp255_;
            vala_map_set ((ValaMap*) carg_map, GINT_TO_POINTER (_tmp254_), (ValaCCodeExpression*) _tmp256_);
            _vala_ccode_node_unref0 (_tmp256_);
      }
      _tmp257_ = vala_method_get_cname (m);
      _tmp258_ = _tmp257_;
      _tmp259_ = vala_ccode_identifier_new (_tmp258_);
      _tmp260_ = _tmp259_;
      _tmp261_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp260_);
      _tmp262_ = _tmp261_;
      _vala_ccode_node_unref0 (_tmp260_);
      _g_free0 (_tmp258_);
      ccall = _tmp262_;
      last_pos = -1;
      while (TRUE) {
            gpointer _tmp271_ = NULL;
            ValaCCodeExpression* _tmp272_;
            min_pos = -1;
            {
                  ValaSet* _tmp263_ = NULL;
                  ValaSet* _tmp264_;
                  ValaIterator* _tmp265_ = NULL;
                  ValaIterator* _tmp266_;
                  ValaIterator* _pos_it;
                  _tmp263_ = vala_map_get_keys ((ValaMap*) carg_map);
                  _tmp264_ = _tmp263_;
                  _tmp265_ = vala_iterable_iterator ((ValaIterable*) _tmp264_);
                  _tmp266_ = _tmp265_;
                  _vala_iterable_unref0 (_tmp264_);
                  _pos_it = _tmp266_;
                  while (TRUE) {
                        gboolean _tmp267_;
                        gpointer _tmp268_ = NULL;
                        gint pos;
                        gboolean _tmp269_ = FALSE;
                        _tmp267_ = vala_iterator_next (_pos_it);
                        if (!_tmp267_) {
                              break;
                        }
                        _tmp268_ = vala_iterator_get (_pos_it);
                        pos = GPOINTER_TO_INT (_tmp268_);
                        if (pos > last_pos) {
                              gboolean _tmp270_ = FALSE;
                              if (min_pos == (-1)) {
                                    _tmp270_ = TRUE;
                              } else {
                                    _tmp270_ = pos < min_pos;
                              }
                              _tmp269_ = _tmp270_;
                        } else {
                              _tmp269_ = FALSE;
                        }
                        if (_tmp269_) {
                              min_pos = pos;
                        }
                  }
                  _vala_iterator_unref0 (_pos_it);
            }
            if (min_pos == (-1)) {
                  break;
            }
            _tmp271_ = vala_map_get ((ValaMap*) carg_map, GINT_TO_POINTER (min_pos));
            _tmp272_ = (ValaCCodeExpression*) _tmp271_;
            vala_ccode_function_call_add_argument (ccall, _tmp272_);
            _vala_ccode_node_unref0 (_tmp272_);
            last_pos = min_pos;
      }
      _tmp273_ = vala_method_get_coroutine (m);
      if (_tmp273_) {
            ValaCCodeConstant* _tmp274_ = NULL;
            ValaCCodeConstant* _tmp275_;
            ValaCCodeConstant* _tmp276_ = NULL;
            ValaCCodeConstant* _tmp277_;
            _tmp274_ = vala_ccode_constant_new ("NULL");
            _tmp275_ = _tmp274_;
            vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) _tmp275_);
            _vala_ccode_node_unref0 (_tmp275_);
            _tmp276_ = vala_ccode_constant_new ("NULL");
            _tmp277_ = _tmp276_;
            vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) _tmp277_);
            _vala_ccode_node_unref0 (_tmp277_);
      }
      _tmp279_ = vala_method_get_return_type (m);
      if (VALA_IS_VOID_TYPE (_tmp279_)) {
            _tmp278_ = TRUE;
      } else {
            ValaDataType* _tmp280_ = NULL;
            gboolean _tmp281_;
            _tmp280_ = vala_method_get_return_type (m);
            _tmp281_ = vala_data_type_is_real_non_null_struct_type (_tmp280_);
            _tmp278_ = _tmp281_;
      }
      if (_tmp278_) {
            ValaCCodeFunction* _tmp282_ = NULL;
            _tmp282_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_expression (_tmp282_, (ValaCCodeExpression*) ccall);
      } else {
            ValaCCodeFunction* _tmp283_ = NULL;
            ValaCCodeVariableDeclarator* _tmp284_ = NULL;
            ValaCCodeVariableDeclarator* _tmp285_;
            _tmp283_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp284_ = vala_ccode_variable_declarator_new ("result", (ValaCCodeExpression*) ccall, NULL);
            _tmp285_ = _tmp284_;
            vala_ccode_function_add_declaration (_tmp283_, return_type_cname, (ValaCCodeDeclarator*) _tmp285_, 0);
            _vala_ccode_node_unref0 (_tmp285_);
      }
      _tmp288_ = vala_delegate_get_has_target (d);
      if (_tmp288_) {
            gboolean _tmp289_;
            _tmp289_ = vala_data_type_get_value_owned ((ValaDataType*) dt);
            _tmp287_ = !_tmp289_;
      } else {
            _tmp287_ = FALSE;
      }
      if (_tmp287_) {
            gboolean _tmp290_;
            _tmp290_ = vala_delegate_type_get_is_called_once (dt);
            _tmp286_ = _tmp290_;
      } else {
            _tmp286_ = FALSE;
      }
      if (_tmp286_) {
            ValaCCodeExpression* destroy_notify;
            gboolean _tmp291_;
            destroy_notify = NULL;
            _tmp291_ = vala_method_get_closure (m);
            if (_tmp291_) {
                  ValaBlock* _tmp292_ = NULL;
                  gint _tmp293_;
                  gint block_id;
                  gchar* _tmp294_ = NULL;
                  gchar* _tmp295_;
                  ValaCCodeIdentifier* _tmp296_ = NULL;
                  _tmp292_ = vala_ccode_base_module_get_current_closure_block ((ValaCCodeBaseModule*) self);
                  _tmp293_ = vala_ccode_base_module_get_block_id ((ValaCCodeBaseModule*) self, _tmp292_);
                  block_id = _tmp293_;
                  _tmp294_ = g_strdup_printf ("block%d_data_unref", block_id);
                  _tmp295_ = _tmp294_;
                  _tmp296_ = vala_ccode_identifier_new (_tmp295_);
                  _vala_ccode_node_unref0 (destroy_notify);
                  destroy_notify = (ValaCCodeExpression*) _tmp296_;
                  _g_free0 (_tmp295_);
            } else {
                  gboolean _tmp297_ = FALSE;
                  gboolean _tmp298_ = FALSE;
                  gboolean _tmp299_ = FALSE;
                  ValaDataType* _tmp300_ = NULL;
                  ValaDataType* _tmp301_;
                  gboolean _tmp302_;
                  _tmp300_ = vala_ccode_base_module_get_this_type ((ValaCCodeBaseModule*) self);
                  _tmp301_ = _tmp300_;
                  _tmp302_ = _tmp301_ != NULL;
                  _vala_code_node_unref0 (_tmp301_);
                  if (_tmp302_) {
                        ValaMemberBinding _tmp303_;
                        _tmp303_ = vala_method_get_binding (m);
                        _tmp299_ = _tmp303_ != VALA_MEMBER_BINDING_STATIC;
                  } else {
                        _tmp299_ = FALSE;
                  }
                  if (_tmp299_) {
                        gboolean _tmp304_;
                        _tmp304_ = vala_method_get_is_async_callback (m);
                        _tmp298_ = !_tmp304_;
                  } else {
                        _tmp298_ = FALSE;
                  }
                  if (_tmp298_) {
                        ValaParameter* _tmp305_ = NULL;
                        ValaDataType* _tmp306_ = NULL;
                        ValaTypeSymbol* _tmp307_ = NULL;
                        gboolean _tmp308_;
                        _tmp305_ = vala_method_get_this_parameter (m);
                        _tmp306_ = vala_variable_get_variable_type ((ValaVariable*) _tmp305_);
                        _tmp307_ = vala_data_type_get_data_type (_tmp306_);
                        _tmp308_ = vala_typesymbol_is_reference_counting (_tmp307_);
                        _tmp297_ = _tmp308_;
                  } else {
                        _tmp297_ = FALSE;
                  }
                  if (_tmp297_) {
                        ValaParameter* _tmp309_ = NULL;
                        ValaDataType* _tmp310_ = NULL;
                        ValaCCodeExpression* _tmp311_ = NULL;
                        _tmp309_ = vala_method_get_this_parameter (m);
                        _tmp310_ = vala_variable_get_variable_type ((ValaVariable*) _tmp309_);
                        _tmp311_ = vala_ccode_base_module_get_destroy_func_expression ((ValaCCodeBaseModule*) self, _tmp310_, FALSE);
                        _vala_ccode_node_unref0 (destroy_notify);
                        destroy_notify = _tmp311_;
                  } else {
                        if (((ValaCCodeBaseModule*) self)->in_constructor) {
                              ValaCCodeIdentifier* _tmp312_ = NULL;
                              _tmp312_ = vala_ccode_identifier_new ("g_object_unref");
                              _vala_ccode_node_unref0 (destroy_notify);
                              destroy_notify = (ValaCCodeExpression*) _tmp312_;
                        }
                  }
            }
            if (destroy_notify != NULL) {
                  ValaCCodeFunctionCall* _tmp313_ = NULL;
                  ValaCCodeFunctionCall* unref_call;
                  ValaCCodeIdentifier* _tmp314_ = NULL;
                  ValaCCodeIdentifier* _tmp315_;
                  ValaCCodeFunction* _tmp316_ = NULL;
                  _tmp313_ = vala_ccode_function_call_new (destroy_notify);
                  unref_call = _tmp313_;
                  _tmp314_ = vala_ccode_identifier_new ("self");
                  _tmp315_ = _tmp314_;
                  vala_ccode_function_call_add_argument (unref_call, (ValaCCodeExpression*) _tmp315_);
                  _vala_ccode_node_unref0 (_tmp315_);
                  _tmp316_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_add_expression (_tmp316_, (ValaCCodeExpression*) unref_call);
                  _vala_ccode_node_unref0 (unref_call);
            }
            _vala_ccode_node_unref0 (destroy_notify);
      }
      _tmp318_ = vala_method_get_return_type (m);
      if (VALA_IS_VOID_TYPE (_tmp318_)) {
            _tmp317_ = TRUE;
      } else {
            ValaDataType* _tmp319_ = NULL;
            gboolean _tmp320_;
            _tmp319_ = vala_method_get_return_type (m);
            _tmp320_ = vala_data_type_is_real_non_null_struct_type (_tmp319_);
            _tmp317_ = _tmp320_;
      }
      if (!_tmp317_) {
            ValaCCodeFunction* _tmp321_ = NULL;
            ValaCCodeIdentifier* _tmp322_ = NULL;
            ValaCCodeIdentifier* _tmp323_;
            _tmp321_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp322_ = vala_ccode_identifier_new ("result");
            _tmp323_ = _tmp322_;
            vala_ccode_function_add_return (_tmp321_, (ValaCCodeExpression*) _tmp323_);
            _vala_ccode_node_unref0 (_tmp323_);
      }
      vala_ccode_base_module_pop_function ((ValaCCodeBaseModule*) self);
      vala_ccode_file_add_function_declaration (((ValaCCodeBaseModule*) self)->cfile, function);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, function);
      result = wrapper_name;
      _vala_ccode_node_unref0 (ccall);
      _vala_map_unref0 (carg_map);
      _vala_iterable_unref0 (d_params);
      _vala_map_unref0 (cparam_map);
      _vala_ccode_node_unref0 (function);
      _g_free0 (return_type_cname);
      _vala_code_node_unref0 (dynamic_sig);
      _vala_code_node_unref0 (sig);
      _g_free0 (delegate_name);
      _vala_code_node_unref0 (d);
      return result;
}


static ValaCCodeParameter* vala_ccode_delegate_module_real_generate_parameter (ValaCCodeMethodModule* base, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map) {
      ValaCCodeDelegateModule * self;
      ValaCCodeParameter* result = NULL;
      gboolean _tmp0_ = FALSE;
      ValaDataType* _tmp1_ = NULL;
      ValaDataType* _tmp4_ = NULL;
      gchar* _tmp5_ = NULL;
      gchar* ctypename;
      gchar* _tmp6_;
      gchar* target_ctypename;
      gchar* _tmp7_;
      gchar* target_destroy_notify_ctypename;
      gboolean _tmp8_ = FALSE;
      ValaSymbol* _tmp9_ = NULL;
      ValaParameterDirection _tmp17_;
      const gchar* _tmp21_ = NULL;
      gchar* _tmp22_ = NULL;
      gchar* _tmp23_;
      ValaCCodeParameter* _tmp24_ = NULL;
      ValaCCodeParameter* _tmp25_;
      ValaCCodeParameter* main_cparam;
      gdouble _tmp26_;
      gint _tmp27_;
      ValaDataType* _tmp33_ = NULL;
      self = (ValaCCodeDelegateModule*) base;
      g_return_val_if_fail (param != NULL, NULL);
      g_return_val_if_fail (decl_space != NULL, NULL);
      g_return_val_if_fail (cparam_map != NULL, NULL);
      _tmp1_ = vala_variable_get_variable_type ((ValaVariable*) param);
      if (VALA_IS_DELEGATE_TYPE (_tmp1_)) {
            _tmp0_ = TRUE;
      } else {
            ValaDataType* _tmp2_ = NULL;
            _tmp2_ = vala_variable_get_variable_type ((ValaVariable*) param);
            _tmp0_ = VALA_IS_METHOD_TYPE (_tmp2_);
      }
      if (!_tmp0_) {
            ValaCCodeParameter* _tmp3_ = NULL;
            _tmp3_ = VALA_CCODE_METHOD_MODULE_CLASS (vala_ccode_delegate_module_parent_class)->generate_parameter ((ValaCCodeMethodModule*) VALA_CCODE_ARRAY_MODULE (self), param, decl_space, cparam_map, carg_map);
            result = _tmp3_;
            return result;
      }
      _tmp4_ = vala_variable_get_variable_type ((ValaVariable*) param);
      _tmp5_ = vala_data_type_get_cname (_tmp4_);
      ctypename = _tmp5_;
      _tmp6_ = g_strdup ("void*");
      target_ctypename = _tmp6_;
      _tmp7_ = g_strdup ("GDestroyNotify");
      target_destroy_notify_ctypename = _tmp7_;
      _tmp9_ = vala_symbol_get_parent_symbol ((ValaSymbol*) param);
      if (VALA_IS_DELEGATE (_tmp9_)) {
            ValaDataType* _tmp10_ = NULL;
            gchar* _tmp11_ = NULL;
            gchar* _tmp12_;
            ValaSymbol* _tmp13_ = NULL;
            gchar* _tmp14_ = NULL;
            gchar* _tmp15_;
            _tmp10_ = vala_variable_get_variable_type ((ValaVariable*) param);
            _tmp11_ = vala_data_type_get_cname (_tmp10_);
            _tmp12_ = _tmp11_;
            _tmp13_ = vala_symbol_get_parent_symbol ((ValaSymbol*) param);
            _tmp14_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) VALA_DELEGATE (_tmp13_), FALSE);
            _tmp15_ = _tmp14_;
            _tmp8_ = g_strcmp0 (_tmp12_, _tmp15_) == 0;
            _g_free0 (_tmp15_);
            _g_free0 (_tmp12_);
      } else {
            _tmp8_ = FALSE;
      }
      if (_tmp8_) {
            gchar* _tmp16_;
            _tmp16_ = g_strdup ("GCallback");
            _g_free0 (ctypename);
            ctypename = _tmp16_;
      }
      _tmp17_ = vala_parameter_get_direction (param);
      if (_tmp17_ != VALA_PARAMETER_DIRECTION_IN) {
            gchar* _tmp18_;
            gchar* _tmp19_;
            gchar* _tmp20_;
            _tmp18_ = g_strconcat (ctypename, "*", NULL);
            _g_free0 (ctypename);
            ctypename = _tmp18_;
            _tmp19_ = g_strconcat (target_ctypename, "*", NULL);
            _g_free0 (target_ctypename);
            target_ctypename = _tmp19_;
            _tmp20_ = g_strconcat (target_destroy_notify_ctypename, "*", NULL);
            _g_free0 (target_destroy_notify_ctypename);
            target_destroy_notify_ctypename = _tmp20_;
      }
      _tmp21_ = vala_symbol_get_name ((ValaSymbol*) param);
      _tmp22_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp21_);
      _tmp23_ = _tmp22_;
      _tmp24_ = vala_ccode_parameter_new (_tmp23_, ctypename);
      _tmp25_ = _tmp24_;
      _g_free0 (_tmp23_);
      main_cparam = _tmp25_;
      _tmp26_ = vala_parameter_get_cparameter_position (param);
      _tmp27_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp26_, FALSE);
      vala_map_set (cparam_map, GINT_TO_POINTER (_tmp27_), main_cparam);
      if (carg_map != NULL) {
            gdouble _tmp28_;
            gint _tmp29_;
            const gchar* _tmp30_ = NULL;
            ValaCCodeExpression* _tmp31_ = NULL;
            ValaCCodeExpression* _tmp32_;
            _tmp28_ = vala_parameter_get_cparameter_position (param);
            _tmp29_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp28_, FALSE);
            _tmp30_ = vala_symbol_get_name ((ValaSymbol*) param);
            _tmp31_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp30_);
            _tmp32_ = _tmp31_;
            vala_map_set (carg_map, GINT_TO_POINTER (_tmp29_), _tmp32_);
            _vala_ccode_node_unref0 (_tmp32_);
      }
      _tmp33_ = vala_variable_get_variable_type ((ValaVariable*) param);
      if (VALA_IS_DELEGATE_TYPE (_tmp33_)) {
            ValaDataType* _tmp34_ = NULL;
            ValaDelegateType* _tmp35_;
            ValaDelegateType* deleg_type;
            ValaDelegate* _tmp36_ = NULL;
            ValaDelegate* _tmp37_;
            ValaDelegate* d;
            gboolean _tmp38_;
            _tmp34_ = vala_variable_get_variable_type ((ValaVariable*) param);
            _tmp35_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp34_));
            deleg_type = _tmp35_;
            _tmp36_ = vala_delegate_type_get_delegate_symbol (deleg_type);
            _tmp37_ = _vala_code_node_ref0 (_tmp36_);
            d = _tmp37_;
            vala_ccode_base_module_generate_delegate_declaration ((ValaCCodeBaseModule*) self, d, decl_space);
            _tmp38_ = vala_delegate_get_has_target (d);
            if (_tmp38_) {
                  const gchar* _tmp39_ = NULL;
                  gchar* _tmp40_ = NULL;
                  gchar* _tmp41_;
                  gchar* _tmp42_ = NULL;
                  gchar* _tmp43_;
                  ValaCCodeParameter* _tmp44_ = NULL;
                  ValaCCodeParameter* _tmp45_;
                  ValaCCodeParameter* cparam;
                  gdouble _tmp46_;
                  gint _tmp47_;
                  gboolean _tmp53_;
                  _tmp39_ = vala_symbol_get_name ((ValaSymbol*) param);
                  _tmp40_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp39_);
                  _tmp41_ = _tmp40_;
                  _tmp42_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, _tmp41_);
                  _tmp43_ = _tmp42_;
                  _tmp44_ = vala_ccode_parameter_new (_tmp43_, target_ctypename);
                  _tmp45_ = _tmp44_;
                  _g_free0 (_tmp43_);
                  _g_free0 (_tmp41_);
                  cparam = _tmp45_;
                  _tmp46_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                  _tmp47_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp46_, FALSE);
                  vala_map_set (cparam_map, GINT_TO_POINTER (_tmp47_), cparam);
                  if (carg_map != NULL) {
                        gdouble _tmp48_;
                        gint _tmp49_;
                        const gchar* _tmp50_ = NULL;
                        ValaCCodeExpression* _tmp51_ = NULL;
                        ValaCCodeExpression* _tmp52_;
                        _tmp48_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                        _tmp49_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp48_, FALSE);
                        _tmp50_ = vala_ccode_parameter_get_name (cparam);
                        _tmp51_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp50_);
                        _tmp52_ = _tmp51_;
                        vala_map_set (carg_map, GINT_TO_POINTER (_tmp49_), _tmp52_);
                        _vala_ccode_node_unref0 (_tmp52_);
                  }
                  _tmp53_ = vala_data_type_get_value_owned ((ValaDataType*) deleg_type);
                  if (_tmp53_) {
                        const gchar* _tmp54_ = NULL;
                        gchar* _tmp55_ = NULL;
                        gchar* _tmp56_;
                        gchar* _tmp57_ = NULL;
                        gchar* _tmp58_;
                        ValaCCodeParameter* _tmp59_ = NULL;
                        gdouble _tmp60_;
                        gint _tmp61_;
                        _tmp54_ = vala_symbol_get_name ((ValaSymbol*) param);
                        _tmp55_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp54_);
                        _tmp56_ = _tmp55_;
                        _tmp57_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, _tmp56_);
                        _tmp58_ = _tmp57_;
                        _tmp59_ = vala_ccode_parameter_new (_tmp58_, target_destroy_notify_ctypename);
                        _vala_ccode_node_unref0 (cparam);
                        cparam = _tmp59_;
                        _g_free0 (_tmp58_);
                        _g_free0 (_tmp56_);
                        _tmp60_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                        _tmp61_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp60_ + 0.01, FALSE);
                        vala_map_set (cparam_map, GINT_TO_POINTER (_tmp61_), cparam);
                        if (carg_map != NULL) {
                              gdouble _tmp62_;
                              gint _tmp63_;
                              const gchar* _tmp64_ = NULL;
                              ValaCCodeExpression* _tmp65_ = NULL;
                              ValaCCodeExpression* _tmp66_;
                              _tmp62_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                              _tmp63_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp62_ + 0.01, FALSE);
                              _tmp64_ = vala_ccode_parameter_get_name (cparam);
                              _tmp65_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp64_);
                              _tmp66_ = _tmp65_;
                              vala_map_set (carg_map, GINT_TO_POINTER (_tmp63_), _tmp66_);
                              _vala_ccode_node_unref0 (_tmp66_);
                        }
                  }
                  _vala_ccode_node_unref0 (cparam);
            }
            _vala_code_node_unref0 (d);
            _vala_code_node_unref0 (deleg_type);
      } else {
            ValaDataType* _tmp67_ = NULL;
            _tmp67_ = vala_variable_get_variable_type ((ValaVariable*) param);
            if (VALA_IS_METHOD_TYPE (_tmp67_)) {
                  const gchar* _tmp68_ = NULL;
                  gchar* _tmp69_ = NULL;
                  gchar* _tmp70_;
                  gchar* _tmp71_ = NULL;
                  gchar* _tmp72_;
                  ValaCCodeParameter* _tmp73_ = NULL;
                  ValaCCodeParameter* _tmp74_;
                  ValaCCodeParameter* cparam;
                  gdouble _tmp75_;
                  gint _tmp76_;
                  _tmp68_ = vala_symbol_get_name ((ValaSymbol*) param);
                  _tmp69_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, _tmp68_);
                  _tmp70_ = _tmp69_;
                  _tmp71_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, _tmp70_);
                  _tmp72_ = _tmp71_;
                  _tmp73_ = vala_ccode_parameter_new (_tmp72_, target_ctypename);
                  _tmp74_ = _tmp73_;
                  _g_free0 (_tmp72_);
                  _g_free0 (_tmp70_);
                  cparam = _tmp74_;
                  _tmp75_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                  _tmp76_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp75_, FALSE);
                  vala_map_set (cparam_map, GINT_TO_POINTER (_tmp76_), cparam);
                  if (carg_map != NULL) {
                        gdouble _tmp77_;
                        gint _tmp78_;
                        const gchar* _tmp79_ = NULL;
                        ValaCCodeExpression* _tmp80_ = NULL;
                        ValaCCodeExpression* _tmp81_;
                        _tmp77_ = vala_parameter_get_cdelegate_target_parameter_position (param);
                        _tmp78_ = vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, _tmp77_, FALSE);
                        _tmp79_ = vala_ccode_parameter_get_name (cparam);
                        _tmp80_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp79_);
                        _tmp81_ = _tmp80_;
                        vala_map_set (carg_map, GINT_TO_POINTER (_tmp78_), _tmp81_);
                        _vala_ccode_node_unref0 (_tmp81_);
                  }
                  _vala_ccode_node_unref0 (cparam);
            }
      }
      result = main_cparam;
      _g_free0 (target_destroy_notify_ctypename);
      _g_free0 (target_ctypename);
      _g_free0 (ctypename);
      return result;
}


ValaCCodeDelegateModule* vala_ccode_delegate_module_construct (GType object_type) {
      ValaCCodeDelegateModule* self = NULL;
      self = (ValaCCodeDelegateModule*) vala_ccode_array_module_construct (object_type);
      return self;
}


ValaCCodeDelegateModule* vala_ccode_delegate_module_new (void) {
      return vala_ccode_delegate_module_construct (VALA_TYPE_CCODE_DELEGATE_MODULE);
}


static void vala_ccode_delegate_module_class_init (ValaCCodeDelegateModuleClass * klass) {
      vala_ccode_delegate_module_parent_class = g_type_class_peek_parent (klass);
      VALA_CCODE_BASE_MODULE_CLASS (klass)->generate_delegate_declaration = vala_ccode_delegate_module_real_generate_delegate_declaration;
      VALA_CODE_VISITOR_CLASS (klass)->visit_delegate = vala_ccode_delegate_module_real_visit_delegate;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_delegate_target_cname = vala_ccode_delegate_module_real_get_delegate_target_cname;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_delegate_target_cexpression = vala_ccode_delegate_module_real_get_delegate_target_cexpression;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_delegate_target_cvalue = vala_ccode_delegate_module_real_get_delegate_target_cvalue;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_delegate_target_destroy_notify_cvalue = vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cvalue;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_delegate_target_destroy_notify_cname = vala_ccode_delegate_module_real_get_delegate_target_destroy_notify_cname;
      VALA_CCODE_BASE_MODULE_CLASS (klass)->get_implicit_cast_expression = vala_ccode_delegate_module_real_get_implicit_cast_expression;
      VALA_CCODE_METHOD_MODULE_CLASS (klass)->generate_parameter = vala_ccode_delegate_module_real_generate_parameter;
}


static void vala_ccode_delegate_module_instance_init (ValaCCodeDelegateModule * self) {
}


/**
 * The link between an assignment and generated code.
 */
GType vala_ccode_delegate_module_get_type (void) {
      static volatile gsize vala_ccode_delegate_module_type_id__volatile = 0;
      if (g_once_init_enter (&vala_ccode_delegate_module_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (ValaCCodeDelegateModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_ccode_delegate_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCCodeDelegateModule), 0, (GInstanceInitFunc) vala_ccode_delegate_module_instance_init, NULL };
            GType vala_ccode_delegate_module_type_id;
            vala_ccode_delegate_module_type_id = g_type_register_static (VALA_TYPE_CCODE_ARRAY_MODULE, "ValaCCodeDelegateModule", &g_define_type_info, 0);
            g_once_init_leave (&vala_ccode_delegate_module_type_id__volatile, vala_ccode_delegate_module_type_id);
      }
      return vala_ccode_delegate_module_type_id__volatile;
}




Generated by  Doxygen 1.6.0   Back to index