~ubuntu-branches/ubuntu/raring/vala-0.16/raring

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