~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to vapigen/valavapigen.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-17 09:35:15 UTC
  • mfrom: (1.5.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20110317093515-veyqriw9egujkws2
Tags: 0.11.7-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
}
179
179
 
180
180
 
 
181
static glong string_strnlen (gchar* str, glong maxlen) {
 
182
        glong result = 0L;
 
183
        gchar* _tmp0_ = NULL;
 
184
        gchar* end;
 
185
        _tmp0_ = memchr (str, 0, (gsize) maxlen);
 
186
        end = _tmp0_;
 
187
        if (end == NULL) {
 
188
                result = maxlen;
 
189
                return result;
 
190
        } else {
 
191
                result = (glong) (end - str);
 
192
                return result;
 
193
        }
 
194
}
 
195
 
 
196
 
181
197
static gchar* string_substring (const gchar* self, glong offset, glong len) {
182
198
        gchar* result = NULL;
183
199
        glong string_length = 0L;
191
207
        }
192
208
        if (_tmp0_) {
193
209
                glong _tmp1_;
194
 
                _tmp1_ = strnlen ((gchar*) self, (gsize) (offset + len));
 
210
                _tmp1_ = string_strnlen ((gchar*) self, offset + len);
195
211
                string_length = _tmp1_;
196
212
        } else {
197
213
                gint _tmp2_;
228
244
static gint vala_vapi_gen_run (ValaVAPIGen* self) {
229
245
        gint result = 0;
230
246
        ValaCodeContext* _tmp0_ = NULL;
231
 
        ValaCodeContext* _tmp1_;
 
247
        gchar** _tmp1_;
232
248
        gchar** _tmp2_;
233
249
        gchar** _tmp3_;
234
250
        gchar** _tmp4_;
235
 
        gchar** _tmp5_;
236
 
        gchar** _tmp6_;
237
 
        gchar** _tmp7_;
238
 
        ValaReport* _tmp8_ = NULL;
239
 
        ValaReport* _tmp9_ = NULL;
240
 
        ValaReport* _tmp10_ = NULL;
241
 
        gint _tmp11_;
242
 
        ValaReport* _tmp20_ = NULL;
243
 
        gint _tmp21_;
244
 
        ValaReport* _tmp23_ = NULL;
245
 
        gint _tmp24_;
246
 
        ValaReport* _tmp28_ = NULL;
247
 
        gint _tmp29_;
248
 
        ValaReport* _tmp37_ = NULL;
249
 
        gint _tmp38_;
250
 
        ValaParser* _tmp40_ = NULL;
 
251
        ValaReport* _tmp5_ = NULL;
 
252
        ValaReport* _tmp6_ = NULL;
 
253
        ValaReport* _tmp7_ = NULL;
 
254
        gint _tmp8_;
 
255
        ValaReport* _tmp18_ = NULL;
 
256
        gint _tmp19_;
 
257
        ValaReport* _tmp22_ = NULL;
 
258
        gint _tmp23_;
 
259
        ValaReport* _tmp26_ = NULL;
 
260
        gint _tmp27_;
 
261
        ValaReport* _tmp35_ = NULL;
 
262
        gint _tmp36_;
 
263
        ValaParser* _tmp38_ = NULL;
251
264
        ValaParser* parser;
252
 
        ValaReport* _tmp41_ = NULL;
253
 
        gint _tmp42_;
254
 
        ValaGirParser* _tmp44_ = NULL;
 
265
        ValaReport* _tmp39_ = NULL;
 
266
        gint _tmp40_;
 
267
        ValaGirParser* _tmp42_ = NULL;
255
268
        ValaGirParser* girparser;
256
 
        ValaReport* _tmp45_ = NULL;
257
 
        gint _tmp46_;
258
 
        ValaGIdlParser* _tmp48_ = NULL;
 
269
        ValaReport* _tmp43_ = NULL;
 
270
        gint _tmp44_;
 
271
        ValaGIdlParser* _tmp46_ = NULL;
259
272
        ValaGIdlParser* gidlparser;
260
 
        ValaReport* _tmp49_ = NULL;
261
 
        gint _tmp50_;
262
 
        ValaReport* _tmp52_ = NULL;
263
 
        gint _tmp53_;
264
 
        ValaCodeWriter* _tmp71_ = NULL;
 
273
        ValaReport* _tmp47_ = NULL;
 
274
        gint _tmp48_;
 
275
        ValaReport* _tmp50_ = NULL;
 
276
        gint _tmp51_;
 
277
        ValaCodeWriter* _tmp69_ = NULL;
265
278
        ValaCodeWriter* interface_writer;
266
 
        gchar* _tmp72_ = NULL;
 
279
        gchar* _tmp70_ = NULL;
267
280
        gchar* vapi_filename;
268
 
        gchar* _tmp75_;
269
 
        gint _tmp76_;
 
281
        gint _tmp72_;
270
282
        g_return_val_if_fail (self != NULL, 0);
271
283
        _tmp0_ = vala_code_context_new ();
272
 
        _tmp1_ = _tmp0_;
273
284
        _vala_code_context_unref0 (self->priv->context);
274
 
        self->priv->context = _tmp1_;
 
285
        self->priv->context = _tmp0_;
275
286
        vala_code_context_set_profile (self->priv->context, VALA_PROFILE_GOBJECT);
276
 
        _tmp2_ = (_tmp3_ = vala_vapi_gen_vapi_directories, (_tmp3_ == NULL) ? ((gpointer) _tmp3_) : _vala_array_dup1 (_tmp3_, _vala_array_length (vala_vapi_gen_vapi_directories)));
277
 
        _tmp4_ = _tmp2_;
 
287
        _tmp1_ = (_tmp2_ = vala_vapi_gen_vapi_directories, (_tmp2_ == NULL) ? ((gpointer) _tmp2_) : _vala_array_dup1 (_tmp2_, _vala_array_length (vala_vapi_gen_vapi_directories)));
278
288
        self->priv->context->vapi_directories = (_vala_array_free (self->priv->context->vapi_directories, self->priv->context->vapi_directories_length1, (GDestroyNotify) g_free), NULL);
 
289
        self->priv->context->vapi_directories = _tmp1_;
279
290
        self->priv->context->vapi_directories_length1 = _vala_array_length (vala_vapi_gen_vapi_directories);
280
 
        self->priv->context->vapi_directories = _tmp4_;
281
 
        _tmp5_ = (_tmp6_ = vala_vapi_gen_gir_directories, (_tmp6_ == NULL) ? ((gpointer) _tmp6_) : _vala_array_dup2 (_tmp6_, _vala_array_length (vala_vapi_gen_gir_directories)));
282
 
        _tmp7_ = _tmp5_;
 
291
        _tmp3_ = (_tmp4_ = vala_vapi_gen_gir_directories, (_tmp4_ == NULL) ? ((gpointer) _tmp4_) : _vala_array_dup2 (_tmp4_, _vala_array_length (vala_vapi_gen_gir_directories)));
283
292
        self->priv->context->gir_directories = (_vala_array_free (self->priv->context->gir_directories, self->priv->context->gir_directories_length1, (GDestroyNotify) g_free), NULL);
 
293
        self->priv->context->gir_directories = _tmp3_;
284
294
        self->priv->context->gir_directories_length1 = _vala_array_length (vala_vapi_gen_gir_directories);
285
 
        self->priv->context->gir_directories = _tmp7_;
286
 
        _tmp8_ = vala_code_context_get_report (self->priv->context);
287
 
        vala_report_set_enable_warnings (_tmp8_, !vala_vapi_gen_disable_warnings);
288
 
        _tmp9_ = vala_code_context_get_report (self->priv->context);
289
 
        vala_report_set_verbose_errors (_tmp9_, !vala_vapi_gen_quiet_mode);
 
295
        _tmp5_ = vala_code_context_get_report (self->priv->context);
 
296
        vala_report_set_enable_warnings (_tmp5_, !vala_vapi_gen_disable_warnings);
 
297
        _tmp6_ = vala_code_context_get_report (self->priv->context);
 
298
        vala_report_set_verbose_errors (_tmp6_, !vala_vapi_gen_quiet_mode);
290
299
        vala_code_context_push (self->priv->context);
291
300
        vala_code_context_add_external_package (self->priv->context, "glib-2.0");
292
301
        vala_code_context_add_external_package (self->priv->context, "gobject-2.0");
293
 
        _tmp10_ = vala_code_context_get_report (self->priv->context);
294
 
        _tmp11_ = vala_report_get_errors (_tmp10_);
295
 
        if (_tmp11_ > 0) {
296
 
                gint _tmp12_;
297
 
                _tmp12_ = vala_vapi_gen_quit (self);
298
 
                result = _tmp12_;
 
302
        _tmp7_ = vala_code_context_get_report (self->priv->context);
 
303
        _tmp8_ = vala_report_get_errors (_tmp7_);
 
304
        if (_tmp8_ > 0) {
 
305
                gint _tmp9_;
 
306
                _tmp9_ = vala_vapi_gen_quit (self);
 
307
                result = _tmp9_;
299
308
                return result;
300
309
        }
301
310
        {
305
314
                source_collection = vala_vapi_gen_sources;
306
315
                source_collection_length1 = _vala_array_length (vala_vapi_gen_sources);
307
316
                for (source_it = 0; source_it < _vala_array_length (vala_vapi_gen_sources); source_it = source_it + 1) {
308
 
                        gchar* _tmp13_;
 
317
                        gchar* _tmp10_;
309
318
                        gchar* source;
310
 
                        _tmp13_ = g_strdup (source_collection[source_it]);
311
 
                        source = _tmp13_;
 
319
                        _tmp10_ = g_strdup (source_collection[source_it]);
 
320
                        source = _tmp10_;
312
321
                        {
313
 
                                gboolean _tmp14_;
314
 
                                gint _tmp15_;
315
 
                                gint _tmp16_;
316
 
                                gchar* _tmp17_ = NULL;
317
 
                                gchar* _tmp18_;
318
 
                                gchar* _tmp19_;
 
322
                                gboolean _tmp11_;
 
323
                                gint _tmp12_;
 
324
                                gint _tmp13_;
 
325
                                gchar* _tmp14_ = NULL;
 
326
                                gchar* _tmp15_;
 
327
                                gchar* _tmp16_;
 
328
                                gchar* _tmp17_;
319
329
                                gchar* depsfile;
320
 
                                _tmp14_ = g_str_has_suffix (source, ".gi");
321
 
                                if (!_tmp14_) {
 
330
                                _tmp11_ = g_str_has_suffix (source, ".gi");
 
331
                                if (!_tmp11_) {
322
332
                                        _g_free0 (source);
323
333
                                        continue;
324
334
                                }
325
 
                                _tmp15_ = strlen (source);
326
 
                                _tmp16_ = strlen ("gi");
327
 
                                _tmp17_ = string_substring (source, (glong) 0, (glong) (_tmp15_ - _tmp16_));
328
 
                                _tmp18_ = _tmp17_;
329
 
                                depsfile = (_tmp19_ = g_strconcat (_tmp18_, "deps", NULL), _g_free0 (_tmp18_), _tmp19_);
 
335
                                _tmp12_ = strlen (source);
 
336
                                _tmp13_ = strlen ("gi");
 
337
                                _tmp14_ = string_substring (source, (glong) 0, (glong) (_tmp12_ - _tmp13_));
 
338
                                _tmp15_ = _tmp14_;
 
339
                                _tmp16_ = g_strconcat (_tmp15_, "deps", NULL);
 
340
                                _tmp17_ = _tmp16_;
 
341
                                _g_free0 (_tmp15_);
 
342
                                depsfile = _tmp17_;
330
343
                                vala_code_context_add_packages_from_file (self->priv->context, depsfile);
331
344
                                _g_free0 (depsfile);
332
345
                                _g_free0 (source);
333
346
                        }
334
347
                }
335
348
        }
336
 
        _tmp20_ = vala_code_context_get_report (self->priv->context);
337
 
        _tmp21_ = vala_report_get_errors (_tmp20_);
338
 
        if (_tmp21_ > 0) {
339
 
                gint _tmp22_;
340
 
                _tmp22_ = vala_vapi_gen_quit (self);
341
 
                result = _tmp22_;
 
349
        _tmp18_ = vala_code_context_get_report (self->priv->context);
 
350
        _tmp19_ = vala_report_get_errors (_tmp18_);
 
351
        if (_tmp19_ > 0) {
 
352
                gint _tmp20_;
 
353
                _tmp20_ = vala_vapi_gen_quit (self);
 
354
                result = _tmp20_;
342
355
                return result;
343
356
        }
344
357
        if (vala_vapi_gen_library != NULL) {
 
358
                gchar* _tmp21_;
345
359
                gchar* depsfile;
346
 
                depsfile = g_strconcat (vala_vapi_gen_library, ".deps", NULL);
 
360
                _tmp21_ = g_strconcat (vala_vapi_gen_library, ".deps", NULL);
 
361
                depsfile = _tmp21_;
347
362
                vala_code_context_add_packages_from_file (self->priv->context, depsfile);
348
363
                _g_free0 (depsfile);
349
364
        } else {
350
365
                vala_report_error (NULL, "--library option must be specified");
351
366
        }
352
 
        _tmp23_ = vala_code_context_get_report (self->priv->context);
353
 
        _tmp24_ = vala_report_get_errors (_tmp23_);
354
 
        if (_tmp24_ > 0) {
355
 
                gint _tmp25_;
356
 
                _tmp25_ = vala_vapi_gen_quit (self);
357
 
                result = _tmp25_;
 
367
        _tmp22_ = vala_code_context_get_report (self->priv->context);
 
368
        _tmp23_ = vala_report_get_errors (_tmp22_);
 
369
        if (_tmp23_ > 0) {
 
370
                gint _tmp24_;
 
371
                _tmp24_ = vala_vapi_gen_quit (self);
 
372
                result = _tmp24_;
358
373
                return result;
359
374
        }
360
375
        if (vala_vapi_gen_packages != NULL) {
361
 
                gchar** _tmp27_;
362
376
                {
363
377
                        gchar** package_collection;
364
378
                        int package_collection_length1;
366
380
                        package_collection = vala_vapi_gen_packages;
367
381
                        package_collection_length1 = _vala_array_length (vala_vapi_gen_packages);
368
382
                        for (package_it = 0; package_it < _vala_array_length (vala_vapi_gen_packages); package_it = package_it + 1) {
369
 
                                gchar* _tmp26_;
 
383
                                gchar* _tmp25_;
370
384
                                gchar* package;
371
 
                                _tmp26_ = g_strdup (package_collection[package_it]);
372
 
                                package = _tmp26_;
 
385
                                _tmp25_ = g_strdup (package_collection[package_it]);
 
386
                                package = _tmp25_;
373
387
                                {
374
388
                                        vala_code_context_add_external_package (self->priv->context, package);
375
389
                                        _g_free0 (package);
376
390
                                }
377
391
                        }
378
392
                }
379
 
                _tmp27_ = NULL;
380
 
                vala_vapi_gen_packages = (_vala_array_free (vala_vapi_gen_packages, _vala_array_length (vala_vapi_gen_packages), (GDestroyNotify) g_free), NULL);
381
 
                vala_vapi_gen_packages = _tmp27_;
 
393
                vala_vapi_gen_packages = (g_free (vala_vapi_gen_packages), NULL);
 
394
                vala_vapi_gen_packages = NULL;
382
395
        }
383
 
        _tmp28_ = vala_code_context_get_report (self->priv->context);
384
 
        _tmp29_ = vala_report_get_errors (_tmp28_);
385
 
        if (_tmp29_ > 0) {
386
 
                gint _tmp30_;
387
 
                _tmp30_ = vala_vapi_gen_quit (self);
388
 
                result = _tmp30_;
 
396
        _tmp26_ = vala_code_context_get_report (self->priv->context);
 
397
        _tmp27_ = vala_report_get_errors (_tmp26_);
 
398
        if (_tmp27_ > 0) {
 
399
                gint _tmp28_;
 
400
                _tmp28_ = vala_vapi_gen_quit (self);
 
401
                result = _tmp28_;
389
402
                return result;
390
403
        }
391
404
        {
395
408
                source_collection = vala_vapi_gen_sources;
396
409
                source_collection_length1 = _vala_array_length (vala_vapi_gen_sources);
397
410
                for (source_it = 0; source_it < _vala_array_length (vala_vapi_gen_sources); source_it = source_it + 1) {
398
 
                        gchar* _tmp31_;
 
411
                        gchar* _tmp29_;
399
412
                        gchar* source;
400
 
                        _tmp31_ = g_strdup (source_collection[source_it]);
401
 
                        source = _tmp31_;
 
413
                        _tmp29_ = g_strdup (source_collection[source_it]);
 
414
                        source = _tmp29_;
402
415
                        {
403
 
                                gboolean _tmp32_;
404
 
                                _tmp32_ = g_file_test (source, G_FILE_TEST_EXISTS);
405
 
                                if (_tmp32_) {
406
 
                                        ValaSourceFile* _tmp33_ = NULL;
407
 
                                        ValaSourceFile* _tmp34_;
408
 
                                        _tmp33_ = vala_source_file_new (self->priv->context, VALA_SOURCE_FILE_TYPE_PACKAGE, source, NULL);
 
416
                                gboolean _tmp30_;
 
417
                                _tmp30_ = g_file_test (source, G_FILE_TEST_EXISTS);
 
418
                                if (_tmp30_) {
 
419
                                        ValaSourceFile* _tmp31_ = NULL;
 
420
                                        ValaSourceFile* _tmp32_;
 
421
                                        _tmp31_ = vala_source_file_new (self->priv->context, VALA_SOURCE_FILE_TYPE_PACKAGE, source, NULL);
 
422
                                        _tmp32_ = _tmp31_;
 
423
                                        vala_code_context_add_source_file (self->priv->context, _tmp32_);
 
424
                                        _vala_source_file_unref0 (_tmp32_);
 
425
                                } else {
 
426
                                        gchar* _tmp33_ = NULL;
 
427
                                        gchar* _tmp34_;
 
428
                                        _tmp33_ = g_strdup_printf ("%s not found", source);
409
429
                                        _tmp34_ = _tmp33_;
410
 
                                        vala_code_context_add_source_file (self->priv->context, _tmp34_);
411
 
                                        _vala_source_file_unref0 (_tmp34_);
412
 
                                } else {
413
 
                                        gchar* _tmp35_ = NULL;
414
 
                                        gchar* _tmp36_;
415
 
                                        _tmp35_ = g_strdup_printf ("%s not found", source);
416
 
                                        _tmp36_ = _tmp35_;
417
 
                                        vala_report_error (NULL, _tmp36_);
418
 
                                        _g_free0 (_tmp36_);
 
430
                                        vala_report_error (NULL, _tmp34_);
 
431
                                        _g_free0 (_tmp34_);
419
432
                                }
420
433
                                _g_free0 (source);
421
434
                        }
422
435
                }
423
436
        }
424
 
        _tmp37_ = vala_code_context_get_report (self->priv->context);
425
 
        _tmp38_ = vala_report_get_errors (_tmp37_);
426
 
        if (_tmp38_ > 0) {
427
 
                gint _tmp39_;
428
 
                _tmp39_ = vala_vapi_gen_quit (self);
429
 
                result = _tmp39_;
 
437
        _tmp35_ = vala_code_context_get_report (self->priv->context);
 
438
        _tmp36_ = vala_report_get_errors (_tmp35_);
 
439
        if (_tmp36_ > 0) {
 
440
                gint _tmp37_;
 
441
                _tmp37_ = vala_vapi_gen_quit (self);
 
442
                result = _tmp37_;
430
443
                return result;
431
444
        }
432
 
        _tmp40_ = vala_parser_new ();
433
 
        parser = _tmp40_;
 
445
        _tmp38_ = vala_parser_new ();
 
446
        parser = _tmp38_;
434
447
        vala_parser_parse (parser, self->priv->context);
435
 
        _tmp41_ = vala_code_context_get_report (self->priv->context);
436
 
        _tmp42_ = vala_report_get_errors (_tmp41_);
437
 
        if (_tmp42_ > 0) {
438
 
                gint _tmp43_;
439
 
                _tmp43_ = vala_vapi_gen_quit (self);
440
 
                result = _tmp43_;
 
448
        _tmp39_ = vala_code_context_get_report (self->priv->context);
 
449
        _tmp40_ = vala_report_get_errors (_tmp39_);
 
450
        if (_tmp40_ > 0) {
 
451
                gint _tmp41_;
 
452
                _tmp41_ = vala_vapi_gen_quit (self);
 
453
                result = _tmp41_;
441
454
                _vala_code_visitor_unref0 (parser);
442
455
                return result;
443
456
        }
444
 
        _tmp44_ = vala_gir_parser_new ();
445
 
        girparser = _tmp44_;
 
457
        _tmp42_ = vala_gir_parser_new ();
 
458
        girparser = _tmp42_;
446
459
        vala_gir_parser_parse (girparser, self->priv->context);
447
 
        _tmp45_ = vala_code_context_get_report (self->priv->context);
448
 
        _tmp46_ = vala_report_get_errors (_tmp45_);
449
 
        if (_tmp46_ > 0) {
450
 
                gint _tmp47_;
451
 
                _tmp47_ = vala_vapi_gen_quit (self);
452
 
                result = _tmp47_;
 
460
        _tmp43_ = vala_code_context_get_report (self->priv->context);
 
461
        _tmp44_ = vala_report_get_errors (_tmp43_);
 
462
        if (_tmp44_ > 0) {
 
463
                gint _tmp45_;
 
464
                _tmp45_ = vala_vapi_gen_quit (self);
 
465
                result = _tmp45_;
453
466
                _vala_code_visitor_unref0 (girparser);
454
467
                _vala_code_visitor_unref0 (parser);
455
468
                return result;
456
469
        }
457
 
        _tmp48_ = vala_gidl_parser_new ();
458
 
        gidlparser = _tmp48_;
 
470
        _tmp46_ = vala_gidl_parser_new ();
 
471
        gidlparser = _tmp46_;
459
472
        vala_gidl_parser_parse (gidlparser, self->priv->context);
460
 
        _tmp49_ = vala_code_context_get_report (self->priv->context);
461
 
        _tmp50_ = vala_report_get_errors (_tmp49_);
462
 
        if (_tmp50_ > 0) {
463
 
                gint _tmp51_;
464
 
                _tmp51_ = vala_vapi_gen_quit (self);
465
 
                result = _tmp51_;
 
473
        _tmp47_ = vala_code_context_get_report (self->priv->context);
 
474
        _tmp48_ = vala_report_get_errors (_tmp47_);
 
475
        if (_tmp48_ > 0) {
 
476
                gint _tmp49_;
 
477
                _tmp49_ = vala_vapi_gen_quit (self);
 
478
                result = _tmp49_;
466
479
                _vala_code_visitor_unref0 (gidlparser);
467
480
                _vala_code_visitor_unref0 (girparser);
468
481
                _vala_code_visitor_unref0 (parser);
469
482
                return result;
470
483
        }
471
484
        vala_code_context_check (self->priv->context);
472
 
        _tmp52_ = vala_code_context_get_report (self->priv->context);
473
 
        _tmp53_ = vala_report_get_errors (_tmp52_);
474
 
        if (_tmp53_ > 0) {
 
485
        _tmp50_ = vala_code_context_get_report (self->priv->context);
 
486
        _tmp51_ = vala_report_get_errors (_tmp50_);
 
487
        if (_tmp51_ > 0) {
 
488
                gint _tmp52_;
 
489
                _tmp52_ = vala_vapi_gen_quit (self);
 
490
                result = _tmp52_;
 
491
                _vala_code_visitor_unref0 (gidlparser);
 
492
                _vala_code_visitor_unref0 (girparser);
 
493
                _vala_code_visitor_unref0 (parser);
 
494
                return result;
 
495
        }
 
496
        {
 
497
                ValaList* _tmp53_ = NULL;
 
498
                ValaList* _file_list;
475
499
                gint _tmp54_;
476
 
                _tmp54_ = vala_vapi_gen_quit (self);
477
 
                result = _tmp54_;
478
 
                _vala_code_visitor_unref0 (gidlparser);
479
 
                _vala_code_visitor_unref0 (girparser);
480
 
                _vala_code_visitor_unref0 (parser);
481
 
                return result;
482
 
        }
483
 
        {
484
 
                ValaList* _tmp55_ = NULL;
485
 
                ValaList* _file_list;
486
 
                gint _tmp56_;
487
500
                gint _file_size;
488
501
                gint _file_index;
489
 
                _tmp55_ = vala_code_context_get_source_files (self->priv->context);
490
 
                _file_list = _tmp55_;
491
 
                _tmp56_ = vala_collection_get_size ((ValaCollection*) _file_list);
492
 
                _file_size = _tmp56_;
 
502
                _tmp53_ = vala_code_context_get_source_files (self->priv->context);
 
503
                _file_list = _tmp53_;
 
504
                _tmp54_ = vala_collection_get_size ((ValaCollection*) _file_list);
 
505
                _file_size = _tmp54_;
493
506
                _file_index = -1;
494
507
                while (TRUE) {
495
 
                        gpointer _tmp57_ = NULL;
 
508
                        gpointer _tmp55_ = NULL;
496
509
                        ValaSourceFile* file;
 
510
                        const gchar* _tmp56_ = NULL;
 
511
                        gboolean _tmp57_;
497
512
                        const gchar* _tmp58_ = NULL;
498
 
                        gboolean _tmp59_;
499
 
                        const gchar* _tmp60_ = NULL;
500
513
                        _file_index = _file_index + 1;
501
514
                        if (!(_file_index < _file_size)) {
502
515
                                break;
503
516
                        }
504
 
                        _tmp57_ = vala_list_get (_file_list, _file_index);
505
 
                        file = (ValaSourceFile*) _tmp57_;
506
 
                        _tmp58_ = vala_source_file_get_filename (file);
507
 
                        _tmp59_ = g_str_has_suffix (_tmp58_, ".vapi");
508
 
                        if (_tmp59_) {
 
517
                        _tmp55_ = vala_list_get (_file_list, _file_index);
 
518
                        file = (ValaSourceFile*) _tmp55_;
 
519
                        _tmp56_ = vala_source_file_get_filename (file);
 
520
                        _tmp57_ = g_str_has_suffix (_tmp56_, ".vapi");
 
521
                        if (_tmp57_) {
509
522
                                _vala_source_file_unref0 (file);
510
523
                                continue;
511
524
                        }
512
 
                        _tmp60_ = vala_source_file_get_filename (file);
513
 
                        if (_vala_string_array_contains (vala_vapi_gen_sources, _vala_array_length (vala_vapi_gen_sources), _tmp60_)) {
 
525
                        _tmp58_ = vala_source_file_get_filename (file);
 
526
                        if (_vala_string_array_contains (vala_vapi_gen_sources, _vala_array_length (vala_vapi_gen_sources), _tmp58_)) {
514
527
                                vala_source_file_set_file_type (file, VALA_SOURCE_FILE_TYPE_SOURCE);
515
528
                        } else {
516
 
                                const gchar* _tmp61_ = NULL;
517
 
                                gboolean _tmp62_;
518
 
                                _tmp61_ = vala_source_file_get_filename (file);
519
 
                                _tmp62_ = g_str_has_suffix (_tmp61_, ".metadata");
520
 
                                if (_tmp62_) {
521
 
                                        const gchar* _tmp63_ = NULL;
522
 
                                        const gchar* _tmp64_ = NULL;
523
 
                                        gint _tmp65_;
524
 
                                        gint _tmp66_;
 
529
                                const gchar* _tmp59_ = NULL;
 
530
                                gboolean _tmp60_;
 
531
                                _tmp59_ = vala_source_file_get_filename (file);
 
532
                                _tmp60_ = g_str_has_suffix (_tmp59_, ".metadata");
 
533
                                if (_tmp60_) {
 
534
                                        const gchar* _tmp61_ = NULL;
 
535
                                        const gchar* _tmp62_ = NULL;
 
536
                                        gint _tmp63_;
 
537
                                        gint _tmp64_;
 
538
                                        gchar* _tmp65_ = NULL;
 
539
                                        gchar* _tmp66_;
525
540
                                        gchar* _tmp67_ = NULL;
526
541
                                        gchar* _tmp68_;
527
 
                                        gchar* _tmp69_ = NULL;
528
 
                                        gchar* _tmp70_;
529
542
                                        gchar* gir_filename;
530
 
                                        _tmp63_ = vala_source_file_get_filename (file);
531
 
                                        _tmp64_ = vala_source_file_get_filename (file);
532
 
                                        _tmp65_ = strlen (_tmp64_);
533
 
                                        _tmp66_ = strlen (".metadata");
534
 
                                        _tmp67_ = string_substring (_tmp63_, (glong) 0, (glong) (_tmp65_ - _tmp66_));
 
543
                                        _tmp61_ = vala_source_file_get_filename (file);
 
544
                                        _tmp62_ = vala_source_file_get_filename (file);
 
545
                                        _tmp63_ = strlen (_tmp62_);
 
546
                                        _tmp64_ = strlen (".metadata");
 
547
                                        _tmp65_ = string_substring (_tmp61_, (glong) 0, (glong) (_tmp63_ - _tmp64_));
 
548
                                        _tmp66_ = _tmp65_;
 
549
                                        _tmp67_ = g_strdup_printf ("%s.gir", _tmp66_);
535
550
                                        _tmp68_ = _tmp67_;
536
 
                                        _tmp69_ = g_strdup_printf ("%s.gir", _tmp68_);
537
 
                                        gir_filename = (_tmp70_ = _tmp69_, _g_free0 (_tmp68_), _tmp70_);
 
551
                                        _g_free0 (_tmp66_);
 
552
                                        gir_filename = _tmp68_;
538
553
                                        if (_vala_string_array_contains (vala_vapi_gen_sources, _vala_array_length (vala_vapi_gen_sources), gir_filename)) {
539
554
                                                vala_source_file_set_file_type (file, VALA_SOURCE_FILE_TYPE_SOURCE);
540
555
                                        }
545
560
                }
546
561
                _vala_iterable_unref0 (_file_list);
547
562
        }
548
 
        _tmp71_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_EXTERNAL);
549
 
        interface_writer = _tmp71_;
550
 
        _tmp72_ = g_strdup_printf ("%s.vapi", vala_vapi_gen_library);
551
 
        vapi_filename = _tmp72_;
 
563
        _tmp69_ = vala_code_writer_new (VALA_CODE_WRITER_TYPE_EXTERNAL);
 
564
        interface_writer = _tmp69_;
 
565
        _tmp70_ = g_strdup_printf ("%s.vapi", vala_vapi_gen_library);
 
566
        vapi_filename = _tmp70_;
552
567
        if (vala_vapi_gen_directory != NULL) {
553
 
                gchar* _tmp73_ = NULL;
554
 
                gchar* _tmp74_;
555
 
                _tmp73_ = g_build_filename (vala_vapi_gen_directory, vapi_filename, NULL);
556
 
                _tmp74_ = _tmp73_;
 
568
                gchar* _tmp71_ = NULL;
 
569
                _tmp71_ = g_build_filename (vala_vapi_gen_directory, vapi_filename, NULL);
557
570
                _g_free0 (vapi_filename);
558
 
                vapi_filename = _tmp74_;
 
571
                vapi_filename = _tmp71_;
559
572
        }
560
573
        vala_code_writer_write_file (interface_writer, self->priv->context, vapi_filename);
561
 
        _tmp75_ = NULL;
562
574
        _g_free0 (vala_vapi_gen_library);
563
 
        vala_vapi_gen_library = _tmp75_;
564
 
        _tmp76_ = vala_vapi_gen_quit (self);
565
 
        result = _tmp76_;
 
575
        vala_vapi_gen_library = NULL;
 
576
        _tmp72_ = vala_vapi_gen_quit (self);
 
577
        result = _tmp72_;
566
578
        _g_free0 (vapi_filename);
567
579
        _vala_code_visitor_unref0 (interface_writer);
568
580
        _vala_code_visitor_unref0 (gidlparser);