1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
|
/* valadovastructmodule.c generated by valac, the Vala compiler
* generated from valadovastructmodule.vala, do not modify */
/* valadovastructmodule.vala
*
* Copyright (C) 2006-2009 Jürg Billeter
*
* 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>
*/
#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <valaccode.h>
#include <stdlib.h>
#include <string.h>
#include <valagee.h>
#define VALA_TYPE_DOVA_BASE_MODULE (vala_dova_base_module_get_type ())
#define VALA_DOVA_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_DOVA_BASE_MODULE, ValaDovaBaseModule))
#define VALA_DOVA_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_DOVA_BASE_MODULE, ValaDovaBaseModuleClass))
#define VALA_IS_DOVA_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_DOVA_BASE_MODULE))
#define VALA_IS_DOVA_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_DOVA_BASE_MODULE))
#define VALA_DOVA_BASE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_DOVA_BASE_MODULE, ValaDovaBaseModuleClass))
typedef struct _ValaDovaBaseModule ValaDovaBaseModule;
typedef struct _ValaDovaBaseModuleClass ValaDovaBaseModuleClass;
typedef struct _ValaDovaBaseModulePrivate ValaDovaBaseModulePrivate;
#define VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT (vala_dova_base_module_emit_context_get_type ())
#define VALA_DOVA_BASE_MODULE_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaDovaBaseModuleEmitContext))
#define VALA_DOVA_BASE_MODULE_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaDovaBaseModuleEmitContextClass))
#define VALA_DOVA_BASE_MODULE_IS_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_DOVA_BASE_MODULE_IS_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_DOVA_BASE_MODULE_EMIT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_DOVA_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaDovaBaseModuleEmitContextClass))
typedef struct _ValaDovaBaseModuleEmitContext ValaDovaBaseModuleEmitContext;
typedef struct _ValaDovaBaseModuleEmitContextClass ValaDovaBaseModuleEmitContextClass;
#define VALA_TYPE_DOVA_STRUCT_MODULE (vala_dova_struct_module_get_type ())
#define VALA_DOVA_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_DOVA_STRUCT_MODULE, ValaDovaStructModule))
#define VALA_DOVA_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_DOVA_STRUCT_MODULE, ValaDovaStructModuleClass))
#define VALA_IS_DOVA_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_DOVA_STRUCT_MODULE))
#define VALA_IS_DOVA_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_DOVA_STRUCT_MODULE))
#define VALA_DOVA_STRUCT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_DOVA_STRUCT_MODULE, ValaDovaStructModuleClass))
typedef struct _ValaDovaStructModule ValaDovaStructModule;
typedef struct _ValaDovaStructModuleClass ValaDovaStructModuleClass;
typedef struct _ValaDovaStructModulePrivate ValaDovaStructModulePrivate;
#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_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_dova_base_module_emit_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_dova_base_module_emit_context_unref (var), NULL)))
struct _ValaDovaBaseModule {
ValaCodeGenerator parent_instance;
ValaDovaBaseModulePrivate * priv;
ValaSymbol* root_symbol;
ValaDovaBaseModuleEmitContext* emit_context;
ValaCCodeFile* header_file;
ValaCCodeFile* cfile;
ValaList* static_fields;
gint next_wrapper_id;
ValaDataType* void_type;
ValaDataType* bool_type;
ValaDataType* char_type;
ValaDataType* int_type;
ValaDataType* uint_type;
ValaDataType* string_type;
ValaClass* object_class;
ValaClass* type_class;
ValaClass* value_class;
ValaClass* string_class;
ValaStruct* array_struct;
ValaClass* delegate_class;
ValaClass* error_class;
};
struct _ValaDovaBaseModuleClass {
ValaCodeGeneratorClass parent_class;
void (*generate_struct_declaration) (ValaDovaBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
void (*generate_delegate_declaration) (ValaDovaBaseModule* self, ValaDelegate* d, ValaCCodeFile* decl_space);
void (*generate_cparameters) (ValaDovaBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaCCodeFunction* func, ValaCCodeFunctionDeclarator* vdeclarator, ValaCCodeFunctionCall* vcall);
void (*generate_property_accessor_declaration) (ValaDovaBaseModule* self, ValaPropertyAccessor* acc, ValaCCodeFile* decl_space);
ValaCCodeExpression* (*get_dup_func_expression) (ValaDovaBaseModule* self, ValaDataType* type, ValaSourceReference* source_reference, gboolean is_chainup);
void (*append_local_free) (ValaDovaBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
ValaCCodeExpression* (*get_ref_cexpression) (ValaDovaBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, ValaCodeNode* node);
void (*generate_class_declaration) (ValaDovaBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
void (*generate_interface_declaration) (ValaDovaBaseModule* self, ValaInterface* iface, ValaCCodeFile* decl_space);
void (*generate_method_declaration) (ValaDovaBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space);
ValaCCodeExpression* (*get_implicit_cast_expression) (ValaDovaBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaExpression* expr);
gchar* (*get_custom_creturn_type) (ValaDovaBaseModule* self, ValaMethod* m);
gboolean (*method_has_wrapper) (ValaDovaBaseModule* self, ValaMethod* method);
void (*add_simple_check) (ValaDovaBaseModule* self, ValaCodeNode* node, gboolean always_fails);
};
struct _ValaDovaStructModule {
ValaDovaBaseModule parent_instance;
ValaDovaStructModulePrivate * priv;
};
struct _ValaDovaStructModuleClass {
ValaDovaBaseModuleClass parent_class;
};
static gpointer vala_dova_struct_module_parent_class = NULL;
GType vala_dova_base_module_get_type (void) G_GNUC_CONST;
gpointer vala_dova_base_module_emit_context_ref (gpointer instance);
void vala_dova_base_module_emit_context_unref (gpointer instance);
GParamSpec* vala_dova_base_module_param_spec_emit_context (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_dova_base_module_value_set_emit_context (GValue* value, gpointer v_object);
void vala_dova_base_module_value_take_emit_context (GValue* value, gpointer v_object);
gpointer vala_dova_base_module_value_get_emit_context (const GValue* value);
GType vala_dova_base_module_emit_context_get_type (void) G_GNUC_CONST;
GType vala_dova_struct_module_get_type (void) G_GNUC_CONST;
enum {
VALA_DOVA_STRUCT_MODULE_DUMMY_PROPERTY
};
static void vala_dova_struct_module_real_generate_struct_declaration (ValaDovaBaseModule* base, ValaStruct* st, ValaCCodeFile* decl_space);
gboolean vala_dova_base_module_add_symbol_declaration (ValaDovaBaseModule* self, ValaCCodeFile* decl_space, ValaSymbol* sym, const gchar* name);
gchar* vala_dova_base_module_get_ccode_name (ValaDovaBaseModule* self, ValaCodeNode* node);
void vala_dova_base_module_generate_struct_declaration (ValaDovaBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
void vala_dova_base_module_generate_type_declaration (ValaDovaBaseModule* self, ValaDataType* type, ValaCCodeFile* decl_space);
gchar* vala_dova_base_module_get_ccode_declarator_suffix (ValaDovaBaseModule* self, ValaDataType* type);
static void vala_dova_struct_module_real_visit_struct (ValaCodeVisitor* base, ValaStruct* st);
void vala_dova_base_module_push_context (ValaDovaBaseModule* self, ValaDovaBaseModuleEmitContext* emit_context);
ValaDovaBaseModuleEmitContext* vala_dova_base_module_emit_context_new (ValaSymbol* symbol);
ValaDovaBaseModuleEmitContext* vala_dova_base_module_emit_context_construct (GType object_type, ValaSymbol* symbol);
void vala_dova_base_module_pop_context (ValaDovaBaseModule* self);
ValaDovaStructModule* vala_dova_struct_module_construct (GType object_type);
ValaDovaBaseModule* vala_dova_base_module_construct (GType object_type);
static void vala_dova_struct_module_real_generate_struct_declaration (ValaDovaBaseModule* base, ValaStruct* st, ValaCCodeFile* decl_space) {
ValaDovaStructModule * self;
ValaCCodeFile* _tmp0_;
ValaStruct* _tmp1_;
ValaStruct* _tmp2_;
gchar* _tmp3_ = NULL;
gchar* _tmp4_;
gboolean _tmp5_ = FALSE;
gboolean _tmp6_;
ValaStruct* _tmp7_;
ValaStruct* _tmp8_;
ValaStruct* _tmp9_;
ValaStruct* _tmp27_;
gboolean _tmp28_ = FALSE;
ValaStruct* _tmp35_;
gchar* _tmp36_ = NULL;
gchar* _tmp37_;
gchar* _tmp38_ = NULL;
gchar* _tmp39_;
ValaCCodeStruct* _tmp40_;
ValaCCodeStruct* _tmp41_;
ValaCCodeStruct* instance_struct;
ValaCCodeFile* _tmp81_;
ValaStruct* _tmp82_;
gchar* _tmp83_ = NULL;
gchar* _tmp84_;
gchar* _tmp85_ = NULL;
gchar* _tmp86_;
ValaStruct* _tmp87_;
gchar* _tmp88_ = NULL;
gchar* _tmp89_;
ValaCCodeVariableDeclarator* _tmp90_;
ValaCCodeVariableDeclarator* _tmp91_;
ValaCCodeTypeDefinition* _tmp92_;
ValaCCodeTypeDefinition* _tmp93_;
ValaCCodeFile* _tmp94_;
ValaCCodeStruct* _tmp95_;
self = (ValaDovaStructModule*) base;
g_return_if_fail (st != NULL);
g_return_if_fail (decl_space != NULL);
_tmp0_ = decl_space;
_tmp1_ = st;
_tmp2_ = st;
_tmp3_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp2_);
_tmp4_ = _tmp3_;
_tmp5_ = vala_dova_base_module_add_symbol_declaration ((ValaDovaBaseModule*) self, _tmp0_, (ValaSymbol*) _tmp1_, _tmp4_);
_tmp6_ = _tmp5_;
_g_free0 (_tmp4_);
if (_tmp6_) {
return;
}
_tmp7_ = st;
_tmp8_ = vala_struct_get_base_struct (_tmp7_);
_tmp9_ = _tmp8_;
if (_tmp9_ != NULL) {
ValaStruct* _tmp10_;
ValaStruct* _tmp11_;
ValaStruct* _tmp12_;
ValaCCodeFile* _tmp13_;
ValaCCodeFile* _tmp14_;
ValaStruct* _tmp15_;
ValaStruct* _tmp16_;
ValaStruct* _tmp17_;
gchar* _tmp18_ = NULL;
gchar* _tmp19_;
ValaStruct* _tmp20_;
gchar* _tmp21_ = NULL;
gchar* _tmp22_;
ValaCCodeVariableDeclarator* _tmp23_;
ValaCCodeVariableDeclarator* _tmp24_;
ValaCCodeTypeDefinition* _tmp25_;
ValaCCodeTypeDefinition* _tmp26_;
_tmp10_ = st;
_tmp11_ = vala_struct_get_base_struct (_tmp10_);
_tmp12_ = _tmp11_;
_tmp13_ = decl_space;
vala_dova_base_module_generate_struct_declaration ((ValaDovaBaseModule*) self, _tmp12_, _tmp13_);
_tmp14_ = decl_space;
_tmp15_ = st;
_tmp16_ = vala_struct_get_base_struct (_tmp15_);
_tmp17_ = _tmp16_;
_tmp18_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp17_);
_tmp19_ = _tmp18_;
_tmp20_ = st;
_tmp21_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp20_);
_tmp22_ = _tmp21_;
_tmp23_ = vala_ccode_variable_declarator_new (_tmp22_, NULL, NULL);
_tmp24_ = _tmp23_;
_tmp25_ = vala_ccode_type_definition_new (_tmp19_, (ValaCCodeDeclarator*) _tmp24_);
_tmp26_ = _tmp25_;
vala_ccode_file_add_type_declaration (_tmp14_, (ValaCCodeNode*) _tmp26_);
_vala_ccode_node_unref0 (_tmp26_);
_vala_ccode_node_unref0 (_tmp24_);
_g_free0 (_tmp22_);
_g_free0 (_tmp19_);
return;
}
_tmp27_ = st;
_tmp28_ = vala_struct_is_boolean_type (_tmp27_);
if (_tmp28_) {
return;
} else {
ValaStruct* _tmp29_;
gboolean _tmp30_ = FALSE;
_tmp29_ = st;
_tmp30_ = vala_struct_is_integer_type (_tmp29_);
if (_tmp30_) {
return;
} else {
ValaStruct* _tmp31_;
gboolean _tmp32_ = FALSE;
_tmp31_ = st;
_tmp32_ = vala_struct_is_decimal_floating_type (_tmp31_);
if (_tmp32_) {
return;
} else {
ValaStruct* _tmp33_;
gboolean _tmp34_ = FALSE;
_tmp33_ = st;
_tmp34_ = vala_struct_is_floating_type (_tmp33_);
if (_tmp34_) {
return;
}
}
}
}
_tmp35_ = st;
_tmp36_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp35_);
_tmp37_ = _tmp36_;
_tmp38_ = g_strdup_printf ("_%s", _tmp37_);
_tmp39_ = _tmp38_;
_tmp40_ = vala_ccode_struct_new (_tmp39_);
_tmp41_ = _tmp40_;
_g_free0 (_tmp39_);
_g_free0 (_tmp37_);
instance_struct = _tmp41_;
{
ValaStruct* _tmp42_;
ValaList* _tmp43_ = NULL;
ValaList* _f_list;
ValaList* _tmp44_;
gint _tmp45_;
gint _tmp46_;
gint _f_size;
gint _f_index;
_tmp42_ = st;
_tmp43_ = vala_struct_get_fields (_tmp42_);
_f_list = _tmp43_;
_tmp44_ = _f_list;
_tmp45_ = vala_collection_get_size ((ValaCollection*) _tmp44_);
_tmp46_ = _tmp45_;
_f_size = _tmp46_;
_f_index = -1;
while (TRUE) {
gint _tmp47_;
gint _tmp48_;
gint _tmp49_;
ValaList* _tmp50_;
gint _tmp51_;
gpointer _tmp52_ = NULL;
ValaField* f;
ValaField* _tmp53_;
ValaDataType* _tmp54_;
ValaDataType* _tmp55_;
gchar* _tmp56_ = NULL;
gchar* field_ctype;
ValaField* _tmp57_;
gboolean _tmp58_;
gboolean _tmp59_;
ValaField* _tmp62_;
ValaMemberBinding _tmp63_;
ValaMemberBinding _tmp64_;
_tmp47_ = _f_index;
_f_index = _tmp47_ + 1;
_tmp48_ = _f_index;
_tmp49_ = _f_size;
if (!(_tmp48_ < _tmp49_)) {
break;
}
_tmp50_ = _f_list;
_tmp51_ = _f_index;
_tmp52_ = vala_list_get (_tmp50_, _tmp51_);
f = (ValaField*) _tmp52_;
_tmp53_ = f;
_tmp54_ = vala_variable_get_variable_type ((ValaVariable*) _tmp53_);
_tmp55_ = _tmp54_;
_tmp56_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp55_);
field_ctype = _tmp56_;
_tmp57_ = f;
_tmp58_ = vala_field_get_is_volatile (_tmp57_);
_tmp59_ = _tmp58_;
if (_tmp59_) {
const gchar* _tmp60_;
gchar* _tmp61_;
_tmp60_ = field_ctype;
_tmp61_ = g_strconcat ("volatile ", _tmp60_, NULL);
_g_free0 (field_ctype);
field_ctype = _tmp61_;
}
_tmp62_ = f;
_tmp63_ = vala_field_get_binding (_tmp62_);
_tmp64_ = _tmp63_;
if (_tmp64_ == VALA_MEMBER_BINDING_INSTANCE) {
ValaField* _tmp65_;
ValaDataType* _tmp66_;
ValaDataType* _tmp67_;
ValaCCodeFile* _tmp68_;
ValaCCodeStruct* _tmp69_;
const gchar* _tmp70_;
ValaField* _tmp71_;
gchar* _tmp72_ = NULL;
gchar* _tmp73_;
ValaField* _tmp74_;
ValaDataType* _tmp75_;
ValaDataType* _tmp76_;
gchar* _tmp77_ = NULL;
gchar* _tmp78_;
gchar* _tmp79_;
gchar* _tmp80_;
_tmp65_ = f;
_tmp66_ = vala_variable_get_variable_type ((ValaVariable*) _tmp65_);
_tmp67_ = _tmp66_;
_tmp68_ = decl_space;
vala_dova_base_module_generate_type_declaration ((ValaDovaBaseModule*) self, _tmp67_, _tmp68_);
_tmp69_ = instance_struct;
_tmp70_ = field_ctype;
_tmp71_ = f;
_tmp72_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp71_);
_tmp73_ = _tmp72_;
_tmp74_ = f;
_tmp75_ = vala_variable_get_variable_type ((ValaVariable*) _tmp74_);
_tmp76_ = _tmp75_;
_tmp77_ = vala_dova_base_module_get_ccode_declarator_suffix ((ValaDovaBaseModule*) self, _tmp76_);
_tmp78_ = _tmp77_;
_tmp79_ = g_strconcat (_tmp73_, _tmp78_, NULL);
_tmp80_ = _tmp79_;
vala_ccode_struct_add_field (_tmp69_, _tmp70_, _tmp80_, NULL);
_g_free0 (_tmp80_);
_g_free0 (_tmp78_);
_g_free0 (_tmp73_);
}
_g_free0 (field_ctype);
_vala_code_node_unref0 (f);
}
_vala_iterable_unref0 (_f_list);
}
_tmp81_ = decl_space;
_tmp82_ = st;
_tmp83_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp82_);
_tmp84_ = _tmp83_;
_tmp85_ = g_strdup_printf ("struct _%s", _tmp84_);
_tmp86_ = _tmp85_;
_tmp87_ = st;
_tmp88_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp87_);
_tmp89_ = _tmp88_;
_tmp90_ = vala_ccode_variable_declarator_new (_tmp89_, NULL, NULL);
_tmp91_ = _tmp90_;
_tmp92_ = vala_ccode_type_definition_new (_tmp86_, (ValaCCodeDeclarator*) _tmp91_);
_tmp93_ = _tmp92_;
vala_ccode_file_add_type_declaration (_tmp81_, (ValaCCodeNode*) _tmp93_);
_vala_ccode_node_unref0 (_tmp93_);
_vala_ccode_node_unref0 (_tmp91_);
_g_free0 (_tmp89_);
_g_free0 (_tmp86_);
_g_free0 (_tmp84_);
_tmp94_ = decl_space;
_tmp95_ = instance_struct;
vala_ccode_file_add_type_definition (_tmp94_, (ValaCCodeNode*) _tmp95_);
_vala_ccode_node_unref0 (instance_struct);
}
static void vala_dova_struct_module_real_visit_struct (ValaCodeVisitor* base, ValaStruct* st) {
ValaDovaStructModule * self;
ValaStruct* _tmp0_;
ValaDovaBaseModuleEmitContext* _tmp1_;
ValaDovaBaseModuleEmitContext* _tmp2_;
ValaStruct* _tmp3_;
ValaCCodeFile* _tmp4_;
ValaStruct* _tmp5_;
gboolean _tmp6_ = FALSE;
ValaStruct* _tmp9_;
self = (ValaDovaStructModule*) base;
g_return_if_fail (st != NULL);
_tmp0_ = st;
_tmp1_ = vala_dova_base_module_emit_context_new ((ValaSymbol*) _tmp0_);
_tmp2_ = _tmp1_;
vala_dova_base_module_push_context ((ValaDovaBaseModule*) self, _tmp2_);
_vala_dova_base_module_emit_context_unref0 (_tmp2_);
_tmp3_ = st;
_tmp4_ = ((ValaDovaBaseModule*) self)->cfile;
vala_dova_base_module_generate_struct_declaration ((ValaDovaBaseModule*) self, _tmp3_, _tmp4_);
_tmp5_ = st;
_tmp6_ = vala_symbol_is_internal_symbol ((ValaSymbol*) _tmp5_);
if (!_tmp6_) {
ValaStruct* _tmp7_;
ValaCCodeFile* _tmp8_;
_tmp7_ = st;
_tmp8_ = ((ValaDovaBaseModule*) self)->header_file;
vala_dova_base_module_generate_struct_declaration ((ValaDovaBaseModule*) self, _tmp7_, _tmp8_);
}
_tmp9_ = st;
vala_code_node_accept_children ((ValaCodeNode*) _tmp9_, (ValaCodeVisitor*) self);
vala_dova_base_module_pop_context ((ValaDovaBaseModule*) self);
}
ValaDovaStructModule* vala_dova_struct_module_construct (GType object_type) {
ValaDovaStructModule* self = NULL;
self = (ValaDovaStructModule*) vala_dova_base_module_construct (object_type);
return self;
}
static void vala_dova_struct_module_class_init (ValaDovaStructModuleClass * klass) {
vala_dova_struct_module_parent_class = g_type_class_peek_parent (klass);
VALA_DOVA_BASE_MODULE_CLASS (klass)->generate_struct_declaration = vala_dova_struct_module_real_generate_struct_declaration;
VALA_CODE_VISITOR_CLASS (klass)->visit_struct = vala_dova_struct_module_real_visit_struct;
}
static void vala_dova_struct_module_instance_init (ValaDovaStructModule * self) {
}
GType vala_dova_struct_module_get_type (void) {
static volatile gsize vala_dova_struct_module_type_id__volatile = 0;
if (g_once_init_enter (&vala_dova_struct_module_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (ValaDovaStructModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_dova_struct_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaDovaStructModule), 0, (GInstanceInitFunc) vala_dova_struct_module_instance_init, NULL };
GType vala_dova_struct_module_type_id;
vala_dova_struct_module_type_id = g_type_register_static (VALA_TYPE_DOVA_BASE_MODULE, "ValaDovaStructModule", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
g_once_init_leave (&vala_dova_struct_module_type_id__volatile, vala_dova_struct_module_type_id);
}
return vala_dova_struct_module_type_id__volatile;
}
|