1 /* valatyperegisterfunction.c generated by valac, the Vala compiler
2 * generated from valatyperegisterfunction.vala, do not modify */
3
4 /* valatyperegisterfunction.vala
5 *
6 * Copyright (C) 2006-2010 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 "valacodegen.h"
27 #include <valaccode.h>
28 #include <vala.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <glib.h>
32 #include <valagee.h>
33 #include <glib-object.h>
34 #include <gobject/gvaluecollector.h>
35
36 #define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
37 #define _g_free0(var) (var = (g_free (var), NULL))
38 #define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
39 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
40 typedef struct _ValaParamSpecTypeRegisterFunction ValaParamSpecTypeRegisterFunction;
41
42 struct _ValaTypeRegisterFunctionPrivate {
43 ValaCCodeFragment* source_declaration_fragment;
44 ValaCCodeFragment* declaration_fragment;
45 ValaCCodeFragment* definition_fragment;
46 };
47
48 struct _ValaParamSpecTypeRegisterFunction {
49 GParamSpec parent_instance;
50 };
51
52 static gint ValaTypeRegisterFunction_private_offset;
53 static gpointer vala_typeregister_function_parent_class = NULL;
54
55 static ValaTypeSymbol* vala_typeregister_function_real_get_type_declaration (ValaTypeRegisterFunction* self);
56 static gchar* vala_typeregister_function_real_get_type_struct_name (ValaTypeRegisterFunction* self);
57 static gchar* vala_typeregister_function_real_get_base_init_func_name (ValaTypeRegisterFunction* self);
58 static gchar* vala_typeregister_function_real_get_class_finalize_func_name (ValaTypeRegisterFunction* self);
59 static gchar* vala_typeregister_function_real_get_base_finalize_func_name (ValaTypeRegisterFunction* self);
60 static gchar* vala_typeregister_function_real_get_class_init_func_name (ValaTypeRegisterFunction* self);
61 static gchar* vala_typeregister_function_real_get_instance_struct_size (ValaTypeRegisterFunction* self);
62 static gchar* vala_typeregister_function_real_get_instance_init_func_name (ValaTypeRegisterFunction* self);
63 static gchar* vala_typeregister_function_real_get_parent_type_name (ValaTypeRegisterFunction* self);
64 static gchar* vala_typeregister_function_real_get_gtype_value_table_init_function_name (ValaTypeRegisterFunction* self);
65 static gchar* vala_typeregister_function_real_get_gtype_value_table_peek_pointer_function_name (ValaTypeRegisterFunction* self);
66 static gchar* vala_typeregister_function_real_get_gtype_value_table_free_function_name (ValaTypeRegisterFunction* self);
67 static gchar* vala_typeregister_function_real_get_gtype_value_table_copy_function_name (ValaTypeRegisterFunction* self);
68 static gchar* vala_typeregister_function_real_get_gtype_value_table_lcopy_value_function_name (ValaTypeRegisterFunction* self);
69 static gchar* vala_typeregister_function_real_get_gtype_value_table_collect_value_function_name (ValaTypeRegisterFunction* self);
70 static gchar* vala_typeregister_function_real_get_type_flags (ValaTypeRegisterFunction* self);
71 static ValaCCodeFragment* vala_typeregister_function_real_get_type_interface_init_declaration (ValaTypeRegisterFunction* self);
72 static void vala_typeregister_function_real_get_type_interface_init_statements (ValaTypeRegisterFunction* self,
73 ValaCodeContext* context,
74 ValaCCodeBlock* block,
75 gboolean plugin);
76 static ValaSymbolAccessibility vala_typeregister_function_real_get_accessibility (ValaTypeRegisterFunction* self);
77 static void vala_typeregister_function_finalize (ValaTypeRegisterFunction * obj);
78 static GType vala_typeregister_function_get_type_once (void);
79
80 static inline gpointer
vala_typeregister_function_get_instance_private(ValaTypeRegisterFunction * self)81 vala_typeregister_function_get_instance_private (ValaTypeRegisterFunction* self)
82 {
83 return G_STRUCT_MEMBER_P (self, ValaTypeRegisterFunction_private_offset);
84 }
85
86 /**
87 * Constructs the C function from the specified type.
88 */
89 static gpointer
_vala_code_node_ref0(gpointer self)90 _vala_code_node_ref0 (gpointer self)
91 {
92 return self ? vala_code_node_ref (self) : NULL;
93 }
94
95 static gpointer
_vala_iterable_ref0(gpointer self)96 _vala_iterable_ref0 (gpointer self)
97 {
98 return self ? vala_iterable_ref (self) : NULL;
99 }
100
101 static gpointer
_vala_ccode_node_ref0(gpointer self)102 _vala_ccode_node_ref0 (gpointer self)
103 {
104 return self ? vala_ccode_node_ref (self) : NULL;
105 }
106
107 void
vala_typeregister_function_init_from_type(ValaTypeRegisterFunction * self,ValaCodeContext * context,gboolean plugin,gboolean declaration_only)108 vala_typeregister_function_init_from_type (ValaTypeRegisterFunction* self,
109 ValaCodeContext* context,
110 gboolean plugin,
111 gboolean declaration_only)
112 {
113 ValaTypeSymbol* type_symbol = NULL;
114 ValaTypeSymbol* _tmp0_;
115 gboolean fundamental = FALSE;
116 ValaClass* cl = NULL;
117 ValaTypeSymbol* _tmp1_;
118 gboolean _tmp2_ = FALSE;
119 gboolean _tmp3_ = FALSE;
120 ValaClass* _tmp4_;
121 gchar* type_id_name = NULL;
122 ValaTypeSymbol* _tmp11_;
123 gchar* _tmp12_;
124 gchar* _tmp13_;
125 gchar* _tmp14_;
126 gchar* _tmp15_;
127 ValaCCodeBlock* type_block = NULL;
128 ValaCCodeBlock* _tmp16_;
129 ValaCCodeBlock* type_once_block = NULL;
130 ValaCCodeBlock* _tmp17_;
131 ValaCCodeDeclaration* _cdecl_ = NULL;
132 ValaCCodeFunction* fun = NULL;
133 ValaCCodeFunction* fun_once = NULL;
134 gchar* type_value_table_decl_name = NULL;
135 ValaCCodeBlock* type_init = NULL;
136 ValaCCodeBlock* _tmp119_;
137 ValaTypeSymbol* _tmp145_;
138 ValaCCodeBlock* _tmp182_;
139 ValaCCodeFragment* _tmp183_;
140 ValaCCodeFragment* _tmp184_;
141 ValaCCodeFunctionCall* reg_call = NULL;
142 ValaTypeSymbol* _tmp185_;
143 ValaCCodeFunctionCall* _tmp227_;
144 ValaTypeSymbol* _tmp228_;
145 gchar* _tmp229_;
146 gchar* _tmp230_;
147 gchar* _tmp231_;
148 gchar* _tmp232_;
149 ValaCCodeConstant* _tmp233_;
150 ValaCCodeConstant* _tmp234_;
151 ValaTypeSymbol* _tmp235_;
152 ValaCCodeBlock* once_call_block = NULL;
153 ValaCCodeBlock* _tmp330_;
154 gboolean _tmp362_ = FALSE;
155 ValaClass* _tmp363_;
156 gboolean _tmp387_ = FALSE;
157 ValaClass* _tmp388_;
158 ValaCCodeFunction* _tmp507_;
159 ValaCCodeBlock* _tmp508_;
160 ValaCCodeFragment* _tmp509_;
161 ValaCCodeFunction* _tmp510_;
162 g_return_if_fail (self != NULL);
163 g_return_if_fail (context != NULL);
164 _tmp0_ = vala_typeregister_function_get_type_declaration (self);
165 type_symbol = _tmp0_;
166 fundamental = FALSE;
167 _tmp1_ = type_symbol;
168 cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_CLASS) ? ((ValaClass*) _tmp1_) : NULL;
169 _tmp4_ = cl;
170 if (_tmp4_ != NULL) {
171 ValaClass* _tmp5_;
172 gboolean _tmp6_;
173 gboolean _tmp7_;
174 _tmp5_ = cl;
175 _tmp6_ = vala_class_get_is_compact (_tmp5_);
176 _tmp7_ = _tmp6_;
177 _tmp3_ = !_tmp7_;
178 } else {
179 _tmp3_ = FALSE;
180 }
181 if (_tmp3_) {
182 ValaClass* _tmp8_;
183 ValaClass* _tmp9_;
184 ValaClass* _tmp10_;
185 _tmp8_ = cl;
186 _tmp9_ = vala_class_get_base_class (_tmp8_);
187 _tmp10_ = _tmp9_;
188 _tmp2_ = _tmp10_ == NULL;
189 } else {
190 _tmp2_ = FALSE;
191 }
192 if (_tmp2_) {
193 fundamental = TRUE;
194 }
195 _tmp11_ = type_symbol;
196 _tmp12_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp11_, NULL);
197 _tmp13_ = _tmp12_;
198 _tmp14_ = g_strdup_printf ("%s_type_id", _tmp13_);
199 _tmp15_ = _tmp14_;
200 _g_free0 (_tmp13_);
201 type_id_name = _tmp15_;
202 _tmp16_ = vala_ccode_block_new ();
203 type_block = _tmp16_;
204 _tmp17_ = vala_ccode_block_new ();
205 type_once_block = _tmp17_;
206 if (!plugin) {
207 ValaCCodeDeclaration* _tmp18_;
208 ValaCCodeDeclaration* _tmp19_;
209 const gchar* _tmp20_;
210 gchar* _tmp21_;
211 gchar* _tmp22_;
212 ValaCCodeConstant* _tmp23_;
213 ValaCCodeConstant* _tmp24_;
214 ValaCCodeVariableDeclarator* _tmp25_;
215 ValaCCodeVariableDeclarator* _tmp26_;
216 ValaCCodeDeclaration* _tmp27_;
217 ValaCCodeBlock* _tmp28_;
218 ValaCCodeDeclaration* _tmp29_;
219 _tmp18_ = vala_ccode_declaration_new ("gsize");
220 _vala_ccode_node_unref0 (_cdecl_);
221 _cdecl_ = _tmp18_;
222 _tmp19_ = _cdecl_;
223 _tmp20_ = type_id_name;
224 _tmp21_ = g_strconcat (_tmp20_, "__volatile", NULL);
225 _tmp22_ = _tmp21_;
226 _tmp23_ = vala_ccode_constant_new ("0");
227 _tmp24_ = _tmp23_;
228 _tmp25_ = vala_ccode_variable_declarator_new (_tmp22_, (ValaCCodeExpression*) _tmp24_, NULL);
229 _tmp26_ = _tmp25_;
230 vala_ccode_declaration_add_declarator (_tmp19_, (ValaCCodeDeclarator*) _tmp26_);
231 _vala_ccode_node_unref0 (_tmp26_);
232 _vala_ccode_node_unref0 (_tmp24_);
233 _g_free0 (_tmp22_);
234 _tmp27_ = _cdecl_;
235 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp27_, VALA_CCODE_MODIFIERS_STATIC | VALA_CCODE_MODIFIERS_VOLATILE);
236 _tmp28_ = type_block;
237 _tmp29_ = _cdecl_;
238 vala_ccode_block_add_statement (_tmp28_, (ValaCCodeNode*) _tmp29_);
239 } else {
240 ValaCCodeDeclaration* _tmp30_;
241 ValaCCodeDeclaration* _tmp31_;
242 const gchar* _tmp32_;
243 ValaCCodeConstant* _tmp33_;
244 ValaCCodeConstant* _tmp34_;
245 ValaCCodeVariableDeclarator* _tmp35_;
246 ValaCCodeVariableDeclarator* _tmp36_;
247 ValaCCodeDeclaration* _tmp37_;
248 ValaCCodeFragment* _tmp38_;
249 ValaCCodeDeclaration* _tmp39_;
250 _tmp30_ = vala_ccode_declaration_new ("GType");
251 _vala_ccode_node_unref0 (_cdecl_);
252 _cdecl_ = _tmp30_;
253 _tmp31_ = _cdecl_;
254 _tmp32_ = type_id_name;
255 _tmp33_ = vala_ccode_constant_new ("0");
256 _tmp34_ = _tmp33_;
257 _tmp35_ = vala_ccode_variable_declarator_new (_tmp32_, (ValaCCodeExpression*) _tmp34_, NULL);
258 _tmp36_ = _tmp35_;
259 vala_ccode_declaration_add_declarator (_tmp31_, (ValaCCodeDeclarator*) _tmp36_);
260 _vala_ccode_node_unref0 (_tmp36_);
261 _vala_ccode_node_unref0 (_tmp34_);
262 _tmp37_ = _cdecl_;
263 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp37_, VALA_CCODE_MODIFIERS_STATIC);
264 _tmp38_ = self->priv->source_declaration_fragment;
265 _tmp39_ = _cdecl_;
266 vala_ccode_fragment_append (_tmp38_, (ValaCCodeNode*) _tmp39_);
267 }
268 fun_once = NULL;
269 if (!plugin) {
270 ValaTypeSymbol* _tmp40_;
271 gchar* _tmp41_;
272 gchar* _tmp42_;
273 ValaCCodeFunction* _tmp43_;
274 ValaCCodeFunction* _tmp44_;
275 ValaCCodeFunction* _tmp56_;
276 ValaCCodeFragment* _tmp57_;
277 ValaCCodeFunction* _tmp58_;
278 ValaCCodeFunction* _tmp59_;
279 ValaCCodeFunction* _tmp60_;
280 ValaCCodeFunction* _tmp61_;
281 ValaCCodeFunction* _tmp62_;
282 const gchar* _tmp63_;
283 const gchar* _tmp64_;
284 gchar* _tmp65_;
285 gchar* _tmp66_;
286 ValaCCodeFunction* _tmp67_;
287 ValaCCodeFunction* _tmp68_;
288 ValaCCodeFunction* _tmp73_;
289 ValaCCodeFragment* _tmp74_;
290 ValaCCodeFunction* _tmp75_;
291 ValaCCodeFunction* _tmp76_;
292 ValaCCodeFunction* _tmp77_;
293 ValaCCodeFunction* _tmp78_;
294 _tmp40_ = type_symbol;
295 _tmp41_ = vala_get_ccode_type_function (_tmp40_);
296 _tmp42_ = _tmp41_;
297 _tmp43_ = vala_ccode_function_new (_tmp42_, "GType");
298 _vala_ccode_node_unref0 (fun);
299 fun = _tmp43_;
300 _g_free0 (_tmp42_);
301 _tmp44_ = fun;
302 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp44_, VALA_CCODE_MODIFIERS_CONST);
303 if (vala_typeregister_function_get_accessibility (self) == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
304 ValaCCodeFunction* _tmp45_;
305 ValaCCodeFunction* _tmp46_;
306 ValaCCodeModifiers _tmp47_;
307 ValaCCodeModifiers _tmp48_;
308 _tmp45_ = fun;
309 _tmp46_ = fun;
310 _tmp47_ = vala_ccode_node_get_modifiers ((ValaCCodeNode*) _tmp46_);
311 _tmp48_ = _tmp47_;
312 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp46_, _tmp48_ | (VALA_CCODE_MODIFIERS_STATIC | VALA_CCODE_MODIFIERS_UNUSED));
313 } else {
314 gboolean _tmp49_ = FALSE;
315 gboolean _tmp50_;
316 gboolean _tmp51_;
317 _tmp50_ = vala_code_context_get_hide_internal (context);
318 _tmp51_ = _tmp50_;
319 if (_tmp51_) {
320 _tmp49_ = vala_typeregister_function_get_accessibility (self) == VALA_SYMBOL_ACCESSIBILITY_INTERNAL;
321 } else {
322 _tmp49_ = FALSE;
323 }
324 if (_tmp49_) {
325 ValaCCodeFunction* _tmp52_;
326 ValaCCodeFunction* _tmp53_;
327 ValaCCodeModifiers _tmp54_;
328 ValaCCodeModifiers _tmp55_;
329 _tmp52_ = fun;
330 _tmp53_ = fun;
331 _tmp54_ = vala_ccode_node_get_modifiers ((ValaCCodeNode*) _tmp53_);
332 _tmp55_ = _tmp54_;
333 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp53_, _tmp55_ | (VALA_CCODE_MODIFIERS_INTERNAL | VALA_CCODE_MODIFIERS_UNUSED));
334 }
335 }
336 _tmp56_ = fun;
337 vala_ccode_function_set_is_declaration (_tmp56_, TRUE);
338 _tmp57_ = self->priv->declaration_fragment;
339 _tmp58_ = fun;
340 _tmp59_ = vala_ccode_function_copy (_tmp58_);
341 _tmp60_ = _tmp59_;
342 vala_ccode_fragment_append (_tmp57_, (ValaCCodeNode*) _tmp60_);
343 _vala_ccode_node_unref0 (_tmp60_);
344 _tmp61_ = fun;
345 vala_ccode_function_set_is_declaration (_tmp61_, FALSE);
346 _tmp62_ = fun;
347 _tmp63_ = vala_ccode_function_get_name (_tmp62_);
348 _tmp64_ = _tmp63_;
349 _tmp65_ = g_strdup_printf ("%s_once", _tmp64_);
350 _tmp66_ = _tmp65_;
351 _tmp67_ = vala_ccode_function_new (_tmp66_, "GType");
352 _vala_ccode_node_unref0 (fun_once);
353 fun_once = _tmp67_;
354 _g_free0 (_tmp66_);
355 _tmp68_ = fun_once;
356 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp68_, VALA_CCODE_MODIFIERS_STATIC);
357 if (vala_code_context_require_glib_version (context, 2, 58)) {
358 ValaCCodeFunction* _tmp69_;
359 ValaCCodeFunction* _tmp70_;
360 ValaCCodeModifiers _tmp71_;
361 ValaCCodeModifiers _tmp72_;
362 _tmp69_ = fun_once;
363 _tmp70_ = fun_once;
364 _tmp71_ = vala_ccode_node_get_modifiers ((ValaCCodeNode*) _tmp70_);
365 _tmp72_ = _tmp71_;
366 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp70_, _tmp72_ | VALA_CCODE_MODIFIERS_NO_INLINE);
367 }
368 _tmp73_ = fun_once;
369 vala_ccode_function_set_is_declaration (_tmp73_, TRUE);
370 _tmp74_ = self->priv->source_declaration_fragment;
371 _tmp75_ = fun_once;
372 _tmp76_ = vala_ccode_function_copy (_tmp75_);
373 _tmp77_ = _tmp76_;
374 vala_ccode_fragment_append (_tmp74_, (ValaCCodeNode*) _tmp77_);
375 _vala_ccode_node_unref0 (_tmp77_);
376 _tmp78_ = fun_once;
377 vala_ccode_function_set_is_declaration (_tmp78_, FALSE);
378 } else {
379 ValaTypeSymbol* _tmp79_;
380 gchar* _tmp80_;
381 gchar* _tmp81_;
382 gchar* _tmp82_;
383 gchar* _tmp83_;
384 ValaCCodeFunction* _tmp84_;
385 ValaCCodeFunction* _tmp85_;
386 ValaCCodeParameter* _tmp86_;
387 ValaCCodeParameter* _tmp87_;
388 ValaCCodeFunction* _tmp88_;
389 ValaCCodeFragment* _tmp89_;
390 ValaCCodeFunction* _tmp90_;
391 ValaCCodeFunction* _tmp91_;
392 ValaCCodeFunction* _tmp92_;
393 ValaCCodeFunction* _tmp93_;
394 ValaCCodeFunction* get_fun = NULL;
395 ValaTypeSymbol* _tmp94_;
396 gchar* _tmp95_;
397 gchar* _tmp96_;
398 ValaCCodeFunction* _tmp97_;
399 ValaCCodeFunction* _tmp98_;
400 ValaCCodeFunction* _tmp99_;
401 ValaCCodeFunction* _tmp100_;
402 ValaCCodeFragment* _tmp101_;
403 ValaCCodeFunction* _tmp102_;
404 ValaCCodeFunction* _tmp103_;
405 ValaCCodeFunction* _tmp104_;
406 ValaCCodeFunction* _tmp105_;
407 ValaCCodeFunction* _tmp106_;
408 ValaCCodeBlock* _tmp107_;
409 ValaCCodeBlock* _tmp108_;
410 ValaCCodeFunction* _tmp109_;
411 ValaCCodeBlock* _tmp110_;
412 ValaCCodeBlock* _tmp111_;
413 const gchar* _tmp112_;
414 ValaCCodeIdentifier* _tmp113_;
415 ValaCCodeIdentifier* _tmp114_;
416 ValaCCodeReturnStatement* _tmp115_;
417 ValaCCodeReturnStatement* _tmp116_;
418 ValaCCodeFragment* _tmp117_;
419 ValaCCodeFunction* _tmp118_;
420 _tmp79_ = type_symbol;
421 _tmp80_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp79_, NULL);
422 _tmp81_ = _tmp80_;
423 _tmp82_ = g_strdup_printf ("%s_register_type", _tmp81_);
424 _tmp83_ = _tmp82_;
425 _tmp84_ = vala_ccode_function_new (_tmp83_, "GType");
426 _vala_ccode_node_unref0 (fun);
427 fun = _tmp84_;
428 _g_free0 (_tmp83_);
429 _g_free0 (_tmp81_);
430 _tmp85_ = fun;
431 _tmp86_ = vala_ccode_parameter_new ("module", "GTypeModule *");
432 _tmp87_ = _tmp86_;
433 vala_ccode_function_add_parameter (_tmp85_, _tmp87_);
434 _vala_ccode_node_unref0 (_tmp87_);
435 _tmp88_ = fun;
436 vala_ccode_function_set_is_declaration (_tmp88_, TRUE);
437 _tmp89_ = self->priv->declaration_fragment;
438 _tmp90_ = fun;
439 _tmp91_ = vala_ccode_function_copy (_tmp90_);
440 _tmp92_ = _tmp91_;
441 vala_ccode_fragment_append (_tmp89_, (ValaCCodeNode*) _tmp92_);
442 _vala_ccode_node_unref0 (_tmp92_);
443 _tmp93_ = fun;
444 vala_ccode_function_set_is_declaration (_tmp93_, FALSE);
445 _tmp94_ = type_symbol;
446 _tmp95_ = vala_get_ccode_type_function (_tmp94_);
447 _tmp96_ = _tmp95_;
448 _tmp97_ = vala_ccode_function_new (_tmp96_, "GType");
449 _tmp98_ = _tmp97_;
450 _g_free0 (_tmp96_);
451 get_fun = _tmp98_;
452 _tmp99_ = get_fun;
453 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp99_, VALA_CCODE_MODIFIERS_CONST);
454 _tmp100_ = get_fun;
455 vala_ccode_function_set_is_declaration (_tmp100_, TRUE);
456 _tmp101_ = self->priv->declaration_fragment;
457 _tmp102_ = get_fun;
458 _tmp103_ = vala_ccode_function_copy (_tmp102_);
459 _tmp104_ = _tmp103_;
460 vala_ccode_fragment_append (_tmp101_, (ValaCCodeNode*) _tmp104_);
461 _vala_ccode_node_unref0 (_tmp104_);
462 _tmp105_ = get_fun;
463 vala_ccode_function_set_is_declaration (_tmp105_, FALSE);
464 _tmp106_ = get_fun;
465 _tmp107_ = vala_ccode_block_new ();
466 _tmp108_ = _tmp107_;
467 vala_ccode_function_set_block (_tmp106_, _tmp108_);
468 _vala_ccode_node_unref0 (_tmp108_);
469 _tmp109_ = get_fun;
470 _tmp110_ = vala_ccode_function_get_block (_tmp109_);
471 _tmp111_ = _tmp110_;
472 _tmp112_ = type_id_name;
473 _tmp113_ = vala_ccode_identifier_new (_tmp112_);
474 _tmp114_ = _tmp113_;
475 _tmp115_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) _tmp114_);
476 _tmp116_ = _tmp115_;
477 vala_ccode_block_add_statement (_tmp111_, (ValaCCodeNode*) _tmp116_);
478 _vala_ccode_node_unref0 (_tmp116_);
479 _vala_ccode_node_unref0 (_tmp114_);
480 _tmp117_ = self->priv->definition_fragment;
481 _tmp118_ = get_fun;
482 vala_ccode_fragment_append (_tmp117_, (ValaCCodeNode*) _tmp118_);
483 _vala_ccode_node_unref0 (get_fun);
484 }
485 type_value_table_decl_name = NULL;
486 _tmp119_ = vala_ccode_block_new ();
487 type_init = _tmp119_;
488 if (fundamental) {
489 ValaCCodeDeclaration* cgtypetabledecl = NULL;
490 ValaCCodeDeclaration* _tmp120_;
491 ValaCCodeDeclaration* _tmp121_;
492 ValaCCodeDeclaration* _tmp122_;
493 gchar* _tmp123_;
494 gchar* _tmp124_;
495 gchar* _tmp125_;
496 gchar* _tmp126_;
497 gchar* _tmp127_;
498 gchar* _tmp128_;
499 gchar* _tmp129_;
500 gchar* _tmp130_;
501 gchar* _tmp131_;
502 gchar* _tmp132_;
503 gchar* _tmp133_;
504 gchar* _tmp134_;
505 gchar* _tmp135_;
506 gchar* _tmp136_;
507 ValaCCodeConstant* _tmp137_;
508 ValaCCodeConstant* _tmp138_;
509 ValaCCodeVariableDeclarator* _tmp139_;
510 ValaCCodeVariableDeclarator* _tmp140_;
511 gchar* _tmp141_;
512 ValaCCodeBlock* _tmp142_;
513 ValaCCodeDeclaration* _tmp143_;
514 _tmp120_ = vala_ccode_declaration_new ("const GTypeValueTable");
515 cgtypetabledecl = _tmp120_;
516 _tmp121_ = cgtypetabledecl;
517 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp121_, VALA_CCODE_MODIFIERS_STATIC);
518 _tmp122_ = cgtypetabledecl;
519 _tmp123_ = vala_typeregister_function_get_gtype_value_table_init_function_name (self);
520 _tmp124_ = _tmp123_;
521 _tmp125_ = vala_typeregister_function_get_gtype_value_table_free_function_name (self);
522 _tmp126_ = _tmp125_;
523 _tmp127_ = vala_typeregister_function_get_gtype_value_table_copy_function_name (self);
524 _tmp128_ = _tmp127_;
525 _tmp129_ = vala_typeregister_function_get_gtype_value_table_peek_pointer_function_name (self);
526 _tmp130_ = _tmp129_;
527 _tmp131_ = vala_typeregister_function_get_gtype_value_table_collect_value_function_name (self);
528 _tmp132_ = _tmp131_;
529 _tmp133_ = vala_typeregister_function_get_gtype_value_table_lcopy_value_function_name (self);
530 _tmp134_ = _tmp133_;
531 _tmp135_ = g_strdup_printf ("{ %s, %s, %s, %s, \"p\", %s, \"p\", %s }", _tmp124_, _tmp126_, _tmp128_, _tmp130_, _tmp132_, _tmp134_);
532 _tmp136_ = _tmp135_;
533 _tmp137_ = vala_ccode_constant_new (_tmp136_);
534 _tmp138_ = _tmp137_;
535 _tmp139_ = vala_ccode_variable_declarator_new ("g_define_type_value_table", (ValaCCodeExpression*) _tmp138_, NULL);
536 _tmp140_ = _tmp139_;
537 vala_ccode_declaration_add_declarator (_tmp122_, (ValaCCodeDeclarator*) _tmp140_);
538 _vala_ccode_node_unref0 (_tmp140_);
539 _vala_ccode_node_unref0 (_tmp138_);
540 _g_free0 (_tmp136_);
541 _g_free0 (_tmp134_);
542 _g_free0 (_tmp132_);
543 _g_free0 (_tmp130_);
544 _g_free0 (_tmp128_);
545 _g_free0 (_tmp126_);
546 _g_free0 (_tmp124_);
547 _tmp141_ = g_strdup ("&g_define_type_value_table");
548 _g_free0 (type_value_table_decl_name);
549 type_value_table_decl_name = _tmp141_;
550 _tmp142_ = type_init;
551 _tmp143_ = cgtypetabledecl;
552 vala_ccode_block_add_statement (_tmp142_, (ValaCCodeNode*) _tmp143_);
553 _vala_ccode_node_unref0 (cgtypetabledecl);
554 } else {
555 gchar* _tmp144_;
556 _tmp144_ = g_strdup ("NULL");
557 _g_free0 (type_value_table_decl_name);
558 type_value_table_decl_name = _tmp144_;
559 }
560 _tmp145_ = type_symbol;
561 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp145_, VALA_TYPE_OBJECT_TYPE_SYMBOL)) {
562 ValaCCodeDeclaration* ctypedecl = NULL;
563 ValaCCodeDeclaration* _tmp146_;
564 ValaCCodeDeclaration* _tmp147_;
565 gchar* _tmp148_ = NULL;
566 ValaCCodeDeclaration* _tmp151_;
567 gchar* _tmp152_;
568 gchar* _tmp153_;
569 gchar* _tmp154_;
570 gchar* _tmp155_;
571 gchar* _tmp156_;
572 gchar* _tmp157_;
573 gchar* _tmp158_;
574 gchar* _tmp159_;
575 gchar* _tmp160_;
576 gchar* _tmp161_;
577 gchar* _tmp162_;
578 gchar* _tmp163_;
579 const gchar* _tmp164_;
580 gchar* _tmp165_;
581 gchar* _tmp166_;
582 ValaCCodeConstant* _tmp167_;
583 ValaCCodeConstant* _tmp168_;
584 ValaCCodeVariableDeclarator* _tmp169_;
585 ValaCCodeVariableDeclarator* _tmp170_;
586 ValaCCodeBlock* _tmp171_;
587 ValaCCodeDeclaration* _tmp172_;
588 _tmp146_ = vala_ccode_declaration_new ("const GTypeInfo");
589 ctypedecl = _tmp146_;
590 _tmp147_ = ctypedecl;
591 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp147_, VALA_CCODE_MODIFIERS_STATIC);
592 if (plugin) {
593 gchar* _tmp149_;
594 _tmp149_ = vala_typeregister_function_get_base_finalize_func_name (self);
595 _g_free0 (_tmp148_);
596 _tmp148_ = _tmp149_;
597 } else {
598 gchar* _tmp150_;
599 _tmp150_ = g_strdup ("NULL");
600 _g_free0 (_tmp148_);
601 _tmp148_ = _tmp150_;
602 }
603 _tmp151_ = ctypedecl;
604 _tmp152_ = vala_typeregister_function_get_type_struct_name (self);
605 _tmp153_ = _tmp152_;
606 _tmp154_ = vala_typeregister_function_get_base_init_func_name (self);
607 _tmp155_ = _tmp154_;
608 _tmp156_ = vala_typeregister_function_get_class_init_func_name (self);
609 _tmp157_ = _tmp156_;
610 _tmp158_ = vala_typeregister_function_get_class_finalize_func_name (self);
611 _tmp159_ = _tmp158_;
612 _tmp160_ = vala_typeregister_function_get_instance_struct_size (self);
613 _tmp161_ = _tmp160_;
614 _tmp162_ = vala_typeregister_function_get_instance_init_func_name (self);
615 _tmp163_ = _tmp162_;
616 _tmp164_ = type_value_table_decl_name;
617 _tmp165_ = g_strdup_printf ("{ sizeof (%s), (GBaseInitFunc) %s, (GBaseFinalizeFunc) %s, (GClassInit" \
618 "Func) %s, (GClassFinalizeFunc) %s, NULL, %s, 0, (GInstanceInitFunc) %s" \
619 ", %s }", _tmp153_, _tmp155_, _tmp148_, _tmp157_, _tmp159_, _tmp161_, _tmp163_, _tmp164_);
620 _tmp166_ = _tmp165_;
621 _tmp167_ = vala_ccode_constant_new (_tmp166_);
622 _tmp168_ = _tmp167_;
623 _tmp169_ = vala_ccode_variable_declarator_new ("g_define_type_info", (ValaCCodeExpression*) _tmp168_, NULL);
624 _tmp170_ = _tmp169_;
625 vala_ccode_declaration_add_declarator (_tmp151_, (ValaCCodeDeclarator*) _tmp170_);
626 _vala_ccode_node_unref0 (_tmp170_);
627 _vala_ccode_node_unref0 (_tmp168_);
628 _g_free0 (_tmp166_);
629 _g_free0 (_tmp163_);
630 _g_free0 (_tmp161_);
631 _g_free0 (_tmp159_);
632 _g_free0 (_tmp157_);
633 _g_free0 (_tmp155_);
634 _g_free0 (_tmp153_);
635 _tmp171_ = type_init;
636 _tmp172_ = ctypedecl;
637 vala_ccode_block_add_statement (_tmp171_, (ValaCCodeNode*) _tmp172_);
638 if (fundamental) {
639 ValaCCodeDeclaration* ctypefundamentaldecl = NULL;
640 ValaCCodeDeclaration* _tmp173_;
641 ValaCCodeDeclaration* _tmp174_;
642 ValaCCodeDeclaration* _tmp175_;
643 ValaCCodeConstant* _tmp176_;
644 ValaCCodeConstant* _tmp177_;
645 ValaCCodeVariableDeclarator* _tmp178_;
646 ValaCCodeVariableDeclarator* _tmp179_;
647 ValaCCodeBlock* _tmp180_;
648 ValaCCodeDeclaration* _tmp181_;
649 _tmp173_ = vala_ccode_declaration_new ("const GTypeFundamentalInfo");
650 ctypefundamentaldecl = _tmp173_;
651 _tmp174_ = ctypefundamentaldecl;
652 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp174_, VALA_CCODE_MODIFIERS_STATIC);
653 _tmp175_ = ctypefundamentaldecl;
654 _tmp176_ = vala_ccode_constant_new ("{ (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERI" \
655 "VABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }");
656 _tmp177_ = _tmp176_;
657 _tmp178_ = vala_ccode_variable_declarator_new ("g_define_type_fundamental_info", (ValaCCodeExpression*) _tmp177_, NULL);
658 _tmp179_ = _tmp178_;
659 vala_ccode_declaration_add_declarator (_tmp175_, (ValaCCodeDeclarator*) _tmp179_);
660 _vala_ccode_node_unref0 (_tmp179_);
661 _vala_ccode_node_unref0 (_tmp177_);
662 _tmp180_ = type_init;
663 _tmp181_ = ctypefundamentaldecl;
664 vala_ccode_block_add_statement (_tmp180_, (ValaCCodeNode*) _tmp181_);
665 _vala_ccode_node_unref0 (ctypefundamentaldecl);
666 }
667 _g_free0 (_tmp148_);
668 _vala_ccode_node_unref0 (ctypedecl);
669 }
670 _tmp182_ = type_init;
671 _tmp183_ = vala_typeregister_function_get_type_interface_init_declaration (self);
672 _tmp184_ = _tmp183_;
673 vala_ccode_block_add_statement (_tmp182_, (ValaCCodeNode*) _tmp184_);
674 _vala_ccode_node_unref0 (_tmp184_);
675 _tmp185_ = type_symbol;
676 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp185_, VALA_TYPE_STRUCT)) {
677 ValaCCodeIdentifier* _tmp186_;
678 ValaCCodeIdentifier* _tmp187_;
679 ValaCCodeFunctionCall* _tmp188_;
680 _tmp186_ = vala_ccode_identifier_new ("g_boxed_type_register_static");
681 _tmp187_ = _tmp186_;
682 _tmp188_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp187_);
683 _vala_ccode_node_unref0 (reg_call);
684 reg_call = _tmp188_;
685 _vala_ccode_node_unref0 (_tmp187_);
686 } else {
687 ValaTypeSymbol* _tmp189_;
688 _tmp189_ = type_symbol;
689 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp189_, VALA_TYPE_ENUM)) {
690 ValaEnum* en = NULL;
691 ValaTypeSymbol* _tmp190_;
692 ValaEnum* _tmp191_;
693 gboolean _tmp192_;
694 gboolean _tmp193_;
695 _tmp190_ = type_symbol;
696 en = G_TYPE_CHECK_INSTANCE_CAST (_tmp190_, VALA_TYPE_ENUM, ValaEnum);
697 _tmp191_ = en;
698 _tmp192_ = vala_enum_get_is_flags (_tmp191_);
699 _tmp193_ = _tmp192_;
700 if (_tmp193_) {
701 ValaCCodeIdentifier* _tmp194_;
702 ValaCCodeIdentifier* _tmp195_;
703 ValaCCodeFunctionCall* _tmp196_;
704 _tmp194_ = vala_ccode_identifier_new ("g_flags_register_static");
705 _tmp195_ = _tmp194_;
706 _tmp196_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp195_);
707 _vala_ccode_node_unref0 (reg_call);
708 reg_call = _tmp196_;
709 _vala_ccode_node_unref0 (_tmp195_);
710 } else {
711 ValaCCodeIdentifier* _tmp197_;
712 ValaCCodeIdentifier* _tmp198_;
713 ValaCCodeFunctionCall* _tmp199_;
714 _tmp197_ = vala_ccode_identifier_new ("g_enum_register_static");
715 _tmp198_ = _tmp197_;
716 _tmp199_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp198_);
717 _vala_ccode_node_unref0 (reg_call);
718 reg_call = _tmp199_;
719 _vala_ccode_node_unref0 (_tmp198_);
720 }
721 } else {
722 if (fundamental) {
723 ValaCCodeIdentifier* _tmp200_;
724 ValaCCodeIdentifier* _tmp201_;
725 ValaCCodeFunctionCall* _tmp202_;
726 ValaCCodeFunctionCall* _tmp203_;
727 ValaCCodeIdentifier* _tmp204_;
728 ValaCCodeIdentifier* _tmp205_;
729 ValaCCodeFunctionCall* _tmp206_;
730 ValaCCodeFunctionCall* _tmp207_;
731 _tmp200_ = vala_ccode_identifier_new ("g_type_register_fundamental");
732 _tmp201_ = _tmp200_;
733 _tmp202_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp201_);
734 _vala_ccode_node_unref0 (reg_call);
735 reg_call = _tmp202_;
736 _vala_ccode_node_unref0 (_tmp201_);
737 _tmp203_ = reg_call;
738 _tmp204_ = vala_ccode_identifier_new ("g_type_fundamental_next");
739 _tmp205_ = _tmp204_;
740 _tmp206_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp205_);
741 _tmp207_ = _tmp206_;
742 vala_ccode_function_call_add_argument (_tmp203_, (ValaCCodeExpression*) _tmp207_);
743 _vala_ccode_node_unref0 (_tmp207_);
744 _vala_ccode_node_unref0 (_tmp205_);
745 } else {
746 if (!plugin) {
747 ValaCCodeIdentifier* _tmp208_;
748 ValaCCodeIdentifier* _tmp209_;
749 ValaCCodeFunctionCall* _tmp210_;
750 ValaCCodeFunctionCall* _tmp211_;
751 gchar* _tmp212_;
752 gchar* _tmp213_;
753 ValaCCodeIdentifier* _tmp214_;
754 ValaCCodeIdentifier* _tmp215_;
755 _tmp208_ = vala_ccode_identifier_new ("g_type_register_static");
756 _tmp209_ = _tmp208_;
757 _tmp210_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp209_);
758 _vala_ccode_node_unref0 (reg_call);
759 reg_call = _tmp210_;
760 _vala_ccode_node_unref0 (_tmp209_);
761 _tmp211_ = reg_call;
762 _tmp212_ = vala_typeregister_function_get_parent_type_name (self);
763 _tmp213_ = _tmp212_;
764 _tmp214_ = vala_ccode_identifier_new (_tmp213_);
765 _tmp215_ = _tmp214_;
766 vala_ccode_function_call_add_argument (_tmp211_, (ValaCCodeExpression*) _tmp215_);
767 _vala_ccode_node_unref0 (_tmp215_);
768 _g_free0 (_tmp213_);
769 } else {
770 ValaCCodeIdentifier* _tmp216_;
771 ValaCCodeIdentifier* _tmp217_;
772 ValaCCodeFunctionCall* _tmp218_;
773 ValaCCodeFunctionCall* _tmp219_;
774 ValaCCodeIdentifier* _tmp220_;
775 ValaCCodeIdentifier* _tmp221_;
776 ValaCCodeFunctionCall* _tmp222_;
777 gchar* _tmp223_;
778 gchar* _tmp224_;
779 ValaCCodeIdentifier* _tmp225_;
780 ValaCCodeIdentifier* _tmp226_;
781 _tmp216_ = vala_ccode_identifier_new ("g_type_module_register_type");
782 _tmp217_ = _tmp216_;
783 _tmp218_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp217_);
784 _vala_ccode_node_unref0 (reg_call);
785 reg_call = _tmp218_;
786 _vala_ccode_node_unref0 (_tmp217_);
787 _tmp219_ = reg_call;
788 _tmp220_ = vala_ccode_identifier_new ("module");
789 _tmp221_ = _tmp220_;
790 vala_ccode_function_call_add_argument (_tmp219_, (ValaCCodeExpression*) _tmp221_);
791 _vala_ccode_node_unref0 (_tmp221_);
792 _tmp222_ = reg_call;
793 _tmp223_ = vala_typeregister_function_get_parent_type_name (self);
794 _tmp224_ = _tmp223_;
795 _tmp225_ = vala_ccode_identifier_new (_tmp224_);
796 _tmp226_ = _tmp225_;
797 vala_ccode_function_call_add_argument (_tmp222_, (ValaCCodeExpression*) _tmp226_);
798 _vala_ccode_node_unref0 (_tmp226_);
799 _g_free0 (_tmp224_);
800 }
801 }
802 }
803 }
804 _tmp227_ = reg_call;
805 _tmp228_ = type_symbol;
806 _tmp229_ = vala_get_ccode_name ((ValaCodeNode*) _tmp228_);
807 _tmp230_ = _tmp229_;
808 _tmp231_ = g_strdup_printf ("\"%s\"", _tmp230_);
809 _tmp232_ = _tmp231_;
810 _tmp233_ = vala_ccode_constant_new (_tmp232_);
811 _tmp234_ = _tmp233_;
812 vala_ccode_function_call_add_argument (_tmp227_, (ValaCCodeExpression*) _tmp234_);
813 _vala_ccode_node_unref0 (_tmp234_);
814 _g_free0 (_tmp232_);
815 _g_free0 (_tmp230_);
816 _tmp235_ = type_symbol;
817 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp235_, VALA_TYPE_STRUCT)) {
818 ValaStruct* st = NULL;
819 ValaTypeSymbol* _tmp236_;
820 ValaStruct* _tmp237_;
821 ValaCCodeFunctionCall* _tmp238_;
822 ValaStruct* _tmp239_;
823 gchar* _tmp240_;
824 gchar* _tmp241_;
825 ValaCCodeIdentifier* _tmp242_;
826 ValaCCodeIdentifier* _tmp243_;
827 ValaCCodeCastExpression* _tmp244_;
828 ValaCCodeCastExpression* _tmp245_;
829 ValaCCodeFunctionCall* _tmp246_;
830 ValaStruct* _tmp247_;
831 gchar* _tmp248_;
832 gchar* _tmp249_;
833 ValaCCodeIdentifier* _tmp250_;
834 ValaCCodeIdentifier* _tmp251_;
835 ValaCCodeCastExpression* _tmp252_;
836 ValaCCodeCastExpression* _tmp253_;
837 _tmp236_ = type_symbol;
838 _tmp237_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp236_, VALA_TYPE_STRUCT, ValaStruct));
839 st = _tmp237_;
840 _tmp238_ = reg_call;
841 _tmp239_ = st;
842 _tmp240_ = vala_get_ccode_dup_function ((ValaTypeSymbol*) _tmp239_);
843 _tmp241_ = _tmp240_;
844 _tmp242_ = vala_ccode_identifier_new (_tmp241_);
845 _tmp243_ = _tmp242_;
846 _tmp244_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp243_, "GBoxedCopyFunc");
847 _tmp245_ = _tmp244_;
848 vala_ccode_function_call_add_argument (_tmp238_, (ValaCCodeExpression*) _tmp245_);
849 _vala_ccode_node_unref0 (_tmp245_);
850 _vala_ccode_node_unref0 (_tmp243_);
851 _g_free0 (_tmp241_);
852 _tmp246_ = reg_call;
853 _tmp247_ = st;
854 _tmp248_ = vala_get_ccode_free_function ((ValaTypeSymbol*) _tmp247_);
855 _tmp249_ = _tmp248_;
856 _tmp250_ = vala_ccode_identifier_new (_tmp249_);
857 _tmp251_ = _tmp250_;
858 _tmp252_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp251_, "GBoxedFreeFunc");
859 _tmp253_ = _tmp252_;
860 vala_ccode_function_call_add_argument (_tmp246_, (ValaCCodeExpression*) _tmp253_);
861 _vala_ccode_node_unref0 (_tmp253_);
862 _vala_ccode_node_unref0 (_tmp251_);
863 _g_free0 (_tmp249_);
864 _vala_code_node_unref0 (st);
865 } else {
866 ValaTypeSymbol* _tmp254_;
867 _tmp254_ = type_symbol;
868 if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp254_, VALA_TYPE_ENUM)) {
869 ValaEnum* en = NULL;
870 ValaTypeSymbol* _tmp255_;
871 ValaCCodeInitializerList* clist = NULL;
872 ValaCCodeInitializerList* _tmp256_;
873 ValaCCodeInitializerList* clist_ev = NULL;
874 ValaCCodeInitializerList* _tmp292_;
875 ValaCCodeInitializerList* _tmp293_;
876 ValaCCodeConstant* _tmp294_;
877 ValaCCodeConstant* _tmp295_;
878 ValaCCodeInitializerList* _tmp296_;
879 ValaCCodeConstant* _tmp297_;
880 ValaCCodeConstant* _tmp298_;
881 ValaCCodeInitializerList* _tmp299_;
882 ValaCCodeConstant* _tmp300_;
883 ValaCCodeConstant* _tmp301_;
884 ValaCCodeInitializerList* _tmp302_;
885 ValaCCodeInitializerList* _tmp303_;
886 ValaCCodeVariableDeclarator* enum_decl = NULL;
887 ValaCCodeInitializerList* _tmp304_;
888 ValaCCodeVariableDeclarator* _tmp305_;
889 ValaEnum* _tmp306_;
890 gboolean _tmp307_;
891 gboolean _tmp308_;
892 ValaCCodeDeclaration* _tmp311_;
893 ValaCCodeVariableDeclarator* _tmp312_;
894 ValaCCodeDeclaration* _tmp313_;
895 ValaCCodeBlock* _tmp314_;
896 ValaCCodeDeclaration* _tmp315_;
897 ValaCCodeFunctionCall* _tmp316_;
898 ValaCCodeIdentifier* _tmp317_;
899 ValaCCodeIdentifier* _tmp318_;
900 _tmp255_ = type_symbol;
901 en = G_TYPE_CHECK_INSTANCE_CAST (_tmp255_, VALA_TYPE_ENUM, ValaEnum);
902 _tmp256_ = vala_ccode_initializer_list_new ();
903 clist = _tmp256_;
904 clist_ev = NULL;
905 {
906 ValaList* _ev_list = NULL;
907 ValaEnum* _tmp257_;
908 ValaList* _tmp258_;
909 ValaList* _tmp259_;
910 gint _ev_size = 0;
911 ValaList* _tmp260_;
912 gint _tmp261_;
913 gint _tmp262_;
914 gint _ev_index = 0;
915 _tmp257_ = en;
916 _tmp258_ = vala_enum_get_values (_tmp257_);
917 _tmp259_ = _vala_iterable_ref0 (_tmp258_);
918 _ev_list = _tmp259_;
919 _tmp260_ = _ev_list;
920 _tmp261_ = vala_collection_get_size ((ValaCollection*) _tmp260_);
921 _tmp262_ = _tmp261_;
922 _ev_size = _tmp262_;
923 _ev_index = -1;
924 while (TRUE) {
925 gint _tmp263_;
926 gint _tmp264_;
927 ValaEnumValue* ev = NULL;
928 ValaList* _tmp265_;
929 gpointer _tmp266_;
930 ValaCCodeInitializerList* _tmp267_;
931 ValaCCodeInitializerList* _tmp268_;
932 ValaEnumValue* _tmp269_;
933 gchar* _tmp270_;
934 gchar* _tmp271_;
935 ValaCCodeConstant* _tmp272_;
936 ValaCCodeConstant* _tmp273_;
937 ValaCCodeInitializerList* _tmp274_;
938 ValaEnumValue* _tmp275_;
939 gchar* _tmp276_;
940 gchar* _tmp277_;
941 gchar* _tmp278_;
942 gchar* _tmp279_;
943 ValaCCodeConstant* _tmp280_;
944 ValaCCodeConstant* _tmp281_;
945 ValaCCodeInitializerList* _tmp282_;
946 ValaEnumValue* _tmp283_;
947 const gchar* _tmp284_;
948 const gchar* _tmp285_;
949 gchar* _tmp286_;
950 gchar* _tmp287_;
951 ValaCCodeConstant* _tmp288_;
952 ValaCCodeConstant* _tmp289_;
953 ValaCCodeInitializerList* _tmp290_;
954 ValaCCodeInitializerList* _tmp291_;
955 _ev_index = _ev_index + 1;
956 _tmp263_ = _ev_index;
957 _tmp264_ = _ev_size;
958 if (!(_tmp263_ < _tmp264_)) {
959 break;
960 }
961 _tmp265_ = _ev_list;
962 _tmp266_ = vala_list_get (_tmp265_, _ev_index);
963 ev = (ValaEnumValue*) _tmp266_;
964 _tmp267_ = vala_ccode_initializer_list_new ();
965 _vala_ccode_node_unref0 (clist_ev);
966 clist_ev = _tmp267_;
967 _tmp268_ = clist_ev;
968 _tmp269_ = ev;
969 _tmp270_ = vala_get_ccode_name ((ValaCodeNode*) _tmp269_);
970 _tmp271_ = _tmp270_;
971 _tmp272_ = vala_ccode_constant_new (_tmp271_);
972 _tmp273_ = _tmp272_;
973 vala_ccode_initializer_list_append (_tmp268_, (ValaCCodeExpression*) _tmp273_);
974 _vala_ccode_node_unref0 (_tmp273_);
975 _g_free0 (_tmp271_);
976 _tmp274_ = clist_ev;
977 _tmp275_ = ev;
978 _tmp276_ = vala_get_ccode_name ((ValaCodeNode*) _tmp275_);
979 _tmp277_ = _tmp276_;
980 _tmp278_ = g_strdup_printf ("\"%s\"", _tmp277_);
981 _tmp279_ = _tmp278_;
982 _tmp280_ = vala_ccode_constant_new (_tmp279_);
983 _tmp281_ = _tmp280_;
984 vala_ccode_initializer_list_append (_tmp274_, (ValaCCodeExpression*) _tmp281_);
985 _vala_ccode_node_unref0 (_tmp281_);
986 _g_free0 (_tmp279_);
987 _g_free0 (_tmp277_);
988 _tmp282_ = clist_ev;
989 _tmp283_ = ev;
990 _tmp284_ = vala_enum_value_get_nick (_tmp283_);
991 _tmp285_ = _tmp284_;
992 _tmp286_ = g_strdup_printf ("\"%s\"", _tmp285_);
993 _tmp287_ = _tmp286_;
994 _tmp288_ = vala_ccode_constant_new (_tmp287_);
995 _tmp289_ = _tmp288_;
996 vala_ccode_initializer_list_append (_tmp282_, (ValaCCodeExpression*) _tmp289_);
997 _vala_ccode_node_unref0 (_tmp289_);
998 _g_free0 (_tmp287_);
999 _tmp290_ = clist;
1000 _tmp291_ = clist_ev;
1001 vala_ccode_initializer_list_append (_tmp290_, (ValaCCodeExpression*) _tmp291_);
1002 _vala_code_node_unref0 (ev);
1003 }
1004 _vala_iterable_unref0 (_ev_list);
1005 }
1006 _tmp292_ = vala_ccode_initializer_list_new ();
1007 _vala_ccode_node_unref0 (clist_ev);
1008 clist_ev = _tmp292_;
1009 _tmp293_ = clist_ev;
1010 _tmp294_ = vala_ccode_constant_new ("0");
1011 _tmp295_ = _tmp294_;
1012 vala_ccode_initializer_list_append (_tmp293_, (ValaCCodeExpression*) _tmp295_);
1013 _vala_ccode_node_unref0 (_tmp295_);
1014 _tmp296_ = clist_ev;
1015 _tmp297_ = vala_ccode_constant_new ("NULL");
1016 _tmp298_ = _tmp297_;
1017 vala_ccode_initializer_list_append (_tmp296_, (ValaCCodeExpression*) _tmp298_);
1018 _vala_ccode_node_unref0 (_tmp298_);
1019 _tmp299_ = clist_ev;
1020 _tmp300_ = vala_ccode_constant_new ("NULL");
1021 _tmp301_ = _tmp300_;
1022 vala_ccode_initializer_list_append (_tmp299_, (ValaCCodeExpression*) _tmp301_);
1023 _vala_ccode_node_unref0 (_tmp301_);
1024 _tmp302_ = clist;
1025 _tmp303_ = clist_ev;
1026 vala_ccode_initializer_list_append (_tmp302_, (ValaCCodeExpression*) _tmp303_);
1027 _tmp304_ = clist;
1028 _tmp305_ = vala_ccode_variable_declarator_new ("values[]", (ValaCCodeExpression*) _tmp304_, NULL);
1029 enum_decl = _tmp305_;
1030 _tmp306_ = en;
1031 _tmp307_ = vala_enum_get_is_flags (_tmp306_);
1032 _tmp308_ = _tmp307_;
1033 if (_tmp308_) {
1034 ValaCCodeDeclaration* _tmp309_;
1035 _tmp309_ = vala_ccode_declaration_new ("const GFlagsValue");
1036 _vala_ccode_node_unref0 (_cdecl_);
1037 _cdecl_ = _tmp309_;
1038 } else {
1039 ValaCCodeDeclaration* _tmp310_;
1040 _tmp310_ = vala_ccode_declaration_new ("const GEnumValue");
1041 _vala_ccode_node_unref0 (_cdecl_);
1042 _cdecl_ = _tmp310_;
1043 }
1044 _tmp311_ = _cdecl_;
1045 _tmp312_ = enum_decl;
1046 vala_ccode_declaration_add_declarator (_tmp311_, (ValaCCodeDeclarator*) _tmp312_);
1047 _tmp313_ = _cdecl_;
1048 vala_ccode_node_set_modifiers ((ValaCCodeNode*) _tmp313_, VALA_CCODE_MODIFIERS_STATIC);
1049 _tmp314_ = type_init;
1050 _tmp315_ = _cdecl_;
1051 vala_ccode_block_add_statement (_tmp314_, (ValaCCodeNode*) _tmp315_);
1052 _tmp316_ = reg_call;
1053 _tmp317_ = vala_ccode_identifier_new ("values");
1054 _tmp318_ = _tmp317_;
1055 vala_ccode_function_call_add_argument (_tmp316_, (ValaCCodeExpression*) _tmp318_);
1056 _vala_ccode_node_unref0 (_tmp318_);
1057 _vala_ccode_node_unref0 (enum_decl);
1058 _vala_ccode_node_unref0 (clist_ev);
1059 _vala_ccode_node_unref0 (clist);
1060 } else {
1061 ValaCCodeFunctionCall* _tmp319_;
1062 ValaCCodeIdentifier* _tmp320_;
1063 ValaCCodeIdentifier* _tmp321_;
1064 ValaCCodeFunctionCall* _tmp325_;
1065 gchar* _tmp326_;
1066 gchar* _tmp327_;
1067 ValaCCodeConstant* _tmp328_;
1068 ValaCCodeConstant* _tmp329_;
1069 _tmp319_ = reg_call;
1070 _tmp320_ = vala_ccode_identifier_new ("&g_define_type_info");
1071 _tmp321_ = _tmp320_;
1072 vala_ccode_function_call_add_argument (_tmp319_, (ValaCCodeExpression*) _tmp321_);
1073 _vala_ccode_node_unref0 (_tmp321_);
1074 if (fundamental) {
1075 ValaCCodeFunctionCall* _tmp322_;
1076 ValaCCodeIdentifier* _tmp323_;
1077 ValaCCodeIdentifier* _tmp324_;
1078 _tmp322_ = reg_call;
1079 _tmp323_ = vala_ccode_identifier_new ("&g_define_type_fundamental_info");
1080 _tmp324_ = _tmp323_;
1081 vala_ccode_function_call_add_argument (_tmp322_, (ValaCCodeExpression*) _tmp324_);
1082 _vala_ccode_node_unref0 (_tmp324_);
1083 }
1084 _tmp325_ = reg_call;
1085 _tmp326_ = vala_typeregister_function_get_type_flags (self);
1086 _tmp327_ = _tmp326_;
1087 _tmp328_ = vala_ccode_constant_new (_tmp327_);
1088 _tmp329_ = _tmp328_;
1089 vala_ccode_function_call_add_argument (_tmp325_, (ValaCCodeExpression*) _tmp329_);
1090 _vala_ccode_node_unref0 (_tmp329_);
1091 _g_free0 (_tmp327_);
1092 }
1093 }
1094 _tmp330_ = vala_ccode_block_new ();
1095 once_call_block = _tmp330_;
1096 if (!plugin) {
1097 ValaCCodeDeclaration* temp_decl = NULL;
1098 ValaCCodeDeclaration* _tmp331_;
1099 ValaCCodeDeclaration* _tmp332_;
1100 const gchar* _tmp333_;
1101 ValaCCodeFunctionCall* _tmp334_;
1102 ValaCCodeVariableDeclarator* _tmp335_;
1103 ValaCCodeVariableDeclarator* _tmp336_;
1104 ValaCCodeBlock* _tmp337_;
1105 ValaCCodeDeclaration* _tmp338_;
1106 ValaCCodeDeclaration* _tmp339_;
1107 ValaCCodeDeclaration* _tmp340_;
1108 const gchar* _tmp341_;
1109 ValaCCodeFunction* _tmp342_;
1110 const gchar* _tmp343_;
1111 const gchar* _tmp344_;
1112 ValaCCodeIdentifier* _tmp345_;
1113 ValaCCodeIdentifier* _tmp346_;
1114 ValaCCodeFunctionCall* _tmp347_;
1115 ValaCCodeFunctionCall* _tmp348_;
1116 ValaCCodeVariableDeclarator* _tmp349_;
1117 ValaCCodeVariableDeclarator* _tmp350_;
1118 ValaCCodeBlock* _tmp351_;
1119 ValaCCodeDeclaration* _tmp352_;
1120 _tmp331_ = vala_ccode_declaration_new ("GType");
1121 temp_decl = _tmp331_;
1122 _tmp332_ = temp_decl;
1123 _tmp333_ = type_id_name;
1124 _tmp334_ = reg_call;
1125 _tmp335_ = vala_ccode_variable_declarator_new (_tmp333_, (ValaCCodeExpression*) _tmp334_, NULL);
1126 _tmp336_ = _tmp335_;
1127 vala_ccode_declaration_add_declarator (_tmp332_, (ValaCCodeDeclarator*) _tmp336_);
1128 _vala_ccode_node_unref0 (_tmp336_);
1129 _tmp337_ = type_init;
1130 _tmp338_ = temp_decl;
1131 vala_ccode_block_add_statement (_tmp337_, (ValaCCodeNode*) _tmp338_);
1132 _tmp339_ = vala_ccode_declaration_new ("GType");
1133 _vala_ccode_node_unref0 (temp_decl);
1134 temp_decl = _tmp339_;
1135 _tmp340_ = temp_decl;
1136 _tmp341_ = type_id_name;
1137 _tmp342_ = fun_once;
1138 _tmp343_ = vala_ccode_function_get_name (_tmp342_);
1139 _tmp344_ = _tmp343_;
1140 _tmp345_ = vala_ccode_identifier_new (_tmp344_);
1141 _tmp346_ = _tmp345_;
1142 _tmp347_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp346_);
1143 _tmp348_ = _tmp347_;
1144 _tmp349_ = vala_ccode_variable_declarator_new (_tmp341_, (ValaCCodeExpression*) _tmp348_, NULL);
1145 _tmp350_ = _tmp349_;
1146 vala_ccode_declaration_add_declarator (_tmp340_, (ValaCCodeDeclarator*) _tmp350_);
1147 _vala_ccode_node_unref0 (_tmp350_);
1148 _vala_ccode_node_unref0 (_tmp348_);
1149 _vala_ccode_node_unref0 (_tmp346_);
1150 _tmp351_ = once_call_block;
1151 _tmp352_ = temp_decl;
1152 vala_ccode_block_add_statement (_tmp351_, (ValaCCodeNode*) _tmp352_);
1153 _vala_ccode_node_unref0 (temp_decl);
1154 } else {
1155 ValaCCodeBlock* _tmp353_;
1156 const gchar* _tmp354_;
1157 ValaCCodeIdentifier* _tmp355_;
1158 ValaCCodeIdentifier* _tmp356_;
1159 ValaCCodeFunctionCall* _tmp357_;
1160 ValaCCodeAssignment* _tmp358_;
1161 ValaCCodeAssignment* _tmp359_;
1162 ValaCCodeExpressionStatement* _tmp360_;
1163 ValaCCodeExpressionStatement* _tmp361_;
1164 _tmp353_ = type_init;
1165 _tmp354_ = type_id_name;
1166 _tmp355_ = vala_ccode_identifier_new (_tmp354_);
1167 _tmp356_ = _tmp355_;
1168 _tmp357_ = reg_call;
1169 _tmp358_ = vala_ccode_assignment_new ((ValaCCodeExpression*) _tmp356_, (ValaCCodeExpression*) _tmp357_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
1170 _tmp359_ = _tmp358_;
1171 _tmp360_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp359_);
1172 _tmp361_ = _tmp360_;
1173 vala_ccode_block_add_statement (_tmp353_, (ValaCCodeNode*) _tmp361_);
1174 _vala_ccode_node_unref0 (_tmp361_);
1175 _vala_ccode_node_unref0 (_tmp359_);
1176 _vala_ccode_node_unref0 (_tmp356_);
1177 }
1178 _tmp363_ = cl;
1179 if (_tmp363_ != NULL) {
1180 ValaClass* _tmp364_;
1181 gboolean _tmp365_;
1182 gboolean _tmp366_;
1183 _tmp364_ = cl;
1184 _tmp365_ = vala_class_get_has_class_private_fields (_tmp364_);
1185 _tmp366_ = _tmp365_;
1186 _tmp362_ = _tmp366_;
1187 } else {
1188 _tmp362_ = FALSE;
1189 }
1190 if (_tmp362_) {
1191 ValaCCodeFunctionCall* add_class_private_call = NULL;
1192 ValaCCodeIdentifier* _tmp367_;
1193 ValaCCodeIdentifier* _tmp368_;
1194 ValaCCodeFunctionCall* _tmp369_;
1195 ValaCCodeFunctionCall* _tmp370_;
1196 const gchar* _tmp371_;
1197 ValaCCodeIdentifier* _tmp372_;
1198 ValaCCodeIdentifier* _tmp373_;
1199 ValaCCodeFunctionCall* _tmp374_;
1200 ValaClass* _tmp375_;
1201 gchar* _tmp376_;
1202 gchar* _tmp377_;
1203 gchar* _tmp378_;
1204 gchar* _tmp379_;
1205 ValaCCodeIdentifier* _tmp380_;
1206 ValaCCodeIdentifier* _tmp381_;
1207 ValaCCodeBlock* _tmp382_;
1208 ValaCCodeFunctionCall* _tmp383_;
1209 ValaCCodeExpressionStatement* _tmp384_;
1210 ValaCCodeExpressionStatement* _tmp385_;
1211 _tmp367_ = vala_ccode_identifier_new ("g_type_add_class_private");
1212 _tmp368_ = _tmp367_;
1213 _tmp369_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp368_);
1214 _vala_ccode_node_unref0 (add_class_private_call);
1215 add_class_private_call = _tmp369_;
1216 _vala_ccode_node_unref0 (_tmp368_);
1217 _tmp370_ = add_class_private_call;
1218 _tmp371_ = type_id_name;
1219 _tmp372_ = vala_ccode_identifier_new (_tmp371_);
1220 _tmp373_ = _tmp372_;
1221 vala_ccode_function_call_add_argument (_tmp370_, (ValaCCodeExpression*) _tmp373_);
1222 _vala_ccode_node_unref0 (_tmp373_);
1223 _tmp374_ = add_class_private_call;
1224 _tmp375_ = cl;
1225 _tmp376_ = vala_get_ccode_type_name ((ValaObjectTypeSymbol*) _tmp375_);
1226 _tmp377_ = _tmp376_;
1227 _tmp378_ = g_strdup_printf ("sizeof (%sPrivate)", _tmp377_);
1228 _tmp379_ = _tmp378_;
1229 _tmp380_ = vala_ccode_identifier_new (_tmp379_);
1230 _tmp381_ = _tmp380_;
1231 vala_ccode_function_call_add_argument (_tmp374_, (ValaCCodeExpression*) _tmp381_);
1232 _vala_ccode_node_unref0 (_tmp381_);
1233 _g_free0 (_tmp379_);
1234 _g_free0 (_tmp377_);
1235 _tmp382_ = type_init;
1236 _tmp383_ = add_class_private_call;
1237 _tmp384_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp383_);
1238 _tmp385_ = _tmp384_;
1239 vala_ccode_block_add_statement (_tmp382_, (ValaCCodeNode*) _tmp385_);
1240 _vala_ccode_node_unref0 (_tmp385_);
1241 _vala_ccode_node_unref0 (add_class_private_call);
1242 }
1243 if (!declaration_only) {
1244 ValaCCodeBlock* _tmp386_;
1245 _tmp386_ = type_init;
1246 vala_typeregister_function_get_type_interface_init_statements (self, context, _tmp386_, plugin);
1247 }
1248 _tmp388_ = cl;
1249 if (_tmp388_ != NULL) {
1250 gboolean _tmp389_ = FALSE;
1251 ValaClass* _tmp390_;
1252 gboolean _tmp391_;
1253 gboolean _tmp392_;
1254 _tmp390_ = cl;
1255 _tmp391_ = vala_class_get_has_private_fields (_tmp390_);
1256 _tmp392_ = _tmp391_;
1257 if (_tmp392_) {
1258 _tmp389_ = TRUE;
1259 } else {
1260 ValaClass* _tmp393_;
1261 _tmp393_ = cl;
1262 _tmp389_ = vala_object_type_symbol_has_type_parameters ((ValaObjectTypeSymbol*) _tmp393_);
1263 }
1264 _tmp387_ = _tmp389_;
1265 } else {
1266 _tmp387_ = FALSE;
1267 }
1268 if (_tmp387_) {
1269 if (!plugin) {
1270 ValaCCodeFunctionCall* ccall = NULL;
1271 ValaCCodeIdentifier* _tmp394_;
1272 ValaCCodeIdentifier* _tmp395_;
1273 ValaCCodeFunctionCall* _tmp396_;
1274 ValaCCodeFunctionCall* _tmp397_;
1275 ValaCCodeFunctionCall* _tmp398_;
1276 const gchar* _tmp399_;
1277 ValaCCodeIdentifier* _tmp400_;
1278 ValaCCodeIdentifier* _tmp401_;
1279 ValaCCodeFunctionCall* _tmp402_;
1280 ValaClass* _tmp403_;
1281 gchar* _tmp404_;
1282 gchar* _tmp405_;
1283 gchar* _tmp406_;
1284 gchar* _tmp407_;
1285 ValaCCodeIdentifier* _tmp408_;
1286 ValaCCodeIdentifier* _tmp409_;
1287 ValaCCodeBlock* _tmp410_;
1288 ValaClass* _tmp411_;
1289 gchar* _tmp412_;
1290 gchar* _tmp413_;
1291 gchar* _tmp414_;
1292 gchar* _tmp415_;
1293 ValaCCodeIdentifier* _tmp416_;
1294 ValaCCodeIdentifier* _tmp417_;
1295 ValaCCodeFunctionCall* _tmp418_;
1296 ValaCCodeAssignment* _tmp419_;
1297 ValaCCodeAssignment* _tmp420_;
1298 ValaCCodeExpressionStatement* _tmp421_;
1299 ValaCCodeExpressionStatement* _tmp422_;
1300 _tmp394_ = vala_ccode_identifier_new ("g_type_add_instance_private");
1301 _tmp395_ = _tmp394_;
1302 _tmp396_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp395_);
1303 _tmp397_ = _tmp396_;
1304 _vala_ccode_node_unref0 (_tmp395_);
1305 ccall = _tmp397_;
1306 _tmp398_ = ccall;
1307 _tmp399_ = type_id_name;
1308 _tmp400_ = vala_ccode_identifier_new (_tmp399_);
1309 _tmp401_ = _tmp400_;
1310 vala_ccode_function_call_add_argument (_tmp398_, (ValaCCodeExpression*) _tmp401_);
1311 _vala_ccode_node_unref0 (_tmp401_);
1312 _tmp402_ = ccall;
1313 _tmp403_ = cl;
1314 _tmp404_ = vala_get_ccode_name ((ValaCodeNode*) _tmp403_);
1315 _tmp405_ = _tmp404_;
1316 _tmp406_ = g_strdup_printf ("sizeof (%sPrivate)", _tmp405_);
1317 _tmp407_ = _tmp406_;
1318 _tmp408_ = vala_ccode_identifier_new (_tmp407_);
1319 _tmp409_ = _tmp408_;
1320 vala_ccode_function_call_add_argument (_tmp402_, (ValaCCodeExpression*) _tmp409_);
1321 _vala_ccode_node_unref0 (_tmp409_);
1322 _g_free0 (_tmp407_);
1323 _g_free0 (_tmp405_);
1324 _tmp410_ = type_init;
1325 _tmp411_ = cl;
1326 _tmp412_ = vala_get_ccode_name ((ValaCodeNode*) _tmp411_);
1327 _tmp413_ = _tmp412_;
1328 _tmp414_ = g_strdup_printf ("%s_private_offset", _tmp413_);
1329 _tmp415_ = _tmp414_;
1330 _tmp416_ = vala_ccode_identifier_new (_tmp415_);
1331 _tmp417_ = _tmp416_;
1332 _tmp418_ = ccall;
1333 _tmp419_ = vala_ccode_assignment_new ((ValaCCodeExpression*) _tmp417_, (ValaCCodeExpression*) _tmp418_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
1334 _tmp420_ = _tmp419_;
1335 _tmp421_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp420_);
1336 _tmp422_ = _tmp421_;
1337 vala_ccode_block_add_statement (_tmp410_, (ValaCCodeNode*) _tmp422_);
1338 _vala_ccode_node_unref0 (_tmp422_);
1339 _vala_ccode_node_unref0 (_tmp420_);
1340 _vala_ccode_node_unref0 (_tmp417_);
1341 _g_free0 (_tmp415_);
1342 _g_free0 (_tmp413_);
1343 _vala_ccode_node_unref0 (ccall);
1344 } else {
1345 ValaCCodeBlock* _tmp423_;
1346 ValaClass* _tmp424_;
1347 gchar* _tmp425_;
1348 gchar* _tmp426_;
1349 gchar* _tmp427_;
1350 gchar* _tmp428_;
1351 ValaCCodeIdentifier* _tmp429_;
1352 ValaCCodeIdentifier* _tmp430_;
1353 ValaClass* _tmp431_;
1354 gchar* _tmp432_;
1355 gchar* _tmp433_;
1356 gchar* _tmp434_;
1357 gchar* _tmp435_;
1358 ValaCCodeIdentifier* _tmp436_;
1359 ValaCCodeIdentifier* _tmp437_;
1360 ValaCCodeAssignment* _tmp438_;
1361 ValaCCodeAssignment* _tmp439_;
1362 ValaCCodeExpressionStatement* _tmp440_;
1363 ValaCCodeExpressionStatement* _tmp441_;
1364 _tmp423_ = type_init;
1365 _tmp424_ = cl;
1366 _tmp425_ = vala_get_ccode_name ((ValaCodeNode*) _tmp424_);
1367 _tmp426_ = _tmp425_;
1368 _tmp427_ = g_strdup_printf ("%s_private_offset", _tmp426_);
1369 _tmp428_ = _tmp427_;
1370 _tmp429_ = vala_ccode_identifier_new (_tmp428_);
1371 _tmp430_ = _tmp429_;
1372 _tmp431_ = cl;
1373 _tmp432_ = vala_get_ccode_name ((ValaCodeNode*) _tmp431_);
1374 _tmp433_ = _tmp432_;
1375 _tmp434_ = g_strdup_printf ("sizeof (%sPrivate)", _tmp433_);
1376 _tmp435_ = _tmp434_;
1377 _tmp436_ = vala_ccode_identifier_new (_tmp435_);
1378 _tmp437_ = _tmp436_;
1379 _tmp438_ = vala_ccode_assignment_new ((ValaCCodeExpression*) _tmp430_, (ValaCCodeExpression*) _tmp437_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
1380 _tmp439_ = _tmp438_;
1381 _tmp440_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp439_);
1382 _tmp441_ = _tmp440_;
1383 vala_ccode_block_add_statement (_tmp423_, (ValaCCodeNode*) _tmp441_);
1384 _vala_ccode_node_unref0 (_tmp441_);
1385 _vala_ccode_node_unref0 (_tmp439_);
1386 _vala_ccode_node_unref0 (_tmp437_);
1387 _g_free0 (_tmp435_);
1388 _g_free0 (_tmp433_);
1389 _vala_ccode_node_unref0 (_tmp430_);
1390 _g_free0 (_tmp428_);
1391 _g_free0 (_tmp426_);
1392 }
1393 }
1394 if (!plugin) {
1395 ValaCCodeFunctionCall* enter = NULL;
1396 ValaCCodeIdentifier* _tmp442_;
1397 ValaCCodeIdentifier* _tmp443_;
1398 ValaCCodeFunctionCall* _tmp444_;
1399 ValaCCodeFunctionCall* _tmp445_;
1400 ValaCCodeFunctionCall* _tmp446_;
1401 const gchar* _tmp447_;
1402 gchar* _tmp448_;
1403 gchar* _tmp449_;
1404 ValaCCodeIdentifier* _tmp450_;
1405 ValaCCodeIdentifier* _tmp451_;
1406 ValaCCodeUnaryExpression* _tmp452_;
1407 ValaCCodeUnaryExpression* _tmp453_;
1408 ValaCCodeFunctionCall* leave = NULL;
1409 ValaCCodeIdentifier* _tmp454_;
1410 ValaCCodeIdentifier* _tmp455_;
1411 ValaCCodeFunctionCall* _tmp456_;
1412 ValaCCodeFunctionCall* _tmp457_;
1413 ValaCCodeFunctionCall* _tmp458_;
1414 const gchar* _tmp459_;
1415 gchar* _tmp460_;
1416 gchar* _tmp461_;
1417 ValaCCodeIdentifier* _tmp462_;
1418 ValaCCodeIdentifier* _tmp463_;
1419 ValaCCodeUnaryExpression* _tmp464_;
1420 ValaCCodeUnaryExpression* _tmp465_;
1421 ValaCCodeFunctionCall* _tmp466_;
1422 const gchar* _tmp467_;
1423 ValaCCodeIdentifier* _tmp468_;
1424 ValaCCodeIdentifier* _tmp469_;
1425 ValaCCodeBlock* _tmp470_;
1426 ValaCCodeFunctionCall* _tmp471_;
1427 ValaCCodeExpressionStatement* _tmp472_;
1428 ValaCCodeExpressionStatement* _tmp473_;
1429 ValaCCodeIfStatement* cif = NULL;
1430 ValaCCodeFunctionCall* _tmp474_;
1431 ValaCCodeBlock* _tmp475_;
1432 ValaCCodeIfStatement* _tmp476_;
1433 ValaCCodeBlock* _tmp477_;
1434 ValaCCodeIfStatement* _tmp478_;
1435 ValaCCodeBlock* _tmp479_;
1436 const gchar* _tmp480_;
1437 gchar* _tmp481_;
1438 gchar* _tmp482_;
1439 ValaCCodeIdentifier* _tmp483_;
1440 ValaCCodeIdentifier* _tmp484_;
1441 ValaCCodeReturnStatement* _tmp485_;
1442 ValaCCodeReturnStatement* _tmp486_;
1443 ValaCCodeBlock* _tmp487_;
1444 ValaCCodeBlock* _tmp488_;
1445 ValaCCodeBlock* _tmp489_;
1446 const gchar* _tmp490_;
1447 ValaCCodeIdentifier* _tmp491_;
1448 ValaCCodeIdentifier* _tmp492_;
1449 ValaCCodeReturnStatement* _tmp493_;
1450 ValaCCodeReturnStatement* _tmp494_;
1451 _tmp442_ = vala_ccode_identifier_new ("g_once_init_enter");
1452 _tmp443_ = _tmp442_;
1453 _tmp444_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp443_);
1454 _tmp445_ = _tmp444_;
1455 _vala_ccode_node_unref0 (_tmp443_);
1456 enter = _tmp445_;
1457 _tmp446_ = enter;
1458 _tmp447_ = type_id_name;
1459 _tmp448_ = g_strconcat (_tmp447_, "__volatile", NULL);
1460 _tmp449_ = _tmp448_;
1461 _tmp450_ = vala_ccode_identifier_new (_tmp449_);
1462 _tmp451_ = _tmp450_;
1463 _tmp452_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (ValaCCodeExpression*) _tmp451_);
1464 _tmp453_ = _tmp452_;
1465 vala_ccode_function_call_add_argument (_tmp446_, (ValaCCodeExpression*) _tmp453_);
1466 _vala_ccode_node_unref0 (_tmp453_);
1467 _vala_ccode_node_unref0 (_tmp451_);
1468 _g_free0 (_tmp449_);
1469 _tmp454_ = vala_ccode_identifier_new ("g_once_init_leave");
1470 _tmp455_ = _tmp454_;
1471 _tmp456_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp455_);
1472 _tmp457_ = _tmp456_;
1473 _vala_ccode_node_unref0 (_tmp455_);
1474 leave = _tmp457_;
1475 _tmp458_ = leave;
1476 _tmp459_ = type_id_name;
1477 _tmp460_ = g_strconcat (_tmp459_, "__volatile", NULL);
1478 _tmp461_ = _tmp460_;
1479 _tmp462_ = vala_ccode_identifier_new (_tmp461_);
1480 _tmp463_ = _tmp462_;
1481 _tmp464_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (ValaCCodeExpression*) _tmp463_);
1482 _tmp465_ = _tmp464_;
1483 vala_ccode_function_call_add_argument (_tmp458_, (ValaCCodeExpression*) _tmp465_);
1484 _vala_ccode_node_unref0 (_tmp465_);
1485 _vala_ccode_node_unref0 (_tmp463_);
1486 _g_free0 (_tmp461_);
1487 _tmp466_ = leave;
1488 _tmp467_ = type_id_name;
1489 _tmp468_ = vala_ccode_identifier_new (_tmp467_);
1490 _tmp469_ = _tmp468_;
1491 vala_ccode_function_call_add_argument (_tmp466_, (ValaCCodeExpression*) _tmp469_);
1492 _vala_ccode_node_unref0 (_tmp469_);
1493 _tmp470_ = once_call_block;
1494 _tmp471_ = leave;
1495 _tmp472_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp471_);
1496 _tmp473_ = _tmp472_;
1497 vala_ccode_block_add_statement (_tmp470_, (ValaCCodeNode*) _tmp473_);
1498 _vala_ccode_node_unref0 (_tmp473_);
1499 _tmp474_ = enter;
1500 _tmp475_ = once_call_block;
1501 _tmp476_ = vala_ccode_if_statement_new ((ValaCCodeExpression*) _tmp474_, (ValaCCodeStatement*) _tmp475_, NULL);
1502 cif = _tmp476_;
1503 _tmp477_ = type_block;
1504 _tmp478_ = cif;
1505 vala_ccode_block_add_statement (_tmp477_, (ValaCCodeNode*) _tmp478_);
1506 _tmp479_ = type_block;
1507 _tmp480_ = type_id_name;
1508 _tmp481_ = g_strconcat (_tmp480_, "__volatile", NULL);
1509 _tmp482_ = _tmp481_;
1510 _tmp483_ = vala_ccode_identifier_new (_tmp482_);
1511 _tmp484_ = _tmp483_;
1512 _tmp485_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) _tmp484_);
1513 _tmp486_ = _tmp485_;
1514 vala_ccode_block_add_statement (_tmp479_, (ValaCCodeNode*) _tmp486_);
1515 _vala_ccode_node_unref0 (_tmp486_);
1516 _vala_ccode_node_unref0 (_tmp484_);
1517 _g_free0 (_tmp482_);
1518 _tmp487_ = type_init;
1519 _tmp488_ = _vala_ccode_node_ref0 (_tmp487_);
1520 _vala_ccode_node_unref0 (type_once_block);
1521 type_once_block = _tmp488_;
1522 _tmp489_ = type_once_block;
1523 _tmp490_ = type_id_name;
1524 _tmp491_ = vala_ccode_identifier_new (_tmp490_);
1525 _tmp492_ = _tmp491_;
1526 _tmp493_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) _tmp492_);
1527 _tmp494_ = _tmp493_;
1528 vala_ccode_block_add_statement (_tmp489_, (ValaCCodeNode*) _tmp494_);
1529 _vala_ccode_node_unref0 (_tmp494_);
1530 _vala_ccode_node_unref0 (_tmp492_);
1531 _vala_ccode_node_unref0 (cif);
1532 _vala_ccode_node_unref0 (leave);
1533 _vala_ccode_node_unref0 (enter);
1534 } else {
1535 ValaCCodeBlock* _tmp495_;
1536 ValaCCodeBlock* _tmp496_;
1537 ValaCCodeBlock* _tmp497_;
1538 const gchar* _tmp498_;
1539 ValaCCodeIdentifier* _tmp499_;
1540 ValaCCodeIdentifier* _tmp500_;
1541 ValaCCodeReturnStatement* _tmp501_;
1542 ValaCCodeReturnStatement* _tmp502_;
1543 _tmp495_ = type_init;
1544 _tmp496_ = _vala_ccode_node_ref0 (_tmp495_);
1545 _vala_ccode_node_unref0 (type_block);
1546 type_block = _tmp496_;
1547 _tmp497_ = type_block;
1548 _tmp498_ = type_id_name;
1549 _tmp499_ = vala_ccode_identifier_new (_tmp498_);
1550 _tmp500_ = _tmp499_;
1551 _tmp501_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) _tmp500_);
1552 _tmp502_ = _tmp501_;
1553 vala_ccode_block_add_statement (_tmp497_, (ValaCCodeNode*) _tmp502_);
1554 _vala_ccode_node_unref0 (_tmp502_);
1555 _vala_ccode_node_unref0 (_tmp500_);
1556 }
1557 if (!plugin) {
1558 ValaCCodeFunction* _tmp503_;
1559 ValaCCodeBlock* _tmp504_;
1560 ValaCCodeFragment* _tmp505_;
1561 ValaCCodeFunction* _tmp506_;
1562 _tmp503_ = fun_once;
1563 _tmp504_ = type_once_block;
1564 vala_ccode_function_set_block (_tmp503_, _tmp504_);
1565 _tmp505_ = self->priv->definition_fragment;
1566 _tmp506_ = fun_once;
1567 vala_ccode_fragment_append (_tmp505_, (ValaCCodeNode*) _tmp506_);
1568 }
1569 _tmp507_ = fun;
1570 _tmp508_ = type_block;
1571 vala_ccode_function_set_block (_tmp507_, _tmp508_);
1572 _tmp509_ = self->priv->definition_fragment;
1573 _tmp510_ = fun;
1574 vala_ccode_fragment_append (_tmp509_, (ValaCCodeNode*) _tmp510_);
1575 _vala_ccode_node_unref0 (once_call_block);
1576 _vala_ccode_node_unref0 (reg_call);
1577 _vala_ccode_node_unref0 (type_init);
1578 _g_free0 (type_value_table_decl_name);
1579 _vala_ccode_node_unref0 (fun_once);
1580 _vala_ccode_node_unref0 (fun);
1581 _vala_ccode_node_unref0 (_cdecl_);
1582 _vala_ccode_node_unref0 (type_once_block);
1583 _vala_ccode_node_unref0 (type_block);
1584 _g_free0 (type_id_name);
1585 _vala_code_node_unref0 (type_symbol);
1586 }
1587
1588 /**
1589 * Returns the data type to be registered.
1590 *
1591 * @return type to be registered
1592 */
1593 static ValaTypeSymbol*
vala_typeregister_function_real_get_type_declaration(ValaTypeRegisterFunction * self)1594 vala_typeregister_function_real_get_type_declaration (ValaTypeRegisterFunction* self)
1595 {
1596 g_critical ("Type `%s' does not implement abstract method `vala_typeregister_function_get_type_declaration'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
1597 return NULL;
1598 }
1599
1600 ValaTypeSymbol*
vala_typeregister_function_get_type_declaration(ValaTypeRegisterFunction * self)1601 vala_typeregister_function_get_type_declaration (ValaTypeRegisterFunction* self)
1602 {
1603 g_return_val_if_fail (self != NULL, NULL);
1604 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_type_declaration (self);
1605 }
1606
1607 /**
1608 * Returns the name of the type struct in C code.
1609 *
1610 * @return C struct name
1611 */
1612 static gchar*
vala_typeregister_function_real_get_type_struct_name(ValaTypeRegisterFunction * self)1613 vala_typeregister_function_real_get_type_struct_name (ValaTypeRegisterFunction* self)
1614 {
1615 g_assert_not_reached ();
1616 }
1617
1618 gchar*
vala_typeregister_function_get_type_struct_name(ValaTypeRegisterFunction * self)1619 vala_typeregister_function_get_type_struct_name (ValaTypeRegisterFunction* self)
1620 {
1621 g_return_val_if_fail (self != NULL, NULL);
1622 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_type_struct_name (self);
1623 }
1624
1625 /**
1626 * Returns the name of the base_init function in C code.
1627 *
1628 * @return C function name
1629 */
1630 static gchar*
vala_typeregister_function_real_get_base_init_func_name(ValaTypeRegisterFunction * self)1631 vala_typeregister_function_real_get_base_init_func_name (ValaTypeRegisterFunction* self)
1632 {
1633 g_assert_not_reached ();
1634 }
1635
1636 gchar*
vala_typeregister_function_get_base_init_func_name(ValaTypeRegisterFunction * self)1637 vala_typeregister_function_get_base_init_func_name (ValaTypeRegisterFunction* self)
1638 {
1639 g_return_val_if_fail (self != NULL, NULL);
1640 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_base_init_func_name (self);
1641 }
1642
1643 /**
1644 * Returns the name of the class_finalize function in C code.
1645 *
1646 * @return C function name
1647 */
1648 static gchar*
vala_typeregister_function_real_get_class_finalize_func_name(ValaTypeRegisterFunction * self)1649 vala_typeregister_function_real_get_class_finalize_func_name (ValaTypeRegisterFunction* self)
1650 {
1651 g_assert_not_reached ();
1652 }
1653
1654 gchar*
vala_typeregister_function_get_class_finalize_func_name(ValaTypeRegisterFunction * self)1655 vala_typeregister_function_get_class_finalize_func_name (ValaTypeRegisterFunction* self)
1656 {
1657 g_return_val_if_fail (self != NULL, NULL);
1658 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_class_finalize_func_name (self);
1659 }
1660
1661 /**
1662 * Returns the name of the base_finalize function in C code.
1663 *
1664 * @return C function name
1665 */
1666 static gchar*
vala_typeregister_function_real_get_base_finalize_func_name(ValaTypeRegisterFunction * self)1667 vala_typeregister_function_real_get_base_finalize_func_name (ValaTypeRegisterFunction* self)
1668 {
1669 g_assert_not_reached ();
1670 }
1671
1672 gchar*
vala_typeregister_function_get_base_finalize_func_name(ValaTypeRegisterFunction * self)1673 vala_typeregister_function_get_base_finalize_func_name (ValaTypeRegisterFunction* self)
1674 {
1675 g_return_val_if_fail (self != NULL, NULL);
1676 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_base_finalize_func_name (self);
1677 }
1678
1679 /**
1680 * Returns the name of the class_init function in C code.
1681 *
1682 * @return C function name
1683 */
1684 static gchar*
vala_typeregister_function_real_get_class_init_func_name(ValaTypeRegisterFunction * self)1685 vala_typeregister_function_real_get_class_init_func_name (ValaTypeRegisterFunction* self)
1686 {
1687 g_assert_not_reached ();
1688 }
1689
1690 gchar*
vala_typeregister_function_get_class_init_func_name(ValaTypeRegisterFunction * self)1691 vala_typeregister_function_get_class_init_func_name (ValaTypeRegisterFunction* self)
1692 {
1693 g_return_val_if_fail (self != NULL, NULL);
1694 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_class_init_func_name (self);
1695 }
1696
1697 /**
1698 * Returns the size of the instance struct in C code.
1699 *
1700 * @return C instance struct size
1701 */
1702 static gchar*
vala_typeregister_function_real_get_instance_struct_size(ValaTypeRegisterFunction * self)1703 vala_typeregister_function_real_get_instance_struct_size (ValaTypeRegisterFunction* self)
1704 {
1705 g_assert_not_reached ();
1706 }
1707
1708 gchar*
vala_typeregister_function_get_instance_struct_size(ValaTypeRegisterFunction * self)1709 vala_typeregister_function_get_instance_struct_size (ValaTypeRegisterFunction* self)
1710 {
1711 g_return_val_if_fail (self != NULL, NULL);
1712 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_instance_struct_size (self);
1713 }
1714
1715 /**
1716 * Returns the name of the instance_init function in C code.
1717 *
1718 * @return C function name
1719 */
1720 static gchar*
vala_typeregister_function_real_get_instance_init_func_name(ValaTypeRegisterFunction * self)1721 vala_typeregister_function_real_get_instance_init_func_name (ValaTypeRegisterFunction* self)
1722 {
1723 g_assert_not_reached ();
1724 }
1725
1726 gchar*
vala_typeregister_function_get_instance_init_func_name(ValaTypeRegisterFunction * self)1727 vala_typeregister_function_get_instance_init_func_name (ValaTypeRegisterFunction* self)
1728 {
1729 g_return_val_if_fail (self != NULL, NULL);
1730 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_instance_init_func_name (self);
1731 }
1732
1733 /**
1734 * Returns the name of the parent type in C code.
1735 *
1736 * @return C function name
1737 */
1738 static gchar*
vala_typeregister_function_real_get_parent_type_name(ValaTypeRegisterFunction * self)1739 vala_typeregister_function_real_get_parent_type_name (ValaTypeRegisterFunction* self)
1740 {
1741 g_assert_not_reached ();
1742 }
1743
1744 gchar*
vala_typeregister_function_get_parent_type_name(ValaTypeRegisterFunction * self)1745 vala_typeregister_function_get_parent_type_name (ValaTypeRegisterFunction* self)
1746 {
1747 g_return_val_if_fail (self != NULL, NULL);
1748 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_parent_type_name (self);
1749 }
1750
1751 /**
1752 * Returns the C-name of the new generated GTypeValueTable init function or null when not available.
1753 *
1754 * @return C function name
1755 */
1756 static gchar*
vala_typeregister_function_real_get_gtype_value_table_init_function_name(ValaTypeRegisterFunction * self)1757 vala_typeregister_function_real_get_gtype_value_table_init_function_name (ValaTypeRegisterFunction* self)
1758 {
1759 gchar* result = NULL;
1760 result = NULL;
1761 return result;
1762 }
1763
1764 gchar*
vala_typeregister_function_get_gtype_value_table_init_function_name(ValaTypeRegisterFunction * self)1765 vala_typeregister_function_get_gtype_value_table_init_function_name (ValaTypeRegisterFunction* self)
1766 {
1767 g_return_val_if_fail (self != NULL, NULL);
1768 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_init_function_name (self);
1769 }
1770
1771 /**
1772 * Returns the C-name of the new generated GTypeValueTable peek pointer function or null when not available.
1773 *
1774 * @return C function name
1775 */
1776 static gchar*
vala_typeregister_function_real_get_gtype_value_table_peek_pointer_function_name(ValaTypeRegisterFunction * self)1777 vala_typeregister_function_real_get_gtype_value_table_peek_pointer_function_name (ValaTypeRegisterFunction* self)
1778 {
1779 gchar* result = NULL;
1780 result = NULL;
1781 return result;
1782 }
1783
1784 gchar*
vala_typeregister_function_get_gtype_value_table_peek_pointer_function_name(ValaTypeRegisterFunction * self)1785 vala_typeregister_function_get_gtype_value_table_peek_pointer_function_name (ValaTypeRegisterFunction* self)
1786 {
1787 g_return_val_if_fail (self != NULL, NULL);
1788 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_peek_pointer_function_name (self);
1789 }
1790
1791 /**
1792 * Returns the C-name of the new generated GTypeValueTable free function or null when not available.
1793 *
1794 * @return C function name
1795 */
1796 static gchar*
vala_typeregister_function_real_get_gtype_value_table_free_function_name(ValaTypeRegisterFunction * self)1797 vala_typeregister_function_real_get_gtype_value_table_free_function_name (ValaTypeRegisterFunction* self)
1798 {
1799 gchar* result = NULL;
1800 result = NULL;
1801 return result;
1802 }
1803
1804 gchar*
vala_typeregister_function_get_gtype_value_table_free_function_name(ValaTypeRegisterFunction * self)1805 vala_typeregister_function_get_gtype_value_table_free_function_name (ValaTypeRegisterFunction* self)
1806 {
1807 g_return_val_if_fail (self != NULL, NULL);
1808 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_free_function_name (self);
1809 }
1810
1811 /**
1812 * Returns the C-name of the new generated GTypeValueTable copy function or null when not available.
1813 *
1814 * @return C function name
1815 */
1816 static gchar*
vala_typeregister_function_real_get_gtype_value_table_copy_function_name(ValaTypeRegisterFunction * self)1817 vala_typeregister_function_real_get_gtype_value_table_copy_function_name (ValaTypeRegisterFunction* self)
1818 {
1819 gchar* result = NULL;
1820 result = NULL;
1821 return result;
1822 }
1823
1824 gchar*
vala_typeregister_function_get_gtype_value_table_copy_function_name(ValaTypeRegisterFunction * self)1825 vala_typeregister_function_get_gtype_value_table_copy_function_name (ValaTypeRegisterFunction* self)
1826 {
1827 g_return_val_if_fail (self != NULL, NULL);
1828 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_copy_function_name (self);
1829 }
1830
1831 /**
1832 * Returns the C-name of the new generated GTypeValueTable lcopy function or null when not available.
1833 *
1834 * @return C function name
1835 */
1836 static gchar*
vala_typeregister_function_real_get_gtype_value_table_lcopy_value_function_name(ValaTypeRegisterFunction * self)1837 vala_typeregister_function_real_get_gtype_value_table_lcopy_value_function_name (ValaTypeRegisterFunction* self)
1838 {
1839 gchar* result = NULL;
1840 result = NULL;
1841 return result;
1842 }
1843
1844 gchar*
vala_typeregister_function_get_gtype_value_table_lcopy_value_function_name(ValaTypeRegisterFunction * self)1845 vala_typeregister_function_get_gtype_value_table_lcopy_value_function_name (ValaTypeRegisterFunction* self)
1846 {
1847 g_return_val_if_fail (self != NULL, NULL);
1848 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_lcopy_value_function_name (self);
1849 }
1850
1851 /**
1852 * Returns the C-name of the new generated GTypeValueTable collect value function or null when not available.
1853 *
1854 * @return C function name
1855 */
1856 static gchar*
vala_typeregister_function_real_get_gtype_value_table_collect_value_function_name(ValaTypeRegisterFunction * self)1857 vala_typeregister_function_real_get_gtype_value_table_collect_value_function_name (ValaTypeRegisterFunction* self)
1858 {
1859 gchar* result = NULL;
1860 result = NULL;
1861 return result;
1862 }
1863
1864 gchar*
vala_typeregister_function_get_gtype_value_table_collect_value_function_name(ValaTypeRegisterFunction * self)1865 vala_typeregister_function_get_gtype_value_table_collect_value_function_name (ValaTypeRegisterFunction* self)
1866 {
1867 g_return_val_if_fail (self != NULL, NULL);
1868 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_gtype_value_table_collect_value_function_name (self);
1869 }
1870
1871 /**
1872 * Returns the set of type flags to be applied when registering.
1873 *
1874 * @return type flags
1875 */
1876 static gchar*
vala_typeregister_function_real_get_type_flags(ValaTypeRegisterFunction * self)1877 vala_typeregister_function_real_get_type_flags (ValaTypeRegisterFunction* self)
1878 {
1879 gchar* _tmp0_;
1880 gchar* result = NULL;
1881 _tmp0_ = g_strdup ("0");
1882 result = _tmp0_;
1883 return result;
1884 }
1885
1886 gchar*
vala_typeregister_function_get_type_flags(ValaTypeRegisterFunction * self)1887 vala_typeregister_function_get_type_flags (ValaTypeRegisterFunction* self)
1888 {
1889 g_return_val_if_fail (self != NULL, NULL);
1890 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_type_flags (self);
1891 }
1892
1893 /**
1894 * Returns additional C declarations to setup interfaces.
1895 *
1896 * @return C declarations
1897 */
1898 static ValaCCodeFragment*
vala_typeregister_function_real_get_type_interface_init_declaration(ValaTypeRegisterFunction * self)1899 vala_typeregister_function_real_get_type_interface_init_declaration (ValaTypeRegisterFunction* self)
1900 {
1901 ValaCCodeFragment* _tmp0_;
1902 ValaCCodeFragment* result = NULL;
1903 _tmp0_ = vala_ccode_fragment_new ();
1904 result = _tmp0_;
1905 return result;
1906 }
1907
1908 ValaCCodeFragment*
vala_typeregister_function_get_type_interface_init_declaration(ValaTypeRegisterFunction * self)1909 vala_typeregister_function_get_type_interface_init_declaration (ValaTypeRegisterFunction* self)
1910 {
1911 g_return_val_if_fail (self != NULL, NULL);
1912 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_type_interface_init_declaration (self);
1913 }
1914
1915 /**
1916 * Returns additional C initialization statements to setup interfaces.
1917 */
1918 static void
vala_typeregister_function_real_get_type_interface_init_statements(ValaTypeRegisterFunction * self,ValaCodeContext * context,ValaCCodeBlock * block,gboolean plugin)1919 vala_typeregister_function_real_get_type_interface_init_statements (ValaTypeRegisterFunction* self,
1920 ValaCodeContext* context,
1921 ValaCCodeBlock* block,
1922 gboolean plugin)
1923 {
1924 g_return_if_fail (context != NULL);
1925 g_return_if_fail (block != NULL);
1926 }
1927
1928 void
vala_typeregister_function_get_type_interface_init_statements(ValaTypeRegisterFunction * self,ValaCodeContext * context,ValaCCodeBlock * block,gboolean plugin)1929 vala_typeregister_function_get_type_interface_init_statements (ValaTypeRegisterFunction* self,
1930 ValaCodeContext* context,
1931 ValaCCodeBlock* block,
1932 gboolean plugin)
1933 {
1934 g_return_if_fail (self != NULL);
1935 VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_type_interface_init_statements (self, context, block, plugin);
1936 }
1937
1938 ValaCCodeFragment*
vala_typeregister_function_get_source_declaration(ValaTypeRegisterFunction * self)1939 vala_typeregister_function_get_source_declaration (ValaTypeRegisterFunction* self)
1940 {
1941 ValaCCodeFragment* _tmp0_;
1942 ValaCCodeFragment* _tmp1_;
1943 ValaCCodeFragment* result = NULL;
1944 g_return_val_if_fail (self != NULL, NULL);
1945 _tmp0_ = self->priv->source_declaration_fragment;
1946 _tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
1947 result = _tmp1_;
1948 return result;
1949 }
1950
1951 /**
1952 * Returns the declaration for this type register function in C code.
1953 *
1954 * @return C function declaration fragment
1955 */
1956 ValaCCodeFragment*
vala_typeregister_function_get_declaration(ValaTypeRegisterFunction * self)1957 vala_typeregister_function_get_declaration (ValaTypeRegisterFunction* self)
1958 {
1959 ValaCCodeFragment* _tmp0_;
1960 ValaCCodeFragment* _tmp1_;
1961 ValaCCodeFragment* result = NULL;
1962 g_return_val_if_fail (self != NULL, NULL);
1963 _tmp0_ = self->priv->declaration_fragment;
1964 _tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
1965 result = _tmp1_;
1966 return result;
1967 }
1968
1969 /**
1970 * Returns the definition for this type register function in C code.
1971 *
1972 * @return C function definition fragment
1973 */
1974 ValaCCodeFragment*
vala_typeregister_function_get_definition(ValaTypeRegisterFunction * self)1975 vala_typeregister_function_get_definition (ValaTypeRegisterFunction* self)
1976 {
1977 ValaCCodeFragment* _tmp0_;
1978 ValaCCodeFragment* _tmp1_;
1979 ValaCCodeFragment* result = NULL;
1980 g_return_val_if_fail (self != NULL, NULL);
1981 _tmp0_ = self->priv->definition_fragment;
1982 _tmp1_ = _vala_ccode_node_ref0 (_tmp0_);
1983 result = _tmp1_;
1984 return result;
1985 }
1986
1987 /**
1988 * Returns the accessibility for this type.
1989 */
1990 static ValaSymbolAccessibility
vala_typeregister_function_real_get_accessibility(ValaTypeRegisterFunction * self)1991 vala_typeregister_function_real_get_accessibility (ValaTypeRegisterFunction* self)
1992 {
1993 g_critical ("Type `%s' does not implement abstract method `vala_typeregister_function_get_accessibility'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
1994 return 0;
1995 }
1996
1997 ValaSymbolAccessibility
vala_typeregister_function_get_accessibility(ValaTypeRegisterFunction * self)1998 vala_typeregister_function_get_accessibility (ValaTypeRegisterFunction* self)
1999 {
2000 g_return_val_if_fail (self != NULL, 0);
2001 return VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->get_accessibility (self);
2002 }
2003
2004 ValaTypeRegisterFunction*
vala_typeregister_function_construct(GType object_type)2005 vala_typeregister_function_construct (GType object_type)
2006 {
2007 ValaTypeRegisterFunction* self = NULL;
2008 self = (ValaTypeRegisterFunction*) g_type_create_instance (object_type);
2009 return self;
2010 }
2011
2012 static void
vala_value_typeregister_function_init(GValue * value)2013 vala_value_typeregister_function_init (GValue* value)
2014 {
2015 value->data[0].v_pointer = NULL;
2016 }
2017
2018 static void
vala_value_typeregister_function_free_value(GValue * value)2019 vala_value_typeregister_function_free_value (GValue* value)
2020 {
2021 if (value->data[0].v_pointer) {
2022 vala_typeregister_function_unref (value->data[0].v_pointer);
2023 }
2024 }
2025
2026 static void
vala_value_typeregister_function_copy_value(const GValue * src_value,GValue * dest_value)2027 vala_value_typeregister_function_copy_value (const GValue* src_value,
2028 GValue* dest_value)
2029 {
2030 if (src_value->data[0].v_pointer) {
2031 dest_value->data[0].v_pointer = vala_typeregister_function_ref (src_value->data[0].v_pointer);
2032 } else {
2033 dest_value->data[0].v_pointer = NULL;
2034 }
2035 }
2036
2037 static gpointer
vala_value_typeregister_function_peek_pointer(const GValue * value)2038 vala_value_typeregister_function_peek_pointer (const GValue* value)
2039 {
2040 return value->data[0].v_pointer;
2041 }
2042
2043 static gchar*
vala_value_typeregister_function_collect_value(GValue * value,guint n_collect_values,GTypeCValue * collect_values,guint collect_flags)2044 vala_value_typeregister_function_collect_value (GValue* value,
2045 guint n_collect_values,
2046 GTypeCValue* collect_values,
2047 guint collect_flags)
2048 {
2049 if (collect_values[0].v_pointer) {
2050 ValaTypeRegisterFunction * object;
2051 object = collect_values[0].v_pointer;
2052 if (object->parent_instance.g_class == NULL) {
2053 return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
2054 } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
2055 return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
2056 }
2057 value->data[0].v_pointer = vala_typeregister_function_ref (object);
2058 } else {
2059 value->data[0].v_pointer = NULL;
2060 }
2061 return NULL;
2062 }
2063
2064 static gchar*
vala_value_typeregister_function_lcopy_value(const GValue * value,guint n_collect_values,GTypeCValue * collect_values,guint collect_flags)2065 vala_value_typeregister_function_lcopy_value (const GValue* value,
2066 guint n_collect_values,
2067 GTypeCValue* collect_values,
2068 guint collect_flags)
2069 {
2070 ValaTypeRegisterFunction ** object_p;
2071 object_p = collect_values[0].v_pointer;
2072 if (!object_p) {
2073 return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
2074 }
2075 if (!value->data[0].v_pointer) {
2076 *object_p = NULL;
2077 } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
2078 *object_p = value->data[0].v_pointer;
2079 } else {
2080 *object_p = vala_typeregister_function_ref (value->data[0].v_pointer);
2081 }
2082 return NULL;
2083 }
2084
2085 GParamSpec*
vala_param_spec_typeregister_function(const gchar * name,const gchar * nick,const gchar * blurb,GType object_type,GParamFlags flags)2086 vala_param_spec_typeregister_function (const gchar* name,
2087 const gchar* nick,
2088 const gchar* blurb,
2089 GType object_type,
2090 GParamFlags flags)
2091 {
2092 ValaParamSpecTypeRegisterFunction* spec;
2093 g_return_val_if_fail (g_type_is_a (object_type, VALA_TYPE_TYPEREGISTER_FUNCTION), NULL);
2094 spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
2095 G_PARAM_SPEC (spec)->value_type = object_type;
2096 return G_PARAM_SPEC (spec);
2097 }
2098
2099 gpointer
vala_value_get_typeregister_function(const GValue * value)2100 vala_value_get_typeregister_function (const GValue* value)
2101 {
2102 g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_TYPEREGISTER_FUNCTION), NULL);
2103 return value->data[0].v_pointer;
2104 }
2105
2106 void
vala_value_set_typeregister_function(GValue * value,gpointer v_object)2107 vala_value_set_typeregister_function (GValue* value,
2108 gpointer v_object)
2109 {
2110 ValaTypeRegisterFunction * old;
2111 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_TYPEREGISTER_FUNCTION));
2112 old = value->data[0].v_pointer;
2113 if (v_object) {
2114 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALA_TYPE_TYPEREGISTER_FUNCTION));
2115 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
2116 value->data[0].v_pointer = v_object;
2117 vala_typeregister_function_ref (value->data[0].v_pointer);
2118 } else {
2119 value->data[0].v_pointer = NULL;
2120 }
2121 if (old) {
2122 vala_typeregister_function_unref (old);
2123 }
2124 }
2125
2126 void
vala_value_take_typeregister_function(GValue * value,gpointer v_object)2127 vala_value_take_typeregister_function (GValue* value,
2128 gpointer v_object)
2129 {
2130 ValaTypeRegisterFunction * old;
2131 g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALA_TYPE_TYPEREGISTER_FUNCTION));
2132 old = value->data[0].v_pointer;
2133 if (v_object) {
2134 g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALA_TYPE_TYPEREGISTER_FUNCTION));
2135 g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
2136 value->data[0].v_pointer = v_object;
2137 } else {
2138 value->data[0].v_pointer = NULL;
2139 }
2140 if (old) {
2141 vala_typeregister_function_unref (old);
2142 }
2143 }
2144
2145 static void
vala_typeregister_function_class_init(ValaTypeRegisterFunctionClass * klass,gpointer klass_data)2146 vala_typeregister_function_class_init (ValaTypeRegisterFunctionClass * klass,
2147 gpointer klass_data)
2148 {
2149 vala_typeregister_function_parent_class = g_type_class_peek_parent (klass);
2150 ((ValaTypeRegisterFunctionClass *) klass)->finalize = vala_typeregister_function_finalize;
2151 g_type_class_adjust_private_offset (klass, &ValaTypeRegisterFunction_private_offset);
2152 ((ValaTypeRegisterFunctionClass *) klass)->get_type_declaration = (ValaTypeSymbol* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_type_declaration;
2153 ((ValaTypeRegisterFunctionClass *) klass)->get_type_struct_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_type_struct_name;
2154 ((ValaTypeRegisterFunctionClass *) klass)->get_base_init_func_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_base_init_func_name;
2155 ((ValaTypeRegisterFunctionClass *) klass)->get_class_finalize_func_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_class_finalize_func_name;
2156 ((ValaTypeRegisterFunctionClass *) klass)->get_base_finalize_func_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_base_finalize_func_name;
2157 ((ValaTypeRegisterFunctionClass *) klass)->get_class_init_func_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_class_init_func_name;
2158 ((ValaTypeRegisterFunctionClass *) klass)->get_instance_struct_size = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_instance_struct_size;
2159 ((ValaTypeRegisterFunctionClass *) klass)->get_instance_init_func_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_instance_init_func_name;
2160 ((ValaTypeRegisterFunctionClass *) klass)->get_parent_type_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_parent_type_name;
2161 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_init_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_init_function_name;
2162 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_peek_pointer_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_peek_pointer_function_name;
2163 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_free_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_free_function_name;
2164 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_copy_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_copy_function_name;
2165 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_lcopy_value_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_lcopy_value_function_name;
2166 ((ValaTypeRegisterFunctionClass *) klass)->get_gtype_value_table_collect_value_function_name = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_gtype_value_table_collect_value_function_name;
2167 ((ValaTypeRegisterFunctionClass *) klass)->get_type_flags = (gchar* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_type_flags;
2168 ((ValaTypeRegisterFunctionClass *) klass)->get_type_interface_init_declaration = (ValaCCodeFragment* (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_type_interface_init_declaration;
2169 ((ValaTypeRegisterFunctionClass *) klass)->get_type_interface_init_statements = (void (*) (ValaTypeRegisterFunction*, ValaCodeContext*, ValaCCodeBlock*, gboolean)) vala_typeregister_function_real_get_type_interface_init_statements;
2170 ((ValaTypeRegisterFunctionClass *) klass)->get_accessibility = (ValaSymbolAccessibility (*) (ValaTypeRegisterFunction*)) vala_typeregister_function_real_get_accessibility;
2171 }
2172
2173 static void
vala_typeregister_function_instance_init(ValaTypeRegisterFunction * self,gpointer klass)2174 vala_typeregister_function_instance_init (ValaTypeRegisterFunction * self,
2175 gpointer klass)
2176 {
2177 ValaCCodeFragment* _tmp0_;
2178 ValaCCodeFragment* _tmp1_;
2179 ValaCCodeFragment* _tmp2_;
2180 self->priv = vala_typeregister_function_get_instance_private (self);
2181 _tmp0_ = vala_ccode_fragment_new ();
2182 self->priv->source_declaration_fragment = _tmp0_;
2183 _tmp1_ = vala_ccode_fragment_new ();
2184 self->priv->declaration_fragment = _tmp1_;
2185 _tmp2_ = vala_ccode_fragment_new ();
2186 self->priv->definition_fragment = _tmp2_;
2187 self->ref_count = 1;
2188 }
2189
2190 static void
vala_typeregister_function_finalize(ValaTypeRegisterFunction * obj)2191 vala_typeregister_function_finalize (ValaTypeRegisterFunction * obj)
2192 {
2193 ValaTypeRegisterFunction * self;
2194 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunction);
2195 g_signal_handlers_destroy (self);
2196 _vala_ccode_node_unref0 (self->priv->source_declaration_fragment);
2197 _vala_ccode_node_unref0 (self->priv->declaration_fragment);
2198 _vala_ccode_node_unref0 (self->priv->definition_fragment);
2199 }
2200
2201 /**
2202 * C function to register a type at runtime.
2203 */
2204 static GType
vala_typeregister_function_get_type_once(void)2205 vala_typeregister_function_get_type_once (void)
2206 {
2207 static const GTypeValueTable g_define_type_value_table = { vala_value_typeregister_function_init, vala_value_typeregister_function_free_value, vala_value_typeregister_function_copy_value, vala_value_typeregister_function_peek_pointer, "p", vala_value_typeregister_function_collect_value, "p", vala_value_typeregister_function_lcopy_value };
2208 static const GTypeInfo g_define_type_info = { sizeof (ValaTypeRegisterFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_typeregister_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaTypeRegisterFunction), 0, (GInstanceInitFunc) vala_typeregister_function_instance_init, &g_define_type_value_table };
2209 static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
2210 GType vala_typeregister_function_type_id;
2211 vala_typeregister_function_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ValaTypeRegisterFunction", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
2212 ValaTypeRegisterFunction_private_offset = g_type_add_instance_private (vala_typeregister_function_type_id, sizeof (ValaTypeRegisterFunctionPrivate));
2213 return vala_typeregister_function_type_id;
2214 }
2215
2216 GType
vala_typeregister_function_get_type(void)2217 vala_typeregister_function_get_type (void)
2218 {
2219 static volatile gsize vala_typeregister_function_type_id__volatile = 0;
2220 if (g_once_init_enter (&vala_typeregister_function_type_id__volatile)) {
2221 GType vala_typeregister_function_type_id;
2222 vala_typeregister_function_type_id = vala_typeregister_function_get_type_once ();
2223 g_once_init_leave (&vala_typeregister_function_type_id__volatile, vala_typeregister_function_type_id);
2224 }
2225 return vala_typeregister_function_type_id__volatile;
2226 }
2227
2228 gpointer
vala_typeregister_function_ref(gpointer instance)2229 vala_typeregister_function_ref (gpointer instance)
2230 {
2231 ValaTypeRegisterFunction * self;
2232 self = instance;
2233 g_atomic_int_inc (&self->ref_count);
2234 return instance;
2235 }
2236
2237 void
vala_typeregister_function_unref(gpointer instance)2238 vala_typeregister_function_unref (gpointer instance)
2239 {
2240 ValaTypeRegisterFunction * self;
2241 self = instance;
2242 if (g_atomic_int_dec_and_test (&self->ref_count)) {
2243 VALA_TYPEREGISTER_FUNCTION_GET_CLASS (self)->finalize (self);
2244 g_type_free_instance ((GTypeInstance *) self);
2245 }
2246 }
2247
2248