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

valaccodestructmodule.c

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

/* valaccodestructmodule.vala
 *
 * Copyright (C) 2006-2009  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>


#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 _g_free0(var) (var = (g_free (var), NULL))
#define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))

#define VALA_TYPE_TYPEREGISTER_FUNCTION (vala_typeregister_function_get_type ())
#define VALA_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunction))
#define VALA_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))
#define VALA_IS_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION))
#define VALA_IS_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION))
#define VALA_TYPEREGISTER_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))

typedef struct _ValaTypeRegisterFunction ValaTypeRegisterFunction;
typedef struct _ValaTypeRegisterFunctionClass ValaTypeRegisterFunctionClass;

#define VALA_TYPE_STRUCT_REGISTER_FUNCTION (vala_struct_register_function_get_type ())
#define VALA_STRUCT_REGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_STRUCT_REGISTER_FUNCTION, ValaStructRegisterFunction))
#define VALA_STRUCT_REGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_STRUCT_REGISTER_FUNCTION, ValaStructRegisterFunctionClass))
#define VALA_IS_STRUCT_REGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_STRUCT_REGISTER_FUNCTION))
#define VALA_IS_STRUCT_REGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_STRUCT_REGISTER_FUNCTION))
#define VALA_STRUCT_REGISTER_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_STRUCT_REGISTER_FUNCTION, ValaStructRegisterFunctionClass))

typedef struct _ValaStructRegisterFunction ValaStructRegisterFunction;
typedef struct _ValaStructRegisterFunctionClass ValaStructRegisterFunctionClass;
#define _vala_typeregister_function_unref0(var) ((var == NULL) ? NULL : (var = (vala_typeregister_function_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_ccode_base_module_emit_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_base_module_emit_context_unref (var), NULL)))
typedef struct _ValaCCodeBaseModuleEmitContextPrivate ValaCCodeBaseModuleEmitContextPrivate;

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;
      ValaTypeSymbol* dbus_object_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_variable) (ValaCCodeBaseModule* self, ValaVariable* variable, ValaTargetValue* target_lvalue);
      ValaCCodeExpression* (*destroy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, gboolean is_macro_definition);
      void (*append_local_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, 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);
      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);
      ValaCCodeExpression* (*get_ref_cexpression) (ValaCCodeBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, 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, ValaExpression* expr);
      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);
      void (*generate_marshaller) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, gboolean dbus);
      gchar* (*get_marshaller_function) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, const gchar* prefix, gboolean dbus);
      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 _ValaCCodeBaseModuleEmitContext {
      GTypeInstance parent_instance;
      volatile int ref_count;
      ValaCCodeBaseModuleEmitContextPrivate * priv;
      ValaSymbol* current_symbol;
      ValaArrayList* symbol_stack;
      ValaTryStatement* current_try;
      ValaCatchClause* current_catch;
      ValaCCodeFunction* ccode;
      ValaArrayList* ccode_stack;
      ValaArrayList* temp_ref_vars;
      gint next_temp_var_id;
      gboolean current_method_inner_error;
      gboolean current_method_return;
      ValaMap* variable_name_map;
};

struct _ValaCCodeBaseModuleEmitContextClass {
      GTypeClass parent_class;
      void (*finalize) (ValaCCodeBaseModuleEmitContext *self);
};


static gpointer vala_ccode_struct_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;
enum  {
      VALA_CCODE_STRUCT_MODULE_DUMMY_PROPERTY
};
static void vala_ccode_struct_module_real_generate_struct_declaration (ValaCCodeBaseModule* base, ValaStruct* st, ValaCCodeFile* decl_space);
gboolean vala_ccode_base_module_add_symbol_declaration (ValaCCodeBaseModule* self, ValaCCodeFile* decl_space, ValaSymbol* sym, const gchar* name);
ValaCodeContext* vala_ccode_base_module_get_context (ValaCCodeBaseModule* self);
ValaStructRegisterFunction* vala_struct_register_function_new (ValaStruct* st, ValaCodeContext* context);
ValaStructRegisterFunction* vala_struct_register_function_construct (GType object_type, ValaStruct* st, ValaCodeContext* context);
gpointer vala_typeregister_function_ref (gpointer instance);
void vala_typeregister_function_unref (gpointer instance);
GParamSpec* vala_param_spec_typeregister_function (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_value_set_typeregister_function (GValue* value, gpointer v_object);
void vala_value_take_typeregister_function (GValue* value, gpointer v_object);
gpointer vala_value_get_typeregister_function (const GValue* value);
GType vala_typeregister_function_get_type (void) G_GNUC_CONST;
GType vala_struct_register_function_get_type (void) G_GNUC_CONST;
void vala_typeregister_function_init_from_type (ValaTypeRegisterFunction* self, gboolean plugin, gboolean declaration_only);
ValaCCodeFragment* vala_typeregister_function_get_declaration (ValaTypeRegisterFunction* self);
void vala_ccode_base_module_generate_type_declaration (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeFile* decl_space);
gchar* vala_ccode_base_module_get_array_length_cname (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
gchar* vala_ccode_base_module_get_array_size_cname (ValaCCodeBaseModule* self, const gchar* array_cname);
gchar* vala_ccode_base_module_get_delegate_target_cname (ValaCCodeBaseModule* self, const gchar* delegate_cname);
gchar* vala_ccode_base_module_get_delegate_target_destroy_notify_cname (ValaCCodeBaseModule* self, const gchar* delegate_cname);
static void vala_ccode_struct_module_real_visit_struct (ValaCodeVisitor* base, ValaStruct* st);
void vala_ccode_base_module_push_context (ValaCCodeBaseModule* self, ValaCCodeBaseModuleEmitContext* emit_context);
ValaCCodeBaseModuleEmitContext* vala_ccode_base_module_emit_context_new (ValaSymbol* symbol);
ValaCCodeBaseModuleEmitContext* vala_ccode_base_module_emit_context_construct (GType object_type, ValaSymbol* symbol);
void vala_ccode_base_module_generate_struct_declaration (ValaCCodeBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
static void vala_ccode_struct_module_begin_struct_destroy_function (ValaCCodeStructModule* self, ValaStruct* st);
static void vala_ccode_struct_module_add_struct_copy_function (ValaCCodeStructModule* self, ValaStruct* st);
static void vala_ccode_struct_module_add_struct_destroy_function (ValaCCodeStructModule* self, ValaStruct* st);
static void vala_ccode_struct_module_add_struct_dup_function (ValaCCodeStructModule* self, ValaStruct* st);
static void vala_ccode_struct_module_add_struct_free_function (ValaCCodeStructModule* self, ValaStruct* st);
void vala_ccode_base_module_pop_context (ValaCCodeBaseModule* self);
void vala_ccode_base_module_push_function (ValaCCodeBaseModule* self, ValaCCodeFunction* func);
gboolean vala_ccode_base_module_requires_copy (ValaCCodeBaseModule* self, ValaDataType* type);
ValaDataType* vala_ccode_base_module_get_data_type_for_symbol (ValaTypeSymbol* sym);
void vala_ccode_base_module_set_cvalue (ValaCCodeBaseModule* self, ValaExpression* expr, ValaCCodeExpression* cvalue);
ValaCCodeExpression* vala_ccode_base_module_get_ref_cexpression (ValaCCodeBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, ValaCodeNode* node);
ValaCCodeFunction* vala_ccode_base_module_get_ccode (ValaCCodeBaseModule* self);
void vala_ccode_base_module_pop_function (ValaCCodeBaseModule* self);
ValaCCodeStructModule* vala_ccode_struct_module_construct (GType object_type);
ValaCCodeBaseModule* vala_ccode_base_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_struct_module_real_generate_struct_declaration (ValaCCodeBaseModule* base, ValaStruct* st, ValaCCodeFile* decl_space) {
      ValaCCodeStructModule * self;
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      gboolean _tmp2_;
      gboolean _tmp3_;
      gboolean _tmp4_;
      ValaCodeContext* _tmp14_ = NULL;
      ValaProfile _tmp15_;
      gchar* _tmp31_ = NULL;
      gchar* _tmp32_;
      gchar* _tmp33_ = NULL;
      gchar* _tmp34_;
      ValaCCodeStruct* _tmp35_ = NULL;
      ValaCCodeStruct* _tmp36_;
      ValaCCodeStruct* instance_struct;
      gboolean _tmp37_;
      ValaStruct* _tmp90_ = NULL;
      gchar* _tmp110_ = NULL;
      gchar* _tmp111_;
      gchar* _tmp112_ = NULL;
      gchar* _tmp113_;
      gchar* _tmp114_;
      gchar* _tmp115_;
      ValaCCodeFunction* _tmp116_ = NULL;
      ValaCCodeFunction* _tmp117_;
      ValaCCodeFunction* function;
      gboolean _tmp118_;
      gchar* _tmp119_ = NULL;
      gchar* _tmp120_;
      gchar* _tmp121_;
      gchar* _tmp122_;
      gchar* _tmp123_;
      gchar* _tmp124_;
      ValaCCodeParameter* _tmp125_ = NULL;
      ValaCCodeParameter* _tmp126_;
      gchar* _tmp127_ = NULL;
      gchar* _tmp128_;
      ValaCCodeFunction* _tmp129_ = NULL;
      gboolean _tmp130_;
      gchar* _tmp131_ = NULL;
      gchar* _tmp132_;
      gchar* _tmp133_;
      gchar* _tmp134_;
      ValaCCodeParameter* _tmp135_ = NULL;
      ValaCCodeParameter* _tmp136_;
      gboolean _tmp137_;
      self = (ValaCCodeStructModule*) base;
      g_return_if_fail (st != NULL);
      g_return_if_fail (decl_space != NULL);
      _tmp0_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_base_module_add_symbol_declaration ((ValaCCodeBaseModule*) self, decl_space, (ValaSymbol*) st, _tmp1_);
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      if (_tmp3_) {
            return;
      }
      _tmp4_ = vala_struct_is_boolean_type (st);
      if (_tmp4_) {
            vala_ccode_file_add_include (decl_space, "stdbool.h", FALSE);
            vala_struct_set_cname (st, "bool");
            return;
      } else {
            gboolean _tmp5_;
            _tmp5_ = vala_struct_is_integer_type (st);
            if (_tmp5_) {
                  const gchar* _tmp6_ = NULL;
                  gboolean _tmp7_;
                  gint _tmp8_;
                  gchar* _tmp9_ = NULL;
                  gchar* _tmp10_;
                  vala_ccode_file_add_include (decl_space, "stdint.h", FALSE);
                  _tmp7_ = vala_struct_get_signed (st);
                  if (_tmp7_) {
                        _tmp6_ = "";
                  } else {
                        _tmp6_ = "u";
                  }
                  _tmp8_ = vala_struct_get_width (st);
                  _tmp9_ = g_strdup_printf ("%sint%d_t", _tmp6_, _tmp8_);
                  _tmp10_ = _tmp9_;
                  vala_struct_set_cname (st, _tmp10_);
                  _g_free0 (_tmp10_);
                  return;
            } else {
                  gboolean _tmp11_;
                  _tmp11_ = vala_struct_is_floating_type (st);
                  if (_tmp11_) {
                        const gchar* _tmp12_ = NULL;
                        gint _tmp13_;
                        _tmp13_ = vala_struct_get_width (st);
                        if (_tmp13_ == 64) {
                              _tmp12_ = "double";
                        } else {
                              _tmp12_ = "float";
                        }
                        vala_struct_set_cname (st, _tmp12_);
                        return;
                  }
            }
      }
      _tmp14_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
      _tmp15_ = vala_code_context_get_profile (_tmp14_);
      if (_tmp15_ == VALA_PROFILE_GOBJECT) {
            gboolean _tmp16_;
            _tmp16_ = vala_struct_get_has_type_id (st);
            if (_tmp16_) {
                  ValaCCodeNewline* _tmp17_ = NULL;
                  ValaCCodeNewline* _tmp18_;
                  gchar* _tmp19_ = NULL;
                  gchar* _tmp20_;
                  gchar* _tmp21_ = NULL;
                  gchar* _tmp22_;
                  gchar* macro;
                  gchar* _tmp23_ = NULL;
                  gchar* _tmp24_;
                  ValaCCodeMacroReplacement* _tmp25_ = NULL;
                  ValaCCodeMacroReplacement* _tmp26_;
                  ValaCodeContext* _tmp27_ = NULL;
                  ValaStructRegisterFunction* _tmp28_ = NULL;
                  ValaStructRegisterFunction* type_fun;
                  ValaCCodeFragment* _tmp29_ = NULL;
                  ValaCCodeFragment* _tmp30_;
                  _tmp17_ = vala_ccode_newline_new ();
                  _tmp18_ = _tmp17_;
                  vala_ccode_file_add_type_declaration (decl_space, (ValaCCodeNode*) _tmp18_);
                  _vala_ccode_node_unref0 (_tmp18_);
                  _tmp19_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) st, NULL);
                  _tmp20_ = _tmp19_;
                  _tmp21_ = g_strdup_printf ("(%s_get_type ())", _tmp20_);
                  _tmp22_ = _tmp21_;
                  _g_free0 (_tmp20_);
                  macro = _tmp22_;
                  _tmp23_ = vala_typesymbol_get_type_id ((ValaTypeSymbol*) st);
                  _tmp24_ = _tmp23_;
                  _tmp25_ = vala_ccode_macro_replacement_new (_tmp24_, macro);
                  _tmp26_ = _tmp25_;
                  vala_ccode_file_add_type_declaration (decl_space, (ValaCCodeNode*) _tmp26_);
                  _vala_ccode_node_unref0 (_tmp26_);
                  _g_free0 (_tmp24_);
                  _tmp27_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
                  _tmp28_ = vala_struct_register_function_new (st, _tmp27_);
                  type_fun = _tmp28_;
                  vala_typeregister_function_init_from_type ((ValaTypeRegisterFunction*) type_fun, FALSE, TRUE);
                  _tmp29_ = vala_typeregister_function_get_declaration ((ValaTypeRegisterFunction*) type_fun);
                  _tmp30_ = _tmp29_;
                  vala_ccode_file_add_type_member_declaration (decl_space, (ValaCCodeNode*) _tmp30_);
                  _vala_ccode_node_unref0 (_tmp30_);
                  _vala_typeregister_function_unref0 (type_fun);
                  _g_free0 (macro);
            }
      }
      _tmp31_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp32_ = _tmp31_;
      _tmp33_ = g_strdup_printf ("_%s", _tmp32_);
      _tmp34_ = _tmp33_;
      _tmp35_ = vala_ccode_struct_new (_tmp34_);
      _tmp36_ = _tmp35_;
      _g_free0 (_tmp34_);
      _g_free0 (_tmp32_);
      instance_struct = _tmp36_;
      _tmp37_ = vala_symbol_get_deprecated ((ValaSymbol*) st);
      vala_ccode_struct_set_deprecated (instance_struct, _tmp37_);
      {
            ValaList* _tmp38_ = NULL;
            ValaList* _f_list;
            gint _tmp39_;
            gint _f_size;
            gint _f_index;
            _tmp38_ = vala_struct_get_fields (st);
            _f_list = _tmp38_;
            _tmp39_ = vala_collection_get_size ((ValaCollection*) _f_list);
            _f_size = _tmp39_;
            _f_index = -1;
            while (TRUE) {
                  gpointer _tmp40_ = NULL;
                  ValaField* f;
                  ValaDataType* _tmp41_ = NULL;
                  gchar* _tmp42_ = NULL;
                  gchar* field_ctype;
                  gboolean _tmp43_;
                  ValaMemberBinding _tmp45_;
                  _f_index = _f_index + 1;
                  if (!(_f_index < _f_size)) {
                        break;
                  }
                  _tmp40_ = vala_list_get (_f_list, _f_index);
                  f = (ValaField*) _tmp40_;
                  _tmp41_ = vala_variable_get_variable_type ((ValaVariable*) f);
                  _tmp42_ = vala_data_type_get_cname (_tmp41_);
                  field_ctype = _tmp42_;
                  _tmp43_ = vala_field_get_is_volatile (f);
                  if (_tmp43_) {
                        gchar* _tmp44_;
                        _tmp44_ = g_strconcat ("volatile ", field_ctype, NULL);
                        _g_free0 (field_ctype);
                        field_ctype = _tmp44_;
                  }
                  _tmp45_ = vala_field_get_binding (f);
                  if (_tmp45_ == VALA_MEMBER_BINDING_INSTANCE) {
                        ValaDataType* _tmp46_ = NULL;
                        const gchar* _tmp47_ = NULL;
                        gboolean _tmp48_;
                        gchar* _tmp49_ = NULL;
                        gchar* _tmp50_;
                        ValaDataType* _tmp51_ = NULL;
                        gchar* _tmp52_ = NULL;
                        gchar* _tmp53_;
                        gchar* _tmp54_;
                        gchar* _tmp55_;
                        gboolean _tmp56_ = FALSE;
                        ValaDataType* _tmp57_ = NULL;
                        _tmp46_ = vala_variable_get_variable_type ((ValaVariable*) f);
                        vala_ccode_base_module_generate_type_declaration ((ValaCCodeBaseModule*) self, _tmp46_, decl_space);
                        _tmp48_ = vala_symbol_get_deprecated ((ValaSymbol*) f);
                        if (_tmp48_) {
                              _tmp47_ = " G_GNUC_DEPRECATED";
                        } else {
                              _tmp47_ = NULL;
                        }
                        _tmp49_ = vala_field_get_cname (f);
                        _tmp50_ = _tmp49_;
                        _tmp51_ = vala_variable_get_variable_type ((ValaVariable*) f);
                        _tmp52_ = vala_data_type_get_cdeclarator_suffix (_tmp51_);
                        _tmp53_ = _tmp52_;
                        _tmp54_ = g_strconcat (_tmp50_, _tmp53_, NULL);
                        _tmp55_ = _tmp54_;
                        vala_ccode_struct_add_field (instance_struct, field_ctype, _tmp55_, _tmp47_);
                        _g_free0 (_tmp55_);
                        _g_free0 (_tmp53_);
                        _g_free0 (_tmp50_);
                        _tmp57_ = vala_variable_get_variable_type ((ValaVariable*) f);
                        if (VALA_IS_ARRAY_TYPE (_tmp57_)) {
                              gboolean _tmp58_;
                              _tmp58_ = vala_variable_get_no_array_length ((ValaVariable*) f);
                              _tmp56_ = !_tmp58_;
                        } else {
                              _tmp56_ = FALSE;
                        }
                        if (_tmp56_) {
                              ValaDataType* _tmp59_ = NULL;
                              ValaArrayType* _tmp60_;
                              ValaArrayType* array_type;
                              gboolean _tmp61_;
                              _tmp59_ = vala_variable_get_variable_type ((ValaVariable*) f);
                              _tmp60_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp59_));
                              array_type = _tmp60_;
                              _tmp61_ = vala_array_type_get_fixed_length (array_type);
                              if (!_tmp61_) {
                                    ValaDataType* _tmp62_ = NULL;
                                    ValaDataType* len_type;
                                    gboolean _tmp70_ = FALSE;
                                    gint _tmp71_;
                                    _tmp62_ = vala_data_type_copy (((ValaCCodeBaseModule*) self)->int_type);
                                    len_type = _tmp62_;
                                    {
                                          gint dim;
                                          dim = 1;
                                          {
                                                gboolean _tmp63_;
                                                _tmp63_ = TRUE;
                                                while (TRUE) {
                                                      gint _tmp64_;
                                                      gchar* _tmp65_ = NULL;
                                                      gchar* _tmp66_;
                                                      const gchar* _tmp67_ = NULL;
                                                      gchar* _tmp68_ = NULL;
                                                      gchar* _tmp69_;
                                                      if (!_tmp63_) {
                                                            dim++;
                                                      }
                                                      _tmp63_ = FALSE;
                                                      _tmp64_ = vala_array_type_get_rank (array_type);
                                                      if (!(dim <= _tmp64_)) {
                                                            break;
                                                      }
                                                      _tmp65_ = vala_data_type_get_cname (len_type);
                                                      _tmp66_ = _tmp65_;
                                                      _tmp67_ = vala_symbol_get_name ((ValaSymbol*) f);
                                                      _tmp68_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp67_, dim);
                                                      _tmp69_ = _tmp68_;
                                                      vala_ccode_struct_add_field (instance_struct, _tmp66_, _tmp69_, NULL);
                                                      _g_free0 (_tmp69_);
                                                      _g_free0 (_tmp66_);
                                                }
                                          }
                                    }
                                    _tmp71_ = vala_array_type_get_rank (array_type);
                                    if (_tmp71_ == 1) {
                                          gboolean _tmp72_;
                                          _tmp72_ = vala_symbol_is_internal_symbol ((ValaSymbol*) f);
                                          _tmp70_ = _tmp72_;
                                    } else {
                                          _tmp70_ = FALSE;
                                    }
                                    if (_tmp70_) {
                                          gchar* _tmp73_ = NULL;
                                          gchar* _tmp74_;
                                          const gchar* _tmp75_ = NULL;
                                          gchar* _tmp76_ = NULL;
                                          gchar* _tmp77_;
                                          _tmp73_ = vala_data_type_get_cname (len_type);
                                          _tmp74_ = _tmp73_;
                                          _tmp75_ = vala_symbol_get_name ((ValaSymbol*) f);
                                          _tmp76_ = vala_ccode_base_module_get_array_size_cname ((ValaCCodeBaseModule*) self, _tmp75_);
                                          _tmp77_ = _tmp76_;
                                          vala_ccode_struct_add_field (instance_struct, _tmp74_, _tmp77_, NULL);
                                          _g_free0 (_tmp77_);
                                          _g_free0 (_tmp74_);
                                    }
                                    _vala_code_node_unref0 (len_type);
                              }
                              _vala_code_node_unref0 (array_type);
                        } else {
                              ValaDataType* _tmp78_ = NULL;
                              _tmp78_ = vala_variable_get_variable_type ((ValaVariable*) f);
                              if (VALA_IS_DELEGATE_TYPE (_tmp78_)) {
                                    ValaDataType* _tmp79_ = NULL;
                                    ValaDelegateType* _tmp80_;
                                    ValaDelegateType* delegate_type;
                                    ValaDelegate* _tmp81_ = NULL;
                                    gboolean _tmp82_;
                                    _tmp79_ = vala_variable_get_variable_type ((ValaVariable*) f);
                                    _tmp80_ = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (_tmp79_));
                                    delegate_type = _tmp80_;
                                    _tmp81_ = vala_delegate_type_get_delegate_symbol (delegate_type);
                                    _tmp82_ = vala_delegate_get_has_target (_tmp81_);
                                    if (_tmp82_) {
                                          const gchar* _tmp83_ = NULL;
                                          gchar* _tmp84_ = NULL;
                                          gchar* _tmp85_;
                                          gboolean _tmp86_;
                                          _tmp83_ = vala_symbol_get_name ((ValaSymbol*) f);
                                          _tmp84_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, _tmp83_);
                                          _tmp85_ = _tmp84_;
                                          vala_ccode_struct_add_field (instance_struct, "gpointer", _tmp85_, NULL);
                                          _g_free0 (_tmp85_);
                                          _tmp86_ = vala_data_type_get_value_owned ((ValaDataType*) delegate_type);
                                          if (_tmp86_) {
                                                const gchar* _tmp87_ = NULL;
                                                gchar* _tmp88_ = NULL;
                                                gchar* _tmp89_;
                                                _tmp87_ = vala_symbol_get_name ((ValaSymbol*) f);
                                                _tmp88_ = vala_ccode_base_module_get_delegate_target_destroy_notify_cname ((ValaCCodeBaseModule*) self, _tmp87_);
                                                _tmp89_ = _tmp88_;
                                                vala_ccode_struct_add_field (instance_struct, "GDestroyNotify", _tmp89_, NULL);
                                                _g_free0 (_tmp89_);
                                          }
                                    }
                                    _vala_code_node_unref0 (delegate_type);
                              }
                        }
                  }
                  _g_free0 (field_ctype);
                  _vala_code_node_unref0 (f);
            }
            _vala_iterable_unref0 (_f_list);
      }
      _tmp90_ = vala_struct_get_base_struct (st);
      if (_tmp90_ == NULL) {
            gchar* _tmp91_ = NULL;
            gchar* _tmp92_;
            gchar* _tmp93_ = NULL;
            gchar* _tmp94_;
            gchar* _tmp95_ = NULL;
            gchar* _tmp96_;
            ValaCCodeVariableDeclarator* _tmp97_ = NULL;
            ValaCCodeVariableDeclarator* _tmp98_;
            ValaCCodeTypeDefinition* _tmp99_ = NULL;
            ValaCCodeTypeDefinition* _tmp100_;
            _tmp91_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp92_ = _tmp91_;
            _tmp93_ = g_strdup_printf ("struct _%s", _tmp92_);
            _tmp94_ = _tmp93_;
            _tmp95_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp96_ = _tmp95_;
            _tmp97_ = vala_ccode_variable_declarator_new (_tmp96_, NULL, NULL);
            _tmp98_ = _tmp97_;
            _tmp99_ = vala_ccode_type_definition_new (_tmp94_, (ValaCCodeDeclarator*) _tmp98_);
            _tmp100_ = _tmp99_;
            vala_ccode_file_add_type_declaration (decl_space, (ValaCCodeNode*) _tmp100_);
            _vala_ccode_node_unref0 (_tmp100_);
            _vala_ccode_node_unref0 (_tmp98_);
            _g_free0 (_tmp96_);
            _g_free0 (_tmp94_);
            _g_free0 (_tmp92_);
            vala_ccode_file_add_type_definition (decl_space, (ValaCCodeNode*) instance_struct);
      } else {
            ValaStruct* _tmp101_ = NULL;
            gchar* _tmp102_ = NULL;
            gchar* _tmp103_;
            gchar* _tmp104_ = NULL;
            gchar* _tmp105_;
            ValaCCodeVariableDeclarator* _tmp106_ = NULL;
            ValaCCodeVariableDeclarator* _tmp107_;
            ValaCCodeTypeDefinition* _tmp108_ = NULL;
            ValaCCodeTypeDefinition* _tmp109_;
            _tmp101_ = vala_struct_get_base_struct (st);
            _tmp102_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) _tmp101_, FALSE);
            _tmp103_ = _tmp102_;
            _tmp104_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp105_ = _tmp104_;
            _tmp106_ = vala_ccode_variable_declarator_new (_tmp105_, NULL, NULL);
            _tmp107_ = _tmp106_;
            _tmp108_ = vala_ccode_type_definition_new (_tmp103_, (ValaCCodeDeclarator*) _tmp107_);
            _tmp109_ = _tmp108_;
            vala_ccode_file_add_type_declaration (decl_space, (ValaCCodeNode*) _tmp109_);
            _vala_ccode_node_unref0 (_tmp109_);
            _vala_ccode_node_unref0 (_tmp107_);
            _g_free0 (_tmp105_);
            _g_free0 (_tmp103_);
      }
      _tmp110_ = vala_typesymbol_get_dup_function ((ValaTypeSymbol*) st);
      _tmp111_ = _tmp110_;
      _tmp112_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp113_ = _tmp112_;
      _tmp114_ = g_strconcat (_tmp113_, "*", NULL);
      _tmp115_ = _tmp114_;
      _tmp116_ = vala_ccode_function_new (_tmp111_, _tmp115_);
      _tmp117_ = _tmp116_;
      _g_free0 (_tmp115_);
      _g_free0 (_tmp113_);
      _g_free0 (_tmp111_);
      function = _tmp117_;
      _tmp118_ = vala_symbol_is_private_symbol ((ValaSymbol*) st);
      if (_tmp118_) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp119_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp120_ = _tmp119_;
      _tmp121_ = g_strconcat ("const ", _tmp120_, NULL);
      _tmp122_ = _tmp121_;
      _tmp123_ = g_strconcat (_tmp122_, "*", NULL);
      _tmp124_ = _tmp123_;
      _tmp125_ = vala_ccode_parameter_new ("self", _tmp124_);
      _tmp126_ = _tmp125_;
      vala_ccode_function_add_parameter (function, _tmp126_);
      _vala_ccode_node_unref0 (_tmp126_);
      _g_free0 (_tmp124_);
      _g_free0 (_tmp122_);
      _g_free0 (_tmp120_);
      vala_ccode_file_add_function_declaration (decl_space, function);
      _tmp127_ = vala_typesymbol_get_free_function ((ValaTypeSymbol*) st);
      _tmp128_ = _tmp127_;
      _tmp129_ = vala_ccode_function_new (_tmp128_, "void");
      _vala_ccode_node_unref0 (function);
      function = _tmp129_;
      _g_free0 (_tmp128_);
      _tmp130_ = vala_symbol_is_private_symbol ((ValaSymbol*) st);
      if (_tmp130_) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp131_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp132_ = _tmp131_;
      _tmp133_ = g_strconcat (_tmp132_, "*", NULL);
      _tmp134_ = _tmp133_;
      _tmp135_ = vala_ccode_parameter_new ("self", _tmp134_);
      _tmp136_ = _tmp135_;
      vala_ccode_function_add_parameter (function, _tmp136_);
      _vala_ccode_node_unref0 (_tmp136_);
      _g_free0 (_tmp134_);
      _g_free0 (_tmp132_);
      vala_ccode_file_add_function_declaration (decl_space, function);
      _tmp137_ = vala_struct_is_disposable (st);
      if (_tmp137_) {
            gchar* _tmp138_ = NULL;
            gchar* _tmp139_;
            ValaCCodeFunction* _tmp140_ = NULL;
            gboolean _tmp141_;
            gchar* _tmp142_ = NULL;
            gchar* _tmp143_;
            gchar* _tmp144_;
            gchar* _tmp145_;
            gchar* _tmp146_;
            gchar* _tmp147_;
            ValaCCodeParameter* _tmp148_ = NULL;
            ValaCCodeParameter* _tmp149_;
            gchar* _tmp150_ = NULL;
            gchar* _tmp151_;
            gchar* _tmp152_;
            gchar* _tmp153_;
            ValaCCodeParameter* _tmp154_ = NULL;
            ValaCCodeParameter* _tmp155_;
            gchar* _tmp156_ = NULL;
            gchar* _tmp157_;
            ValaCCodeFunction* _tmp158_ = NULL;
            gboolean _tmp159_;
            gchar* _tmp160_ = NULL;
            gchar* _tmp161_;
            gchar* _tmp162_;
            gchar* _tmp163_;
            ValaCCodeParameter* _tmp164_ = NULL;
            ValaCCodeParameter* _tmp165_;
            _tmp138_ = vala_typesymbol_get_copy_function ((ValaTypeSymbol*) st);
            _tmp139_ = _tmp138_;
            _tmp140_ = vala_ccode_function_new (_tmp139_, "void");
            _vala_ccode_node_unref0 (function);
            function = _tmp140_;
            _g_free0 (_tmp139_);
            _tmp141_ = vala_symbol_is_private_symbol ((ValaSymbol*) st);
            if (_tmp141_) {
                  vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
            }
            _tmp142_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp143_ = _tmp142_;
            _tmp144_ = g_strconcat ("const ", _tmp143_, NULL);
            _tmp145_ = _tmp144_;
            _tmp146_ = g_strconcat (_tmp145_, "*", NULL);
            _tmp147_ = _tmp146_;
            _tmp148_ = vala_ccode_parameter_new ("self", _tmp147_);
            _tmp149_ = _tmp148_;
            vala_ccode_function_add_parameter (function, _tmp149_);
            _vala_ccode_node_unref0 (_tmp149_);
            _g_free0 (_tmp147_);
            _g_free0 (_tmp145_);
            _g_free0 (_tmp143_);
            _tmp150_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp151_ = _tmp150_;
            _tmp152_ = g_strconcat (_tmp151_, "*", NULL);
            _tmp153_ = _tmp152_;
            _tmp154_ = vala_ccode_parameter_new ("dest", _tmp153_);
            _tmp155_ = _tmp154_;
            vala_ccode_function_add_parameter (function, _tmp155_);
            _vala_ccode_node_unref0 (_tmp155_);
            _g_free0 (_tmp153_);
            _g_free0 (_tmp151_);
            vala_ccode_file_add_function_declaration (decl_space, function);
            _tmp156_ = vala_typesymbol_get_destroy_function ((ValaTypeSymbol*) st);
            _tmp157_ = _tmp156_;
            _tmp158_ = vala_ccode_function_new (_tmp157_, "void");
            _vala_ccode_node_unref0 (function);
            function = _tmp158_;
            _g_free0 (_tmp157_);
            _tmp159_ = vala_symbol_is_private_symbol ((ValaSymbol*) st);
            if (_tmp159_) {
                  vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
            }
            _tmp160_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp161_ = _tmp160_;
            _tmp162_ = g_strconcat (_tmp161_, "*", NULL);
            _tmp163_ = _tmp162_;
            _tmp164_ = vala_ccode_parameter_new ("self", _tmp163_);
            _tmp165_ = _tmp164_;
            vala_ccode_function_add_parameter (function, _tmp165_);
            _vala_ccode_node_unref0 (_tmp165_);
            _g_free0 (_tmp163_);
            _g_free0 (_tmp161_);
            vala_ccode_file_add_function_declaration (decl_space, function);
      }
      _vala_ccode_node_unref0 (function);
      _vala_ccode_node_unref0 (instance_struct);
}


static gpointer _vala_ccode_base_module_emit_context_ref0 (gpointer self) {
      return self ? vala_ccode_base_module_emit_context_ref (self) : NULL;
}


static void vala_ccode_struct_module_real_visit_struct (ValaCodeVisitor* base, ValaStruct* st) {
      ValaCCodeStructModule * self;
      ValaCCodeBaseModuleEmitContext* _tmp0_ = NULL;
      ValaCCodeBaseModuleEmitContext* _tmp1_;
      ValaCCodeBaseModuleEmitContext* _tmp2_;
      ValaCCodeBaseModuleEmitContext* old_instance_finalize_context;
      ValaCCodeBaseModuleEmitContext* _tmp3_ = NULL;
      gboolean _tmp4_;
      gboolean _tmp5_;
      gboolean _tmp6_ = FALSE;
      gboolean _tmp7_ = FALSE;
      gboolean _tmp8_ = FALSE;
      ValaCodeContext* _tmp9_ = NULL;
      ValaProfile _tmp10_;
      gboolean _tmp15_ = FALSE;
      gboolean _tmp16_ = FALSE;
      gboolean _tmp17_ = FALSE;
      ValaCodeContext* _tmp18_ = NULL;
      ValaProfile _tmp19_;
      ValaCCodeBaseModuleEmitContext* _tmp24_;
      self = (ValaCCodeStructModule*) base;
      g_return_if_fail (st != NULL);
      _tmp0_ = vala_ccode_base_module_emit_context_new ((ValaSymbol*) st);
      _tmp1_ = _tmp0_;
      vala_ccode_base_module_push_context ((ValaCCodeBaseModule*) self, _tmp1_);
      _vala_ccode_base_module_emit_context_unref0 (_tmp1_);
      _tmp2_ = _vala_ccode_base_module_emit_context_ref0 (((ValaCCodeBaseModule*) self)->instance_finalize_context);
      old_instance_finalize_context = _tmp2_;
      _tmp3_ = vala_ccode_base_module_emit_context_new (NULL);
      _vala_ccode_base_module_emit_context_unref0 (((ValaCCodeBaseModule*) self)->instance_finalize_context);
      ((ValaCCodeBaseModule*) self)->instance_finalize_context = _tmp3_;
      vala_ccode_base_module_generate_struct_declaration ((ValaCCodeBaseModule*) self, st, ((ValaCCodeBaseModule*) self)->cfile);
      _tmp4_ = vala_symbol_is_internal_symbol ((ValaSymbol*) st);
      if (!_tmp4_) {
            vala_ccode_base_module_generate_struct_declaration ((ValaCCodeBaseModule*) self, st, ((ValaCCodeBaseModule*) self)->header_file);
      }
      _tmp5_ = vala_symbol_is_private_symbol ((ValaSymbol*) st);
      if (!_tmp5_) {
            vala_ccode_base_module_generate_struct_declaration ((ValaCCodeBaseModule*) self, st, ((ValaCCodeBaseModule*) self)->internal_header_file);
      }
      _tmp9_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
      _tmp10_ = vala_code_context_get_profile (_tmp9_);
      if (_tmp10_ == VALA_PROFILE_GOBJECT) {
            gboolean _tmp11_;
            _tmp11_ = vala_struct_is_boolean_type (st);
            _tmp8_ = !_tmp11_;
      } else {
            _tmp8_ = FALSE;
      }
      if (_tmp8_) {
            gboolean _tmp12_;
            _tmp12_ = vala_struct_is_integer_type (st);
            _tmp7_ = !_tmp12_;
      } else {
            _tmp7_ = FALSE;
      }
      if (_tmp7_) {
            gboolean _tmp13_;
            _tmp13_ = vala_struct_is_floating_type (st);
            _tmp6_ = !_tmp13_;
      } else {
            _tmp6_ = FALSE;
      }
      if (_tmp6_) {
            gboolean _tmp14_;
            _tmp14_ = vala_struct_is_disposable (st);
            if (_tmp14_) {
                  vala_ccode_struct_module_begin_struct_destroy_function (self, st);
            }
      }
      vala_code_node_accept_children ((ValaCodeNode*) st, (ValaCodeVisitor*) self);
      _tmp18_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
      _tmp19_ = vala_code_context_get_profile (_tmp18_);
      if (_tmp19_ == VALA_PROFILE_GOBJECT) {
            gboolean _tmp20_;
            _tmp20_ = vala_struct_is_boolean_type (st);
            _tmp17_ = !_tmp20_;
      } else {
            _tmp17_ = FALSE;
      }
      if (_tmp17_) {
            gboolean _tmp21_;
            _tmp21_ = vala_struct_is_integer_type (st);
            _tmp16_ = !_tmp21_;
      } else {
            _tmp16_ = FALSE;
      }
      if (_tmp16_) {
            gboolean _tmp22_;
            _tmp22_ = vala_struct_is_floating_type (st);
            _tmp15_ = !_tmp22_;
      } else {
            _tmp15_ = FALSE;
      }
      if (_tmp15_) {
            gboolean _tmp23_;
            _tmp23_ = vala_struct_is_disposable (st);
            if (_tmp23_) {
                  vala_ccode_struct_module_add_struct_copy_function (self, st);
                  vala_ccode_struct_module_add_struct_destroy_function (self, st);
            }
            vala_ccode_struct_module_add_struct_dup_function (self, st);
            vala_ccode_struct_module_add_struct_free_function (self, st);
      }
      _tmp24_ = _vala_ccode_base_module_emit_context_ref0 (old_instance_finalize_context);
      _vala_ccode_base_module_emit_context_unref0 (((ValaCCodeBaseModule*) self)->instance_finalize_context);
      ((ValaCCodeBaseModule*) self)->instance_finalize_context = _tmp24_;
      vala_ccode_base_module_pop_context ((ValaCCodeBaseModule*) self);
      _vala_ccode_base_module_emit_context_unref0 (old_instance_finalize_context);
}


static void vala_ccode_struct_module_add_struct_dup_function (ValaCCodeStructModule* self, ValaStruct* st) {
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      gchar* _tmp2_ = NULL;
      gchar* _tmp3_;
      gchar* _tmp4_;
      gchar* _tmp5_;
      ValaCCodeFunction* _tmp6_ = NULL;
      ValaCCodeFunction* _tmp7_;
      ValaCCodeFunction* function;
      ValaSymbolAccessibility _tmp8_;
      gchar* _tmp9_ = NULL;
      gchar* _tmp10_;
      gchar* _tmp11_;
      gchar* _tmp12_;
      gchar* _tmp13_;
      gchar* _tmp14_;
      ValaCCodeParameter* _tmp15_ = NULL;
      ValaCCodeParameter* _tmp16_;
      ValaCCodeBlock* _tmp17_ = NULL;
      ValaCCodeBlock* cblock;
      gchar* _tmp18_ = NULL;
      gchar* _tmp19_;
      gchar* _tmp20_;
      gchar* _tmp21_;
      ValaCCodeDeclaration* _tmp22_ = NULL;
      ValaCCodeDeclaration* _tmp23_;
      ValaCCodeDeclaration* _cdecl_;
      ValaCCodeVariableDeclarator* _tmp24_ = NULL;
      ValaCCodeVariableDeclarator* _tmp25_;
      ValaCCodeIdentifier* _tmp26_ = NULL;
      ValaCCodeIdentifier* _tmp27_;
      ValaCCodeFunctionCall* _tmp28_ = NULL;
      ValaCCodeFunctionCall* _tmp29_;
      ValaCCodeFunctionCall* creation_call;
      gchar* _tmp30_ = NULL;
      gchar* _tmp31_;
      ValaCCodeConstant* _tmp32_ = NULL;
      ValaCCodeConstant* _tmp33_;
      ValaCCodeConstant* _tmp34_ = NULL;
      ValaCCodeConstant* _tmp35_;
      ValaCCodeIdentifier* _tmp36_ = NULL;
      ValaCCodeIdentifier* _tmp37_;
      ValaCCodeAssignment* _tmp38_ = NULL;
      ValaCCodeAssignment* _tmp39_;
      ValaCCodeExpressionStatement* _tmp40_ = NULL;
      ValaCCodeExpressionStatement* _tmp41_;
      gboolean _tmp42_;
      ValaCCodeIdentifier* _tmp73_ = NULL;
      ValaCCodeIdentifier* _tmp74_;
      ValaCCodeReturnStatement* _tmp75_ = NULL;
      ValaCCodeReturnStatement* _tmp76_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (st != NULL);
      _tmp0_ = vala_typesymbol_get_dup_function ((ValaTypeSymbol*) st);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp3_ = _tmp2_;
      _tmp4_ = g_strconcat (_tmp3_, "*", NULL);
      _tmp5_ = _tmp4_;
      _tmp6_ = vala_ccode_function_new (_tmp1_, _tmp5_);
      _tmp7_ = _tmp6_;
      _g_free0 (_tmp5_);
      _g_free0 (_tmp3_);
      _g_free0 (_tmp1_);
      function = _tmp7_;
      _tmp8_ = vala_symbol_get_access ((ValaSymbol*) st);
      if (_tmp8_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp9_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp10_ = _tmp9_;
      _tmp11_ = g_strconcat ("const ", _tmp10_, NULL);
      _tmp12_ = _tmp11_;
      _tmp13_ = g_strconcat (_tmp12_, "*", NULL);
      _tmp14_ = _tmp13_;
      _tmp15_ = vala_ccode_parameter_new ("self", _tmp14_);
      _tmp16_ = _tmp15_;
      vala_ccode_function_add_parameter (function, _tmp16_);
      _vala_ccode_node_unref0 (_tmp16_);
      _g_free0 (_tmp14_);
      _g_free0 (_tmp12_);
      _g_free0 (_tmp10_);
      _tmp17_ = vala_ccode_block_new ();
      cblock = _tmp17_;
      _tmp18_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp19_ = _tmp18_;
      _tmp20_ = g_strconcat (_tmp19_, "*", NULL);
      _tmp21_ = _tmp20_;
      _tmp22_ = vala_ccode_declaration_new (_tmp21_);
      _tmp23_ = _tmp22_;
      _g_free0 (_tmp21_);
      _g_free0 (_tmp19_);
      _cdecl_ = _tmp23_;
      _tmp24_ = vala_ccode_variable_declarator_new ("dup", NULL, NULL);
      _tmp25_ = _tmp24_;
      vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) _tmp25_);
      _vala_ccode_node_unref0 (_tmp25_);
      vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _cdecl_);
      _tmp26_ = vala_ccode_identifier_new ("g_new0");
      _tmp27_ = _tmp26_;
      _tmp28_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp27_);
      _tmp29_ = _tmp28_;
      _vala_ccode_node_unref0 (_tmp27_);
      creation_call = _tmp29_;
      _tmp30_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp31_ = _tmp30_;
      _tmp32_ = vala_ccode_constant_new (_tmp31_);
      _tmp33_ = _tmp32_;
      vala_ccode_function_call_add_argument (creation_call, (ValaCCodeExpression*) _tmp33_);
      _vala_ccode_node_unref0 (_tmp33_);
      _g_free0 (_tmp31_);
      _tmp34_ = vala_ccode_constant_new ("1");
      _tmp35_ = _tmp34_;
      vala_ccode_function_call_add_argument (creation_call, (ValaCCodeExpression*) _tmp35_);
      _vala_ccode_node_unref0 (_tmp35_);
      _tmp36_ = vala_ccode_identifier_new ("dup");
      _tmp37_ = _tmp36_;
      _tmp38_ = vala_ccode_assignment_new ((ValaCCodeExpression*) _tmp37_, (ValaCCodeExpression*) creation_call, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
      _tmp39_ = _tmp38_;
      _tmp40_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp39_);
      _tmp41_ = _tmp40_;
      vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp41_);
      _vala_ccode_node_unref0 (_tmp41_);
      _vala_ccode_node_unref0 (_tmp39_);
      _vala_ccode_node_unref0 (_tmp37_);
      _tmp42_ = vala_struct_is_disposable (st);
      if (_tmp42_) {
            gchar* _tmp43_ = NULL;
            gchar* _tmp44_;
            ValaCCodeIdentifier* _tmp45_ = NULL;
            ValaCCodeIdentifier* _tmp46_;
            ValaCCodeFunctionCall* _tmp47_ = NULL;
            ValaCCodeFunctionCall* _tmp48_;
            ValaCCodeFunctionCall* copy_call;
            ValaCCodeIdentifier* _tmp49_ = NULL;
            ValaCCodeIdentifier* _tmp50_;
            ValaCCodeIdentifier* _tmp51_ = NULL;
            ValaCCodeIdentifier* _tmp52_;
            ValaCCodeExpressionStatement* _tmp53_ = NULL;
            ValaCCodeExpressionStatement* _tmp54_;
            _tmp43_ = vala_typesymbol_get_copy_function ((ValaTypeSymbol*) st);
            _tmp44_ = _tmp43_;
            _tmp45_ = vala_ccode_identifier_new (_tmp44_);
            _tmp46_ = _tmp45_;
            _tmp47_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp46_);
            _tmp48_ = _tmp47_;
            _vala_ccode_node_unref0 (_tmp46_);
            _g_free0 (_tmp44_);
            copy_call = _tmp48_;
            _tmp49_ = vala_ccode_identifier_new ("self");
            _tmp50_ = _tmp49_;
            vala_ccode_function_call_add_argument (copy_call, (ValaCCodeExpression*) _tmp50_);
            _vala_ccode_node_unref0 (_tmp50_);
            _tmp51_ = vala_ccode_identifier_new ("dup");
            _tmp52_ = _tmp51_;
            vala_ccode_function_call_add_argument (copy_call, (ValaCCodeExpression*) _tmp52_);
            _vala_ccode_node_unref0 (_tmp52_);
            _tmp53_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) copy_call);
            _tmp54_ = _tmp53_;
            vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp54_);
            _vala_ccode_node_unref0 (_tmp54_);
            _vala_ccode_node_unref0 (copy_call);
      } else {
            ValaCCodeIdentifier* _tmp55_ = NULL;
            ValaCCodeIdentifier* _tmp56_;
            ValaCCodeFunctionCall* _tmp57_ = NULL;
            ValaCCodeFunctionCall* _tmp58_;
            ValaCCodeFunctionCall* sizeof_call;
            gchar* _tmp59_ = NULL;
            gchar* _tmp60_;
            ValaCCodeConstant* _tmp61_ = NULL;
            ValaCCodeConstant* _tmp62_;
            ValaCCodeIdentifier* _tmp63_ = NULL;
            ValaCCodeIdentifier* _tmp64_;
            ValaCCodeFunctionCall* _tmp65_ = NULL;
            ValaCCodeFunctionCall* _tmp66_;
            ValaCCodeFunctionCall* copy_call;
            ValaCCodeIdentifier* _tmp67_ = NULL;
            ValaCCodeIdentifier* _tmp68_;
            ValaCCodeIdentifier* _tmp69_ = NULL;
            ValaCCodeIdentifier* _tmp70_;
            ValaCCodeExpressionStatement* _tmp71_ = NULL;
            ValaCCodeExpressionStatement* _tmp72_;
            vala_ccode_file_add_include (((ValaCCodeBaseModule*) self)->cfile, "string.h", FALSE);
            _tmp55_ = vala_ccode_identifier_new ("sizeof");
            _tmp56_ = _tmp55_;
            _tmp57_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp56_);
            _tmp58_ = _tmp57_;
            _vala_ccode_node_unref0 (_tmp56_);
            sizeof_call = _tmp58_;
            _tmp59_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
            _tmp60_ = _tmp59_;
            _tmp61_ = vala_ccode_constant_new (_tmp60_);
            _tmp62_ = _tmp61_;
            vala_ccode_function_call_add_argument (sizeof_call, (ValaCCodeExpression*) _tmp62_);
            _vala_ccode_node_unref0 (_tmp62_);
            _g_free0 (_tmp60_);
            _tmp63_ = vala_ccode_identifier_new ("memcpy");
            _tmp64_ = _tmp63_;
            _tmp65_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp64_);
            _tmp66_ = _tmp65_;
            _vala_ccode_node_unref0 (_tmp64_);
            copy_call = _tmp66_;
            _tmp67_ = vala_ccode_identifier_new ("dup");
            _tmp68_ = _tmp67_;
            vala_ccode_function_call_add_argument (copy_call, (ValaCCodeExpression*) _tmp68_);
            _vala_ccode_node_unref0 (_tmp68_);
            _tmp69_ = vala_ccode_identifier_new ("self");
            _tmp70_ = _tmp69_;
            vala_ccode_function_call_add_argument (copy_call, (ValaCCodeExpression*) _tmp70_);
            _vala_ccode_node_unref0 (_tmp70_);
            vala_ccode_function_call_add_argument (copy_call, (ValaCCodeExpression*) sizeof_call);
            _tmp71_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) copy_call);
            _tmp72_ = _tmp71_;
            vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp72_);
            _vala_ccode_node_unref0 (_tmp72_);
            _vala_ccode_node_unref0 (copy_call);
            _vala_ccode_node_unref0 (sizeof_call);
      }
      _tmp73_ = vala_ccode_identifier_new ("dup");
      _tmp74_ = _tmp73_;
      _tmp75_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) _tmp74_);
      _tmp76_ = _tmp75_;
      vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp76_);
      _vala_ccode_node_unref0 (_tmp76_);
      _vala_ccode_node_unref0 (_tmp74_);
      vala_ccode_function_set_block (function, cblock);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, function);
      _vala_ccode_node_unref0 (creation_call);
      _vala_ccode_node_unref0 (_cdecl_);
      _vala_ccode_node_unref0 (cblock);
      _vala_ccode_node_unref0 (function);
}


static void vala_ccode_struct_module_add_struct_free_function (ValaCCodeStructModule* self, ValaStruct* st) {
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      ValaCCodeFunction* _tmp2_ = NULL;
      ValaCCodeFunction* _tmp3_;
      ValaCCodeFunction* function;
      ValaSymbolAccessibility _tmp4_;
      gchar* _tmp5_ = NULL;
      gchar* _tmp6_;
      gchar* _tmp7_;
      gchar* _tmp8_;
      ValaCCodeParameter* _tmp9_ = NULL;
      ValaCCodeParameter* _tmp10_;
      ValaCCodeBlock* _tmp11_ = NULL;
      ValaCCodeBlock* cblock;
      gboolean _tmp12_;
      ValaCCodeIdentifier* _tmp23_ = NULL;
      ValaCCodeIdentifier* _tmp24_;
      ValaCCodeFunctionCall* _tmp25_ = NULL;
      ValaCCodeFunctionCall* _tmp26_;
      ValaCCodeFunctionCall* free_call;
      ValaCCodeIdentifier* _tmp27_ = NULL;
      ValaCCodeIdentifier* _tmp28_;
      ValaCCodeExpressionStatement* _tmp29_ = NULL;
      ValaCCodeExpressionStatement* _tmp30_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (st != NULL);
      _tmp0_ = vala_typesymbol_get_free_function ((ValaTypeSymbol*) st);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_function_new (_tmp1_, "void");
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      function = _tmp3_;
      _tmp4_ = vala_symbol_get_access ((ValaSymbol*) st);
      if (_tmp4_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp5_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp6_ = _tmp5_;
      _tmp7_ = g_strconcat (_tmp6_, "*", NULL);
      _tmp8_ = _tmp7_;
      _tmp9_ = vala_ccode_parameter_new ("self", _tmp8_);
      _tmp10_ = _tmp9_;
      vala_ccode_function_add_parameter (function, _tmp10_);
      _vala_ccode_node_unref0 (_tmp10_);
      _g_free0 (_tmp8_);
      _g_free0 (_tmp6_);
      _tmp11_ = vala_ccode_block_new ();
      cblock = _tmp11_;
      _tmp12_ = vala_struct_is_disposable (st);
      if (_tmp12_) {
            gchar* _tmp13_ = NULL;
            gchar* _tmp14_;
            ValaCCodeIdentifier* _tmp15_ = NULL;
            ValaCCodeIdentifier* _tmp16_;
            ValaCCodeFunctionCall* _tmp17_ = NULL;
            ValaCCodeFunctionCall* _tmp18_;
            ValaCCodeFunctionCall* destroy_call;
            ValaCCodeIdentifier* _tmp19_ = NULL;
            ValaCCodeIdentifier* _tmp20_;
            ValaCCodeExpressionStatement* _tmp21_ = NULL;
            ValaCCodeExpressionStatement* _tmp22_;
            _tmp13_ = vala_typesymbol_get_destroy_function ((ValaTypeSymbol*) st);
            _tmp14_ = _tmp13_;
            _tmp15_ = vala_ccode_identifier_new (_tmp14_);
            _tmp16_ = _tmp15_;
            _tmp17_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp16_);
            _tmp18_ = _tmp17_;
            _vala_ccode_node_unref0 (_tmp16_);
            _g_free0 (_tmp14_);
            destroy_call = _tmp18_;
            _tmp19_ = vala_ccode_identifier_new ("self");
            _tmp20_ = _tmp19_;
            vala_ccode_function_call_add_argument (destroy_call, (ValaCCodeExpression*) _tmp20_);
            _vala_ccode_node_unref0 (_tmp20_);
            _tmp21_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) destroy_call);
            _tmp22_ = _tmp21_;
            vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp22_);
            _vala_ccode_node_unref0 (_tmp22_);
            _vala_ccode_node_unref0 (destroy_call);
      }
      _tmp23_ = vala_ccode_identifier_new ("g_free");
      _tmp24_ = _tmp23_;
      _tmp25_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp24_);
      _tmp26_ = _tmp25_;
      _vala_ccode_node_unref0 (_tmp24_);
      free_call = _tmp26_;
      _tmp27_ = vala_ccode_identifier_new ("self");
      _tmp28_ = _tmp27_;
      vala_ccode_function_call_add_argument (free_call, (ValaCCodeExpression*) _tmp28_);
      _vala_ccode_node_unref0 (_tmp28_);
      _tmp29_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) free_call);
      _tmp30_ = _tmp29_;
      vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) _tmp30_);
      _vala_ccode_node_unref0 (_tmp30_);
      vala_ccode_function_set_block (function, cblock);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, function);
      _vala_ccode_node_unref0 (free_call);
      _vala_ccode_node_unref0 (cblock);
      _vala_ccode_node_unref0 (function);
}


static void vala_ccode_struct_module_add_struct_copy_function (ValaCCodeStructModule* self, ValaStruct* st) {
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      ValaCCodeFunction* _tmp2_ = NULL;
      ValaCCodeFunction* _tmp3_;
      ValaCCodeFunction* function;
      ValaSymbolAccessibility _tmp4_;
      gchar* _tmp5_ = NULL;
      gchar* _tmp6_;
      gchar* _tmp7_;
      gchar* _tmp8_;
      gchar* _tmp9_;
      gchar* _tmp10_;
      ValaCCodeParameter* _tmp11_ = NULL;
      ValaCCodeParameter* _tmp12_;
      gchar* _tmp13_ = NULL;
      gchar* _tmp14_;
      gchar* _tmp15_;
      gchar* _tmp16_;
      ValaCCodeParameter* _tmp17_ = NULL;
      ValaCCodeParameter* _tmp18_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (st != NULL);
      _tmp0_ = vala_typesymbol_get_copy_function ((ValaTypeSymbol*) st);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_function_new (_tmp1_, "void");
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      function = _tmp3_;
      _tmp4_ = vala_symbol_get_access ((ValaSymbol*) st);
      if (_tmp4_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp5_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp6_ = _tmp5_;
      _tmp7_ = g_strconcat ("const ", _tmp6_, NULL);
      _tmp8_ = _tmp7_;
      _tmp9_ = g_strconcat (_tmp8_, "*", NULL);
      _tmp10_ = _tmp9_;
      _tmp11_ = vala_ccode_parameter_new ("self", _tmp10_);
      _tmp12_ = _tmp11_;
      vala_ccode_function_add_parameter (function, _tmp12_);
      _vala_ccode_node_unref0 (_tmp12_);
      _g_free0 (_tmp10_);
      _g_free0 (_tmp8_);
      _g_free0 (_tmp6_);
      _tmp13_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp14_ = _tmp13_;
      _tmp15_ = g_strconcat (_tmp14_, "*", NULL);
      _tmp16_ = _tmp15_;
      _tmp17_ = vala_ccode_parameter_new ("dest", _tmp16_);
      _tmp18_ = _tmp17_;
      vala_ccode_function_add_parameter (function, _tmp18_);
      _vala_ccode_node_unref0 (_tmp18_);
      _g_free0 (_tmp16_);
      _g_free0 (_tmp14_);
      vala_ccode_base_module_push_function ((ValaCCodeBaseModule*) self, function);
      {
            ValaList* _tmp19_ = NULL;
            ValaList* _f_list;
            gint _tmp20_;
            gint _f_size;
            gint _f_index;
            _tmp19_ = vala_struct_get_fields (st);
            _f_list = _tmp19_;
            _tmp20_ = vala_collection_get_size ((ValaCollection*) _f_list);
            _f_size = _tmp20_;
            _f_index = -1;
            while (TRUE) {
                  gpointer _tmp21_ = NULL;
                  ValaField* f;
                  ValaMemberBinding _tmp22_;
                  _f_index = _f_index + 1;
                  if (!(_f_index < _f_size)) {
                        break;
                  }
                  _tmp21_ = vala_list_get (_f_list, _f_index);
                  f = (ValaField*) _tmp21_;
                  _tmp22_ = vala_field_get_binding (f);
                  if (_tmp22_ == VALA_MEMBER_BINDING_INSTANCE) {
                        ValaCCodeIdentifier* _tmp23_ = NULL;
                        ValaCCodeIdentifier* _tmp24_;
                        const gchar* _tmp25_ = NULL;
                        ValaCCodeMemberAccess* _tmp26_ = NULL;
                        ValaCCodeExpression* _tmp27_;
                        ValaCCodeExpression* copy;
                        ValaDataType* _tmp28_ = NULL;
                        gboolean _tmp29_;
                        ValaCCodeIdentifier* _tmp43_ = NULL;
                        ValaCCodeIdentifier* _tmp44_;
                        const gchar* _tmp45_ = NULL;
                        ValaCCodeMemberAccess* _tmp46_ = NULL;
                        ValaCCodeMemberAccess* _tmp47_;
                        ValaCCodeMemberAccess* dest;
                        ValaDataType* _tmp48_ = NULL;
                        ValaDataType* _tmp49_;
                        ValaArrayType* _tmp50_;
                        ValaArrayType* array_type;
                        gboolean _tmp51_ = FALSE;
                        _tmp23_ = vala_ccode_identifier_new ("self");
                        _tmp24_ = _tmp23_;
                        _tmp25_ = vala_symbol_get_name ((ValaSymbol*) f);
                        _tmp26_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp24_, _tmp25_);
                        _tmp27_ = (ValaCCodeExpression*) _tmp26_;
                        _vala_ccode_node_unref0 (_tmp24_);
                        copy = _tmp27_;
                        _tmp28_ = vala_variable_get_variable_type ((ValaVariable*) f);
                        _tmp29_ = vala_ccode_base_module_requires_copy ((ValaCCodeBaseModule*) self, _tmp28_);
                        if (_tmp29_) {
                              ValaMemberAccess* _tmp30_ = NULL;
                              ValaMemberAccess* this_access;
                              ValaSymbol* _tmp31_ = NULL;
                              ValaDataType* _tmp32_ = NULL;
                              ValaDataType* _tmp33_;
                              ValaCCodeIdentifier* _tmp34_ = NULL;
                              ValaCCodeIdentifier* _tmp35_;
                              const gchar* _tmp36_ = NULL;
                              ValaMemberAccess* _tmp37_ = NULL;
                              ValaMemberAccess* ma;
                              ValaDataType* _tmp38_ = NULL;
                              ValaDataType* _tmp39_ = NULL;
                              ValaDataType* _tmp40_;
                              ValaDataType* _tmp41_ = NULL;
                              ValaCCodeExpression* _tmp42_ = NULL;
                              _tmp30_ = vala_member_access_new_simple ("this", NULL);
                              this_access = _tmp30_;
                              _tmp31_ = vala_symbol_get_parent_symbol ((ValaSymbol*) f);
                              _tmp32_ = vala_ccode_base_module_get_data_type_for_symbol (VALA_TYPESYMBOL (_tmp31_));
                              _tmp33_ = _tmp32_;
                              vala_expression_set_value_type ((ValaExpression*) this_access, _tmp33_);
                              _vala_code_node_unref0 (_tmp33_);
                              _tmp34_ = vala_ccode_identifier_new ("(*self)");
                              _tmp35_ = _tmp34_;
                              vala_ccode_base_module_set_cvalue ((ValaCCodeBaseModule*) self, (ValaExpression*) this_access, (ValaCCodeExpression*) _tmp35_);
                              _vala_ccode_node_unref0 (_tmp35_);
                              _tmp36_ = vala_symbol_get_name ((ValaSymbol*) f);
                              _tmp37_ = vala_member_access_new ((ValaExpression*) this_access, _tmp36_, NULL);
                              ma = _tmp37_;
                              vala_expression_set_symbol_reference ((ValaExpression*) ma, (ValaSymbol*) f);
                              _tmp38_ = vala_variable_get_variable_type ((ValaVariable*) f);
                              _tmp39_ = vala_data_type_copy (_tmp38_);
                              _tmp40_ = _tmp39_;
                              vala_expression_set_value_type ((ValaExpression*) ma, _tmp40_);
                              _vala_code_node_unref0 (_tmp40_);
                              vala_code_visitor_visit_member_access ((ValaCodeVisitor*) self, ma);
                              _tmp41_ = vala_variable_get_variable_type ((ValaVariable*) f);
                              _tmp42_ = vala_ccode_base_module_get_ref_cexpression ((ValaCCodeBaseModule*) self, _tmp41_, copy, (ValaExpression*) ma, (ValaCodeNode*) f);
                              _vala_ccode_node_unref0 (copy);
                              copy = _tmp42_;
                              if (copy == NULL) {
                                    _vala_code_node_unref0 (ma);
                                    _vala_code_node_unref0 (this_access);
                                    _vala_ccode_node_unref0 (copy);
                                    _vala_code_node_unref0 (f);
                                    continue;
                              }
                              _vala_code_node_unref0 (ma);
                              _vala_code_node_unref0 (this_access);
                        }
                        _tmp43_ = vala_ccode_identifier_new ("dest");
                        _tmp44_ = _tmp43_;
                        _tmp45_ = vala_symbol_get_name ((ValaSymbol*) f);
                        _tmp46_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp44_, _tmp45_);
                        _tmp47_ = _tmp46_;
                        _vala_ccode_node_unref0 (_tmp44_);
                        dest = _tmp47_;
                        _tmp48_ = vala_variable_get_variable_type ((ValaVariable*) f);
                        _tmp49_ = _tmp48_;
                        _tmp50_ = _vala_code_node_ref0 (VALA_IS_ARRAY_TYPE (_tmp49_) ? ((ValaArrayType*) _tmp49_) : NULL);
                        array_type = _tmp50_;
                        if (array_type != NULL) {
                              gboolean _tmp52_;
                              _tmp52_ = vala_array_type_get_fixed_length (array_type);
                              _tmp51_ = _tmp52_;
                        } else {
                              _tmp51_ = FALSE;
                        }
                        if (_tmp51_) {
                              ValaCCodeIdentifier* _tmp53_ = NULL;
                              ValaCCodeIdentifier* _tmp54_;
                              ValaCCodeFunctionCall* _tmp55_ = NULL;
                              ValaCCodeFunctionCall* _tmp56_;
                              ValaCCodeFunctionCall* sizeof_call;
                              ValaDataType* _tmp57_ = NULL;
                              gchar* _tmp58_ = NULL;
                              gchar* _tmp59_;
                              ValaCCodeIdentifier* _tmp60_ = NULL;
                              ValaCCodeIdentifier* _tmp61_;
                              gint _tmp62_;
                              gchar* _tmp63_ = NULL;
                              gchar* _tmp64_;
                              ValaCCodeConstant* _tmp65_ = NULL;
                              ValaCCodeConstant* _tmp66_;
                              ValaCCodeBinaryExpression* _tmp67_ = NULL;
                              ValaCCodeBinaryExpression* _tmp68_;
                              ValaCCodeBinaryExpression* size;
                              ValaCCodeIdentifier* _tmp69_ = NULL;
                              ValaCCodeIdentifier* _tmp70_;
                              ValaCCodeFunctionCall* _tmp71_ = NULL;
                              ValaCCodeFunctionCall* _tmp72_;
                              ValaCCodeFunctionCall* array_copy_call;
                              ValaCCodeFunction* _tmp73_ = NULL;
                              vala_ccode_file_add_include (((ValaCCodeBaseModule*) self)->cfile, "string.h", FALSE);
                              _tmp53_ = vala_ccode_identifier_new ("sizeof");
                              _tmp54_ = _tmp53_;
                              _tmp55_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp54_);
                              _tmp56_ = _tmp55_;
                              _vala_ccode_node_unref0 (_tmp54_);
                              sizeof_call = _tmp56_;
                              _tmp57_ = vala_array_type_get_element_type (array_type);
                              _tmp58_ = vala_data_type_get_cname (_tmp57_);
                              _tmp59_ = _tmp58_;
                              _tmp60_ = vala_ccode_identifier_new (_tmp59_);
                              _tmp61_ = _tmp60_;
                              vala_ccode_function_call_add_argument (sizeof_call, (ValaCCodeExpression*) _tmp61_);
                              _vala_ccode_node_unref0 (_tmp61_);
                              _g_free0 (_tmp59_);
                              _tmp62_ = vala_array_type_get_length (array_type);
                              _tmp63_ = g_strdup_printf ("%d", _tmp62_);
                              _tmp64_ = _tmp63_;
                              _tmp65_ = vala_ccode_constant_new (_tmp64_);
                              _tmp66_ = _tmp65_;
                              _tmp67_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_MUL, (ValaCCodeExpression*) _tmp66_, (ValaCCodeExpression*) sizeof_call);
                              _tmp68_ = _tmp67_;
                              _vala_ccode_node_unref0 (_tmp66_);
                              _g_free0 (_tmp64_);
                              size = _tmp68_;
                              _tmp69_ = vala_ccode_identifier_new ("memcpy");
                              _tmp70_ = _tmp69_;
                              _tmp71_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp70_);
                              _tmp72_ = _tmp71_;
                              _vala_ccode_node_unref0 (_tmp70_);
                              array_copy_call = _tmp72_;
                              vala_ccode_function_call_add_argument (array_copy_call, (ValaCCodeExpression*) dest);
                              vala_ccode_function_call_add_argument (array_copy_call, copy);
                              vala_ccode_function_call_add_argument (array_copy_call, (ValaCCodeExpression*) size);
                              _tmp73_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                              vala_ccode_function_add_expression (_tmp73_, (ValaCCodeExpression*) array_copy_call);
                              _vala_ccode_node_unref0 (array_copy_call);
                              _vala_ccode_node_unref0 (size);
                              _vala_ccode_node_unref0 (sizeof_call);
                        } else {
                              ValaCCodeFunction* _tmp74_ = NULL;
                              _tmp74_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                              vala_ccode_function_add_assignment (_tmp74_, (ValaCCodeExpression*) dest, copy);
                              if (array_type != NULL) {
                                    {
                                          gint dim;
                                          dim = 1;
                                          {
                                                gboolean _tmp75_;
                                                _tmp75_ = TRUE;
                                                while (TRUE) {
                                                      gint _tmp76_;
                                                      ValaCCodeIdentifier* _tmp77_ = NULL;
                                                      ValaCCodeIdentifier* _tmp78_;
                                                      const gchar* _tmp79_ = NULL;
                                                      gchar* _tmp80_ = NULL;
                                                      gchar* _tmp81_;
                                                      ValaCCodeMemberAccess* _tmp82_ = NULL;
                                                      ValaCCodeMemberAccess* _tmp83_;
                                                      ValaCCodeMemberAccess* len_src;
                                                      ValaCCodeIdentifier* _tmp84_ = NULL;
                                                      ValaCCodeIdentifier* _tmp85_;
                                                      const gchar* _tmp86_ = NULL;
                                                      gchar* _tmp87_ = NULL;
                                                      gchar* _tmp88_;
                                                      ValaCCodeMemberAccess* _tmp89_ = NULL;
                                                      ValaCCodeMemberAccess* _tmp90_;
                                                      ValaCCodeMemberAccess* len_dest;
                                                      ValaCCodeFunction* _tmp91_ = NULL;
                                                      if (!_tmp75_) {
                                                            dim++;
                                                      }
                                                      _tmp75_ = FALSE;
                                                      _tmp76_ = vala_array_type_get_rank (array_type);
                                                      if (!(dim <= _tmp76_)) {
                                                            break;
                                                      }
                                                      _tmp77_ = vala_ccode_identifier_new ("self");
                                                      _tmp78_ = _tmp77_;
                                                      _tmp79_ = vala_symbol_get_name ((ValaSymbol*) f);
                                                      _tmp80_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp79_, dim);
                                                      _tmp81_ = _tmp80_;
                                                      _tmp82_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp78_, _tmp81_);
                                                      _tmp83_ = _tmp82_;
                                                      _g_free0 (_tmp81_);
                                                      _vala_ccode_node_unref0 (_tmp78_);
                                                      len_src = _tmp83_;
                                                      _tmp84_ = vala_ccode_identifier_new ("dest");
                                                      _tmp85_ = _tmp84_;
                                                      _tmp86_ = vala_symbol_get_name ((ValaSymbol*) f);
                                                      _tmp87_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp86_, dim);
                                                      _tmp88_ = _tmp87_;
                                                      _tmp89_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp85_, _tmp88_);
                                                      _tmp90_ = _tmp89_;
                                                      _g_free0 (_tmp88_);
                                                      _vala_ccode_node_unref0 (_tmp85_);
                                                      len_dest = _tmp90_;
                                                      _tmp91_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                                      vala_ccode_function_add_assignment (_tmp91_, (ValaCCodeExpression*) len_dest, (ValaCCodeExpression*) len_src);
                                                      _vala_ccode_node_unref0 (len_dest);
                                                      _vala_ccode_node_unref0 (len_src);
                                                }
                                          }
                                    }
                              }
                        }
                        _vala_code_node_unref0 (array_type);
                        _vala_ccode_node_unref0 (dest);
                        _vala_ccode_node_unref0 (copy);
                  }
                  _vala_code_node_unref0 (f);
            }
            _vala_iterable_unref0 (_f_list);
      }
      vala_ccode_base_module_pop_function ((ValaCCodeBaseModule*) self);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, function);
      _vala_ccode_node_unref0 (function);
}


static void vala_ccode_struct_module_begin_struct_destroy_function (ValaCCodeStructModule* self, ValaStruct* st) {
      gchar* _tmp0_ = NULL;
      gchar* _tmp1_;
      ValaCCodeFunction* _tmp2_ = NULL;
      ValaCCodeFunction* _tmp3_;
      ValaCCodeFunction* function;
      ValaSymbolAccessibility _tmp4_;
      gchar* _tmp5_ = NULL;
      gchar* _tmp6_;
      gchar* _tmp7_;
      gchar* _tmp8_;
      ValaCCodeParameter* _tmp9_ = NULL;
      ValaCCodeParameter* _tmp10_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (st != NULL);
      vala_ccode_base_module_push_context ((ValaCCodeBaseModule*) self, ((ValaCCodeBaseModule*) self)->instance_finalize_context);
      _tmp0_ = vala_typesymbol_get_destroy_function ((ValaTypeSymbol*) st);
      _tmp1_ = _tmp0_;
      _tmp2_ = vala_ccode_function_new (_tmp1_, "void");
      _tmp3_ = _tmp2_;
      _g_free0 (_tmp1_);
      function = _tmp3_;
      _tmp4_ = vala_symbol_get_access ((ValaSymbol*) st);
      if (_tmp4_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
            vala_ccode_function_set_modifiers (function, VALA_CCODE_MODIFIERS_STATIC);
      }
      _tmp5_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE);
      _tmp6_ = _tmp5_;
      _tmp7_ = g_strconcat (_tmp6_, "*", NULL);
      _tmp8_ = _tmp7_;
      _tmp9_ = vala_ccode_parameter_new ("self", _tmp8_);
      _tmp10_ = _tmp9_;
      vala_ccode_function_add_parameter (function, _tmp10_);
      _vala_ccode_node_unref0 (_tmp10_);
      _g_free0 (_tmp8_);
      _g_free0 (_tmp6_);
      vala_ccode_base_module_push_function ((ValaCCodeBaseModule*) self, function);
      vala_ccode_base_module_pop_context ((ValaCCodeBaseModule*) self);
      _vala_ccode_node_unref0 (function);
}


static void vala_ccode_struct_module_add_struct_destroy_function (ValaCCodeStructModule* self, ValaStruct* st) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (st != NULL);
      vala_ccode_file_add_function (((ValaCCodeBaseModule*) self)->cfile, ((ValaCCodeBaseModule*) self)->instance_finalize_context->ccode);
}


ValaCCodeStructModule* vala_ccode_struct_module_construct (GType object_type) {
      ValaCCodeStructModule* self = NULL;
      self = (ValaCCodeStructModule*) vala_ccode_base_module_construct (object_type);
      return self;
}


static void vala_ccode_struct_module_class_init (ValaCCodeStructModuleClass * klass) {
      vala_ccode_struct_module_parent_class = g_type_class_peek_parent (klass);
      VALA_CCODE_BASE_MODULE_CLASS (klass)->generate_struct_declaration = vala_ccode_struct_module_real_generate_struct_declaration;
      VALA_CODE_VISITOR_CLASS (klass)->visit_struct = vala_ccode_struct_module_real_visit_struct;
}


static void vala_ccode_struct_module_instance_init (ValaCCodeStructModule * self) {
}


GType vala_ccode_struct_module_get_type (void) {
      static volatile gsize vala_ccode_struct_module_type_id__volatile = 0;
      if (g_once_init_enter (&vala_ccode_struct_module_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (ValaCCodeStructModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_ccode_struct_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCCodeStructModule), 0, (GInstanceInitFunc) vala_ccode_struct_module_instance_init, NULL };
            GType vala_ccode_struct_module_type_id;
            vala_ccode_struct_module_type_id = g_type_register_static (VALA_TYPE_CCODE_BASE_MODULE, "ValaCCodeStructModule", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
            g_once_init_leave (&vala_ccode_struct_module_type_id__volatile, vala_ccode_struct_module_type_id);
      }
      return vala_ccode_struct_module_type_id__volatile;
}




Generated by  Doxygen 1.6.0   Back to index