Logo Search packages:      
Sourcecode: valabind version File versions

swigwriter.c

/* swigwriter.c generated by valac 0.13.1.44-726e, the Vala compiler
 * generated from swigwriter.vala, do not modify */

/* Copyleft 2009-2011 -- pancake // nopcode.org */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <valagee.h>


#define TYPE_SWIG_WRITER (swig_writer_get_type ())
#define SWIG_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SWIG_WRITER, SwigWriter))
#define SWIG_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SWIG_WRITER, SwigWriterClass))
#define IS_SWIG_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SWIG_WRITER))
#define IS_SWIG_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SWIG_WRITER))
#define SWIG_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SWIG_WRITER, SwigWriterClass))

typedef struct _SwigWriter SwigWriter;
typedef struct _SwigWriterClass SwigWriterClass;
typedef struct _SwigWriterPrivate SwigWriterPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
#define __g_list_free__vala_code_node_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__vala_code_node_unref0_ (var), NULL)))
#define _vala_code_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_context_unref (var), NULL)))
#define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_reference_unref (var), NULL)))

00036 struct _SwigWriter {
      ValaCodeVisitor parent_instance;
      SwigWriterPrivate * priv;
      gboolean pkgmode;
      gchar* pkgname;
      gboolean show_externs;
      gboolean glib_mode;
      gboolean cxx_mode;
      gchar** files;
      gint files_length1;
      GList* includefiles;
      GList* methods;
};

00050 struct _SwigWriterClass {
      ValaCodeVisitorClass parent_class;
};

00054 struct _SwigWriterPrivate {
      ValaCodeContext* context;
      FILE* stream;
      gchar* classname;
      gchar* classcname;
      gchar* externs;
      gchar* statics;
      gchar* extends;
      gchar* enums;
      gchar* vectors;
      gchar* nspace;
      gchar* modulename;
};


static gpointer swig_writer_parent_class = NULL;

GType swig_writer_get_type (void) G_GNUC_CONST;
#define SWIG_WRITER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SWIG_WRITER, SwigWriterPrivate))
enum  {
      SWIG_WRITER_DUMMY_PROPERTY
};
static void _g_free0_ (gpointer var);
static void _g_list_free__g_free0_ (GList* self);
static void _vala_code_node_unref0_ (gpointer var);
static void _g_list_free__vala_code_node_unref0_ (GList* self);
SwigWriter* swig_writer_new (const gchar* name);
SwigWriter* swig_writer_construct (GType object_type, const gchar* name);
static gchar* swig_writer_get_alias (SwigWriter* self, const gchar* name);
void valabind_compiler_warning (const gchar* msg);
static gchar* swig_writer_get_ctype (SwigWriter* self, const gchar* _type);
void valabind_compiler_error (const gchar* msg);
static inline gboolean swig_writer_is_generic (SwigWriter* self, const gchar* type);
static gboolean swig_writer_is_target_file (SwigWriter* self, const gchar* path);
static void swig_writer_real_visit_source_file (ValaCodeVisitor* base, ValaSourceFile* source);
void swig_writer_process_includes (SwigWriter* self, ValaSymbol* s);
void swig_writer_walk_field (SwigWriter* self, ValaField* f);
void swig_writer_walk_class (SwigWriter* self, const gchar* pfx, ValaClass* c);
void swig_writer_walk_enum (SwigWriter* self, ValaEnum* e);
void swig_writer_walk_method (SwigWriter* self, ValaMethod* m);
static void swig_writer_real_visit_namespace (ValaCodeVisitor* base, ValaNamespace* ns);
void swig_writer_write_file (SwigWriter* self, ValaCodeContext* context, const gchar* filename);
static void swig_writer_finalize (ValaCodeVisitor* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static void _g_free0_ (gpointer var) {
      var = (g_free (var), NULL);
}


static void _g_list_free__g_free0_ (GList* self) {
      g_list_foreach (self, (GFunc) _g_free0_, NULL);
      g_list_free (self);
}


static void _vala_code_node_unref0_ (gpointer var) {
      (var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL));
}


static void _g_list_free__vala_code_node_unref0_ (GList* self) {
      g_list_foreach (self, (GFunc) _vala_code_node_unref0_, NULL);
      g_list_free (self);
}


SwigWriter* swig_writer_construct (GType object_type, const gchar* name) {
      SwigWriter* self = NULL;
      gchar* _tmp0_;
      gchar* _tmp1_;
      gchar* _tmp2_;
      gchar* _tmp3_;
      gchar* _tmp4_;
      gchar* _tmp5_;
      const gchar* _tmp6_;
      gchar* _tmp7_;
      g_return_val_if_fail (name != NULL, NULL);
      self = (SwigWriter*) vala_code_visitor_construct (object_type);
      _tmp0_ = g_strdup ("");
      _g_free0 (self->priv->enums);
      self->priv->enums = _tmp0_;
      _tmp1_ = g_strdup ("");
      _g_free0 (self->priv->statics);
      self->priv->statics = _tmp1_;
      _tmp2_ = g_strdup ("");
      _g_free0 (self->priv->externs);
      self->priv->externs = _tmp2_;
      _tmp3_ = g_strdup ("");
      _g_free0 (self->priv->extends);
      self->priv->extends = _tmp3_;
      _tmp4_ = g_strdup ("");
      _g_free0 (self->priv->vectors);
      self->priv->vectors = _tmp4_;
      _tmp5_ = g_strdup ("");
      _g_free0 (self->priv->classname);
      self->priv->classname = _tmp5_;
      _tmp6_ = name;
      _tmp7_ = g_strdup (_tmp6_);
      _g_free0 (self->priv->modulename);
      self->priv->modulename = _tmp7_;
      __g_list_free__g_free0_0 (self->includefiles);
      self->includefiles = NULL;
      return self;
}


SwigWriter* swig_writer_new (const gchar* name) {
      return swig_writer_construct (TYPE_SWIG_WRITER, name);
}


static gchar* swig_writer_get_alias (SwigWriter* self, const gchar* name) {
      gchar* result = NULL;
      const gchar* _tmp0_;
      gchar* _tmp1_;
      gchar* oname;
      const gchar* _tmp2_;
      const gchar* _tmp3_;
      GQuark _tmp5_ = 0U;
      static GQuark _tmp4_label0 = 0;
      static GQuark _tmp4_label1 = 0;
      static GQuark _tmp4_label2 = 0;
      static GQuark _tmp4_label3 = 0;
      static GQuark _tmp4_label4 = 0;
      static GQuark _tmp4_label5 = 0;
      static GQuark _tmp4_label6 = 0;
      const gchar* _tmp6_;
      const gchar* _tmp7_;
      const gchar* _tmp14_;
      gchar* _tmp15_;
      g_return_val_if_fail (self != NULL, NULL);
      g_return_val_if_fail (name != NULL, NULL);
      _tmp0_ = name;
      _tmp1_ = g_strdup (_tmp0_);
      oname = _tmp1_;
      _tmp2_ = name;
      _tmp3_ = _tmp2_;
      _tmp5_ = (NULL == _tmp3_) ? 0 : g_quark_from_string (_tmp3_);
      if (_tmp5_ == ((0 != _tmp4_label0) ? _tmp4_label0 : (_tmp4_label0 = g_quark_from_static_string ("break")))) {
            switch (0) {
                  default:
                  {
                        name = "_break";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label1) ? _tmp4_label1 : (_tmp4_label1 = g_quark_from_static_string ("cmd")))) {
            switch (0) {
                  default:
                  {
                        name = "_cmd";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label2) ? _tmp4_label2 : (_tmp4_label2 = g_quark_from_static_string ("def")))) {
            switch (0) {
                  default:
                  {
                        name = "_def";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label3) ? _tmp4_label3 : (_tmp4_label3 = g_quark_from_static_string ("print")))) {
            switch (0) {
                  default:
                  {
                        name = "_print";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label4) ? _tmp4_label4 : (_tmp4_label4 = g_quark_from_static_string ("del")))) {
            switch (0) {
                  default:
                  {
                        name = "_del";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label5) ? _tmp4_label5 : (_tmp4_label5 = g_quark_from_static_string ("from")))) {
            switch (0) {
                  default:
                  {
                        name = "_from";
                        break;
                  }
            }
      } else if (_tmp5_ == ((0 != _tmp4_label6) ? _tmp4_label6 : (_tmp4_label6 = g_quark_from_static_string ("continue")))) {
            switch (0) {
                  default:
                  {
                        name = "cont";
                        break;
                  }
            }
      }
      _tmp6_ = name;
      _tmp7_ = oname;
      if (g_strcmp0 (_tmp6_, _tmp7_) != 0) {
            const gchar* _tmp8_;
            const gchar* _tmp9_;
            const gchar* _tmp10_;
            const gchar* _tmp11_;
            gchar* _tmp12_ = NULL;
            gchar* _tmp13_;
            _tmp8_ = self->priv->classname;
            _tmp9_ = oname;
            _tmp10_ = self->priv->classname;
            _tmp11_ = name;
            _tmp12_ = g_strdup_printf ("%s.%s method renamed to %s.%s", _tmp8_, _tmp9_, _tmp10_, _tmp11_);
            _tmp13_ = _tmp12_;
            valabind_compiler_warning (_tmp13_);
            _g_free0 (_tmp13_);
      }
      _tmp14_ = name;
      _tmp15_ = g_strdup (_tmp14_);
      result = _tmp15_;
      _g_free0 (oname);
      return result;
}


static glong string_strnlen (gchar* str, glong maxlen) {
      glong result = 0L;
      gchar* _tmp0_;
      glong _tmp1_;
      gchar* _tmp2_ = NULL;
      gchar* end;
      gchar* _tmp3_;
      _tmp0_ = str;
      _tmp1_ = maxlen;
      _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
      end = _tmp2_;
      _tmp3_ = end;
      if (_tmp3_ == NULL) {
            glong _tmp4_;
            _tmp4_ = maxlen;
            result = _tmp4_;
            return result;
      } else {
            gchar* _tmp5_;
            gchar* _tmp6_;
            _tmp5_ = end;
            _tmp6_ = str;
            result = (glong) (_tmp5_ - _tmp6_);
            return result;
      }
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
      gchar* result = NULL;
      glong string_length = 0L;
      gboolean _tmp0_ = FALSE;
      glong _tmp1_;
      gboolean _tmp3_;
      glong _tmp9_;
      glong _tmp15_;
      glong _tmp18_;
      glong _tmp19_;
      glong _tmp20_;
      glong _tmp21_;
      glong _tmp22_;
      gchar* _tmp23_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      _tmp1_ = offset;
      if (_tmp1_ >= ((glong) 0)) {
            glong _tmp2_;
            _tmp2_ = len;
            _tmp0_ = _tmp2_ >= ((glong) 0);
      } else {
            _tmp0_ = FALSE;
      }
      _tmp3_ = _tmp0_;
      if (_tmp3_) {
            glong _tmp4_;
            glong _tmp5_;
            glong _tmp6_ = 0L;
            _tmp4_ = offset;
            _tmp5_ = len;
            _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
            string_length = _tmp6_;
      } else {
            gint _tmp7_ = 0;
            gint _tmp8_;
            _tmp7_ = strlen (self);
            _tmp8_ = _tmp7_;
            string_length = (glong) _tmp8_;
      }
      _tmp9_ = offset;
      if (_tmp9_ < ((glong) 0)) {
            glong _tmp10_;
            glong _tmp11_;
            glong _tmp12_;
            _tmp10_ = string_length;
            _tmp11_ = offset;
            offset = _tmp10_ + _tmp11_;
            _tmp12_ = offset;
            g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
      } else {
            glong _tmp13_;
            glong _tmp14_;
            _tmp13_ = offset;
            _tmp14_ = string_length;
            g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
      }
      _tmp15_ = len;
      if (_tmp15_ < ((glong) 0)) {
            glong _tmp16_;
            glong _tmp17_;
            _tmp16_ = string_length;
            _tmp17_ = offset;
            len = _tmp16_ - _tmp17_;
      }
      _tmp18_ = offset;
      _tmp19_ = len;
      _tmp20_ = string_length;
      g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
      _tmp21_ = offset;
      _tmp22_ = len;
      _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
      result = _tmp23_;
      return result;
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
      gchar* result = NULL;
      GError * _inner_error_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      g_return_val_if_fail (old != NULL, NULL);
      g_return_val_if_fail (replacement != NULL, NULL);
      {
            const gchar* _tmp0_;
            gchar* _tmp1_ = NULL;
            gchar* _tmp2_;
            GRegex* _tmp3_;
            GRegex* _tmp4_;
            GRegex* regex;
            GRegex* _tmp5_;
            const gchar* _tmp6_;
            gchar* _tmp7_ = NULL;
            gchar* _tmp8_;
            const gchar* _tmp9_;
            _tmp0_ = old;
            _tmp1_ = g_regex_escape_string (_tmp0_, -1);
            _tmp2_ = _tmp1_;
            _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
            _tmp4_ = _tmp3_;
            _g_free0 (_tmp2_);
            regex = _tmp4_;
            if (_inner_error_ != NULL) {
                  if (_inner_error_->domain == G_REGEX_ERROR) {
                        goto __catch3_g_regex_error;
                  }
                  g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                  g_clear_error (&_inner_error_);
                  return NULL;
            }
            _tmp5_ = regex;
            _tmp6_ = replacement;
            _tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
            _tmp8_ = _tmp7_;
            if (_inner_error_ != NULL) {
                  _g_regex_unref0 (regex);
                  if (_inner_error_->domain == G_REGEX_ERROR) {
                        goto __catch3_g_regex_error;
                  }
                  _g_regex_unref0 (regex);
                  g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                  g_clear_error (&_inner_error_);
                  return NULL;
            }
            _tmp9_ = _tmp8_;
            result = _tmp9_;
            _g_regex_unref0 (regex);
            return result;
      }
      goto __finally3;
      __catch3_g_regex_error:
      {
            GError* e = NULL;
            e = _inner_error_;
            _inner_error_ = NULL;
            g_assert_not_reached ();
            _g_error_free0 (e);
      }
      __finally3:
      if (_inner_error_ != NULL) {
            g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
            g_clear_error (&_inner_error_);
            return NULL;
      }
}


static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
      gint result = 0;
      gint _tmp0_;
      const gchar* _tmp1_;
      gchar* _tmp2_ = NULL;
      gchar* _result_;
      gchar* _tmp3_;
      g_return_val_if_fail (self != NULL, 0);
      g_return_val_if_fail (needle != NULL, 0);
      _tmp0_ = start_index;
      _tmp1_ = needle;
      _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
      _result_ = _tmp2_;
      _tmp3_ = _result_;
      if (_tmp3_ != NULL) {
            gchar* _tmp4_;
            _tmp4_ = _result_;
            result = (gint) (_tmp4_ - ((gchar*) self));
            return result;
      } else {
            result = -1;
            return result;
      }
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
      gchar* result = NULL;
      gint _tmp0_ = 0;
      gint _tmp1_;
      glong string_length;
      glong _tmp2_;
      glong _tmp5_;
      gboolean _tmp8_ = FALSE;
      glong _tmp9_;
      gboolean _tmp12_;
      gboolean _tmp13_ = FALSE;
      glong _tmp14_;
      gboolean _tmp17_;
      glong _tmp18_;
      glong _tmp19_;
      glong _tmp20_;
      glong _tmp21_;
      glong _tmp22_;
      gchar* _tmp23_ = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      _tmp0_ = strlen (self);
      _tmp1_ = _tmp0_;
      string_length = (glong) _tmp1_;
      _tmp2_ = start;
      if (_tmp2_ < ((glong) 0)) {
            glong _tmp3_;
            glong _tmp4_;
            _tmp3_ = string_length;
            _tmp4_ = start;
            start = _tmp3_ + _tmp4_;
      }
      _tmp5_ = end;
      if (_tmp5_ < ((glong) 0)) {
            glong _tmp6_;
            glong _tmp7_;
            _tmp6_ = string_length;
            _tmp7_ = end;
            end = _tmp6_ + _tmp7_;
      }
      _tmp9_ = start;
      if (_tmp9_ >= ((glong) 0)) {
            glong _tmp10_;
            glong _tmp11_;
            _tmp10_ = start;
            _tmp11_ = string_length;
            _tmp8_ = _tmp10_ <= _tmp11_;
      } else {
            _tmp8_ = FALSE;
      }
      _tmp12_ = _tmp8_;
      g_return_val_if_fail (_tmp12_, NULL);
      _tmp14_ = end;
      if (_tmp14_ >= ((glong) 0)) {
            glong _tmp15_;
            glong _tmp16_;
            _tmp15_ = end;
            _tmp16_ = string_length;
            _tmp13_ = _tmp15_ <= _tmp16_;
      } else {
            _tmp13_ = FALSE;
      }
      _tmp17_ = _tmp13_;
      g_return_val_if_fail (_tmp17_, NULL);
      _tmp18_ = start;
      _tmp19_ = end;
      g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
      _tmp20_ = start;
      _tmp21_ = end;
      _tmp22_ = start;
      _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
      result = _tmp23_;
      return result;
}


static gchar* swig_writer_get_ctype (SwigWriter* self, const gchar* _type) {
      gchar* result = NULL;
      const gchar* _tmp0_;
      gchar* _tmp1_;
      gchar* type;
      gchar* iter_type;
      const gchar* _tmp2_;
      const gchar* _tmp3_;
      const gchar* _tmp4_;
      gboolean _tmp5_ = FALSE;
      const gchar* _tmp13_;
      gchar* _tmp14_ = NULL;
      const gchar* _tmp15_;
      gboolean _tmp16_ = FALSE;
      const gchar* _tmp43_;
      gchar* _tmp44_ = NULL;
      const gchar* _tmp45_;
      const gchar* _tmp46_;
      GQuark _tmp48_ = 0U;
      static GQuark _tmp47_label0 = 0;
      static GQuark _tmp47_label1 = 0;
      static GQuark _tmp47_label2 = 0;
      static GQuark _tmp47_label3 = 0;
      static GQuark _tmp47_label4 = 0;
      static GQuark _tmp47_label5 = 0;
      static GQuark _tmp47_label6 = 0;
      static GQuark _tmp47_label7 = 0;
      static GQuark _tmp47_label8 = 0;
      static GQuark _tmp47_label9 = 0;
      static GQuark _tmp47_label10 = 0;
      static GQuark _tmp47_label11 = 0;
      static GQuark _tmp47_label12 = 0;
      static GQuark _tmp47_label13 = 0;
      static GQuark _tmp47_label14 = 0;
      static GQuark _tmp47_label15 = 0;
      static GQuark _tmp47_label16 = 0;
      static GQuark _tmp47_label17 = 0;
      static GQuark _tmp47_label18 = 0;
      static GQuark _tmp47_label19 = 0;
      static GQuark _tmp47_label20 = 0;
      static GQuark _tmp47_label21 = 0;
      static GQuark _tmp47_label22 = 0;
      static GQuark _tmp47_label23 = 0;
      static GQuark _tmp47_label24 = 0;
      static GQuark _tmp47_label25 = 0;
      static GQuark _tmp47_label26 = 0;
      static GQuark _tmp47_label27 = 0;
      static GQuark _tmp47_label28 = 0;
      static GQuark _tmp47_label29 = 0;
      static GQuark _tmp47_label30 = 0;
      static GQuark _tmp47_label31 = 0;
      static GQuark _tmp47_label32 = 0;
      static GQuark _tmp47_label33 = 0;
      const gchar* _tmp79_;
      g_return_val_if_fail (self != NULL, NULL);
      g_return_val_if_fail (_type != NULL, NULL);
      _tmp0_ = _type;
      _tmp1_ = g_strdup (_tmp0_);
      type = _tmp1_;
      iter_type = NULL;
      _tmp2_ = type;
      if (g_strcmp0 (_tmp2_, "null") == 0) {
            valabind_compiler_error ("Cannot resolve type");
      }
      _tmp3_ = type;
      _tmp4_ = self->priv->nspace;
      _tmp5_ = g_str_has_prefix (_tmp3_, _tmp4_);
      if (_tmp5_) {
            const gchar* _tmp6_;
            const gchar* _tmp7_;
            gint _tmp8_ = 0;
            gint _tmp9_;
            gchar* _tmp10_ = NULL;
            gchar* _tmp11_;
            gchar* _tmp12_;
            _tmp6_ = type;
            _tmp7_ = self->priv->nspace;
            _tmp8_ = strlen (_tmp7_);
            _tmp9_ = _tmp8_;
            _tmp10_ = string_substring (_tmp6_, (glong) _tmp9_, (glong) (-1));
            _tmp11_ = _tmp10_;
            _tmp12_ = g_strconcat (_tmp11_, "*", NULL);
            _g_free0 (type);
            type = _tmp12_;
            _g_free0 (_tmp11_);
      }
      _tmp13_ = type;
      _tmp14_ = string_replace (_tmp13_, ".", "");
      _g_free0 (type);
      type = _tmp14_;
      _tmp15_ = type;
      _tmp16_ = swig_writer_is_generic (self, _tmp15_);
      if (_tmp16_) {
            const gchar* _tmp17_;
            gint _tmp18_ = 0;
            gint ptr;
            gchar* _tmp19_ = NULL;
            gint _tmp20_;
            const gchar* _tmp29_;
            gchar* _tmp30_;
            const gchar* _tmp31_;
            gchar* _tmp32_ = NULL;
            const gchar* _tmp33_;
            gchar* _tmp34_ = NULL;
            const gchar* _tmp35_;
            const gchar* _tmp36_;
            gchar* _tmp37_ = NULL;
            const gchar* _tmp38_;
            gchar** _tmp39_;
            gchar** _tmp40_ = NULL;
            gchar** _tmp41_;
            gint _tmp41__length1;
            gchar* _tmp42_;
            _tmp17_ = type;
            _tmp18_ = string_index_of (_tmp17_, "<", 0);
            ptr = _tmp18_;
            _tmp20_ = ptr;
            if (_tmp20_ == (-1)) {
                  const gchar* _tmp21_;
                  gchar* _tmp22_;
                  _tmp21_ = type;
                  _tmp22_ = g_strdup (_tmp21_);
                  _g_free0 (_tmp19_);
                  _tmp19_ = _tmp22_;
            } else {
                  const gchar* _tmp23_;
                  gint _tmp24_;
                  const gchar* _tmp25_;
                  gint _tmp26_ = 0;
                  gint _tmp27_;
                  gchar* _tmp28_ = NULL;
                  _tmp23_ = type;
                  _tmp24_ = ptr;
                  _tmp25_ = type;
                  _tmp26_ = strlen (_tmp25_);
                  _tmp27_ = _tmp26_;
                  _tmp28_ = string_slice (_tmp23_, (glong) _tmp24_, (glong) _tmp27_);
                  _g_free0 (_tmp19_);
                  _tmp19_ = _tmp28_;
            }
            _tmp29_ = _tmp19_;
            _tmp30_ = g_strdup (_tmp29_);
            _g_free0 (iter_type);
            iter_type = _tmp30_;
            _tmp31_ = iter_type;
            _tmp32_ = string_replace (_tmp31_, "<", "");
            _g_free0 (iter_type);
            iter_type = _tmp32_;
            _tmp33_ = iter_type;
            _tmp34_ = string_replace (_tmp33_, ">", "");
            _g_free0 (iter_type);
            iter_type = _tmp34_;
            _tmp35_ = iter_type;
            _tmp36_ = self->priv->nspace;
            _tmp37_ = string_replace (_tmp35_, _tmp36_, "");
            _g_free0 (iter_type);
            iter_type = _tmp37_;
            _tmp38_ = type;
            _tmp40_ = _tmp39_ = g_strsplit (_tmp38_, "<", 2);
            _tmp41_ = _tmp40_;
            _tmp41__length1 = _vala_array_length (_tmp39_);
            _tmp42_ = g_strdup (_tmp41_[0]);
            _g_free0 (type);
            type = _tmp42_;
            _tmp41_ = (_vala_array_free (_tmp41_, _tmp41__length1, (GDestroyNotify) g_free), NULL);
            _g_free0 (_tmp19_);
      }
      _tmp43_ = type;
      _tmp44_ = string_replace (_tmp43_, "?", "");
      _g_free0 (type);
      type = _tmp44_;
      _tmp45_ = type;
      _tmp46_ = _tmp45_;
      _tmp48_ = (NULL == _tmp46_) ? 0 : g_quark_from_string (_tmp46_);
      if (_tmp48_ == ((0 != _tmp47_label0) ? _tmp47_label0 : (_tmp47_label0 = g_quark_from_static_string ("std::vector<string>")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp49_;
                        _tmp49_ = g_strdup ("std::vector<const char*>");
                        result = _tmp49_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label1) ? _tmp47_label1 : (_tmp47_label1 = g_quark_from_static_string ("const gchar*")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp50_;
                        _tmp50_ = g_strdup ("const char*");
                        result = _tmp50_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (((_tmp48_ == ((0 != _tmp47_label2) ? _tmp47_label2 : (_tmp47_label2 = g_quark_from_static_string ("G")))) || (_tmp48_ == ((0 != _tmp47_label3) ? _tmp47_label3 : (_tmp47_label3 = g_quark_from_static_string ("gconstpointer"))))) || (_tmp48_ == ((0 != _tmp47_label4) ? _tmp47_label4 : (_tmp47_label4 = g_quark_from_static_string ("gpointer"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp51_;
                        _tmp51_ = g_strdup ("void*");
                        result = _tmp51_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label5) ? _tmp47_label5 : (_tmp47_label5 = g_quark_from_static_string ("gdouble")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp52_;
                        _tmp52_ = g_strdup ("double");
                        result = _tmp52_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label6) ? _tmp47_label6 : (_tmp47_label6 = g_quark_from_static_string ("gfloat")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp53_;
                        _tmp53_ = g_strdup ("float");
                        result = _tmp53_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label7) ? _tmp47_label7 : (_tmp47_label7 = g_quark_from_static_string ("break")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp54_;
                        _tmp54_ = g_strdup ("_break");
                        result = _tmp54_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (((_tmp48_ == ((0 != _tmp47_label8) ? _tmp47_label8 : (_tmp47_label8 = g_quark_from_static_string ("ut8")))) || (_tmp48_ == ((0 != _tmp47_label9) ? _tmp47_label9 : (_tmp47_label9 = g_quark_from_static_string ("uint8"))))) || (_tmp48_ == ((0 != _tmp47_label10) ? _tmp47_label10 : (_tmp47_label10 = g_quark_from_static_string ("guint8"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp55_;
                        _tmp55_ = g_strdup ("unsigned char");
                        result = _tmp55_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label11) ? _tmp47_label11 : (_tmp47_label11 = g_quark_from_static_string ("gchar**")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp56_;
                        _tmp56_ = g_strdup ("char **");
                        result = _tmp56_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label12) ? _tmp47_label12 : (_tmp47_label12 = g_quark_from_static_string ("gchar")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp57_;
                        _tmp57_ = g_strdup ("char");
                        result = _tmp57_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if ((_tmp48_ == ((0 != _tmp47_label13) ? _tmp47_label13 : (_tmp47_label13 = g_quark_from_static_string ("gchar*")))) || (_tmp48_ == ((0 != _tmp47_label14) ? _tmp47_label14 : (_tmp47_label14 = g_quark_from_static_string ("string"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp58_;
                        _tmp58_ = g_strdup ("char *");
                        result = _tmp58_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label15) ? _tmp47_label15 : (_tmp47_label15 = g_quark_from_static_string ("gint")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp59_;
                        _tmp59_ = g_strdup ("int");
                        result = _tmp59_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label16) ? _tmp47_label16 : (_tmp47_label16 = g_quark_from_static_string ("glong")))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp60_;
                        _tmp60_ = g_strdup ("long");
                        result = _tmp60_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (((_tmp48_ == ((0 != _tmp47_label17) ? _tmp47_label17 : (_tmp47_label17 = g_quark_from_static_string ("st64")))) || (_tmp48_ == ((0 != _tmp47_label18) ? _tmp47_label18 : (_tmp47_label18 = g_quark_from_static_string ("int64"))))) || (_tmp48_ == ((0 != _tmp47_label19) ? _tmp47_label19 : (_tmp47_label19 = g_quark_from_static_string ("gint64"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp61_;
                        _tmp61_ = g_strdup ("long long");
                        result = _tmp61_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (((_tmp48_ == ((0 != _tmp47_label20) ? _tmp47_label20 : (_tmp47_label20 = g_quark_from_static_string ("ut64")))) || (_tmp48_ == ((0 != _tmp47_label21) ? _tmp47_label21 : (_tmp47_label21 = g_quark_from_static_string ("uint64"))))) || (_tmp48_ == ((0 != _tmp47_label22) ? _tmp47_label22 : (_tmp47_label22 = g_quark_from_static_string ("guint64"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp62_;
                        _tmp62_ = g_strdup ("unsigned long long");
                        result = _tmp62_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if ((_tmp48_ == ((0 != _tmp47_label23) ? _tmp47_label23 : (_tmp47_label23 = g_quark_from_static_string ("uint8*")))) || (_tmp48_ == ((0 != _tmp47_label24) ? _tmp47_label24 : (_tmp47_label24 = g_quark_from_static_string ("guint8*"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp63_;
                        _tmp63_ = g_strdup ("unsigned char*");
                        result = _tmp63_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if ((_tmp48_ == ((0 != _tmp47_label25) ? _tmp47_label25 : (_tmp47_label25 = g_quark_from_static_string ("guint16")))) || (_tmp48_ == ((0 != _tmp47_label26) ? _tmp47_label26 : (_tmp47_label26 = g_quark_from_static_string ("uint16"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp64_;
                        _tmp64_ = g_strdup ("unsigned short");
                        result = _tmp64_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (((_tmp48_ == ((0 != _tmp47_label27) ? _tmp47_label27 : (_tmp47_label27 = g_quark_from_static_string ("ut32")))) || (_tmp48_ == ((0 != _tmp47_label28) ? _tmp47_label28 : (_tmp47_label28 = g_quark_from_static_string ("uint32"))))) || (_tmp48_ == ((0 != _tmp47_label29) ? _tmp47_label29 : (_tmp47_label29 = g_quark_from_static_string ("guint32"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp65_;
                        _tmp65_ = g_strdup ("unsigned int");
                        result = _tmp65_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if ((_tmp48_ == ((0 != _tmp47_label30) ? _tmp47_label30 : (_tmp47_label30 = g_quark_from_static_string ("bool")))) || (_tmp48_ == ((0 != _tmp47_label31) ? _tmp47_label31 : (_tmp47_label31 = g_quark_from_static_string ("gboolean"))))) {
            switch (0) {
                  default:
                  {
                        gchar* _tmp66_;
                        _tmp66_ = g_strdup ("bool");
                        result = _tmp66_;
                        _g_free0 (iter_type);
                        _g_free0 (type);
                        return result;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label32) ? _tmp47_label32 : (_tmp47_label32 = g_quark_from_static_string ("RFList")))) {
            switch (0) {
                  default:
                  {
                        const gchar* _tmp67_;
                        _tmp67_ = iter_type;
                        if (_tmp67_ != NULL) {
                              const gchar* _tmp68_;
                              gchar* _tmp69_;
                              gchar* _tmp70_;
                              gchar* _tmp71_;
                              gchar* _tmp72_;
                              _tmp68_ = iter_type;
                              _tmp69_ = g_strconcat ("std::vector<", _tmp68_, NULL);
                              _tmp70_ = _tmp69_;
                              _tmp71_ = g_strconcat (_tmp70_, ">", NULL);
                              _tmp72_ = _tmp71_;
                              _g_free0 (_tmp70_);
                              result = _tmp72_;
                              _g_free0 (iter_type);
                              _g_free0 (type);
                              return result;
                        }
                        break;
                  }
            }
      } else if (_tmp48_ == ((0 != _tmp47_label33) ? _tmp47_label33 : (_tmp47_label33 = g_quark_from_static_string ("RList")))) {
            switch (0) {
                  default:
                  {
                        const gchar* _tmp73_;
                        _tmp73_ = iter_type;
                        if (_tmp73_ != NULL) {
                              const gchar* _tmp74_;
                              gchar* _tmp75_;
                              gchar* _tmp76_;
                              gchar* _tmp77_;
                              gchar* _tmp78_;
                              _tmp74_ = iter_type;
                              _tmp75_ = g_strconcat ("std::vector<", _tmp74_, NULL);
                              _tmp76_ = _tmp75_;
                              _tmp77_ = g_strconcat (_tmp76_, ">", NULL);
                              _tmp78_ = _tmp77_;
                              _g_free0 (_tmp76_);
                              result = _tmp78_;
                              _g_free0 (iter_type);
                              _g_free0 (type);
                              return result;
                        }
                        break;
                  }
            }
      }
      _tmp79_ = type;
      result = _tmp79_;
      _g_free0 (iter_type);
      return result;
}


static gboolean swig_writer_is_target_file (SwigWriter* self, const gchar* path) {
      gboolean result = FALSE;
      gchar** _tmp0_;
      gint _tmp0__length1;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (path != NULL, FALSE);
      _tmp0_ = self->files;
      _tmp0__length1 = self->files_length1;
      {
            gchar** file_collection = NULL;
            gint file_collection_length1 = 0;
            gint _file_collection_size_ = 0;
            gint file_it = 0;
            file_collection = _tmp0_;
            file_collection_length1 = _tmp0__length1;
            for (file_it = 0; file_it < _tmp0__length1; file_it = file_it + 1) {
                  gchar* _tmp1_;
                  gchar* file = NULL;
                  _tmp1_ = g_strdup (file_collection[file_it]);
                  file = _tmp1_;
                  {
                        const gchar* _tmp2_;
                        const gchar* _tmp3_;
                        _tmp2_ = file;
                        _tmp3_ = path;
                        if (g_strcmp0 (_tmp2_, _tmp3_) == 0) {
                              result = TRUE;
                              _g_free0 (file);
                              return result;
                        }
                        _g_free0 (file);
                  }
            }
      }
      result = FALSE;
      return result;
}


static void swig_writer_real_visit_source_file (ValaCodeVisitor* base, ValaSourceFile* source) {
      SwigWriter * self;
      ValaSourceFile* _tmp0_;
      const gchar* _tmp1_ = NULL;
      const gchar* _tmp2_;
      gboolean _tmp3_ = FALSE;
      self = (SwigWriter*) base;
      g_return_if_fail (source != NULL);
      _tmp0_ = source;
      _tmp1_ = vala_source_file_get_filename (_tmp0_);
      _tmp2_ = _tmp1_;
      _tmp3_ = swig_writer_is_target_file (self, _tmp2_);
      if (_tmp3_) {
            ValaSourceFile* _tmp4_;
            _tmp4_ = source;
            vala_source_file_accept_children (_tmp4_, (ValaCodeVisitor*) self);
      }
}


void swig_writer_process_includes (SwigWriter* self, ValaSymbol* s) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (s != NULL);
      {
            ValaSymbol* _tmp0_;
            ValaList* _tmp1_ = NULL;
            ValaList* _foo_list;
            ValaList* _tmp2_;
            gint _tmp3_ = 0;
            gint _tmp4_;
            gint _foo_size;
            gint _foo_index;
            _tmp0_ = s;
            _tmp1_ = vala_symbol_get_cheader_filenames (_tmp0_);
            _foo_list = _tmp1_;
            _tmp2_ = _foo_list;
            _tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
            _tmp4_ = _tmp3_;
            _foo_size = _tmp4_;
            _foo_index = -1;
            while (TRUE) {
                  gint _tmp5_;
                  gint _tmp6_;
                  gint _tmp7_;
                  ValaList* _tmp8_;
                  gint _tmp9_;
                  gpointer _tmp10_ = NULL;
                  gchar* foo;
                  gboolean include;
                  GList* _tmp11_;
                  gboolean _tmp15_;
                  _tmp5_ = _foo_index;
                  _foo_index = _tmp5_ + 1;
                  _tmp6_ = _foo_index;
                  _tmp7_ = _foo_size;
                  if (!(_tmp6_ < _tmp7_)) {
                        break;
                  }
                  _tmp8_ = _foo_list;
                  _tmp9_ = _foo_index;
                  _tmp10_ = vala_list_get (_tmp8_, _tmp9_);
                  foo = (gchar*) _tmp10_;
                  include = TRUE;
                  _tmp11_ = self->includefiles;
                  {
                        GList* inc_collection = NULL;
                        GList* inc_it = NULL;
                        inc_collection = _tmp11_;
                        for (inc_it = inc_collection; inc_it != NULL; inc_it = inc_it->next) {
                              gchar* _tmp12_;
                              gchar* inc = NULL;
                              _tmp12_ = g_strdup ((const gchar*) inc_it->data);
                              inc = _tmp12_;
                              {
                                    const gchar* _tmp13_;
                                    const gchar* _tmp14_;
                                    _tmp13_ = inc;
                                    _tmp14_ = foo;
                                    if (g_strcmp0 (_tmp13_, _tmp14_) == 0) {
                                          include = FALSE;
                                          _g_free0 (inc);
                                          break;
                                    }
                                    _g_free0 (inc);
                              }
                        }
                  }
                  _tmp15_ = include;
                  if (_tmp15_) {
                        const gchar* _tmp16_;
                        gchar* _tmp17_;
                        _tmp16_ = foo;
                        _tmp17_ = g_strdup (_tmp16_);
                        self->includefiles = g_list_prepend (self->includefiles, _tmp17_);
                  }
                  _g_free0 (foo);
            }
            _vala_iterable_unref0 (_foo_list);
      }
}


void swig_writer_walk_field (SwigWriter* self, ValaField* f) {
      ValaField* _tmp0_;
      gchar* _tmp1_ = NULL;
      gchar* _tmp2_;
      gboolean _tmp3_;
      ValaField* _tmp9_;
      gboolean _tmp10_ = FALSE;
      gboolean _tmp11_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (f != NULL);
      _tmp0_ = f;
      _tmp1_ = vala_field_get_ctype (_tmp0_);
      _tmp2_ = _tmp1_;
      _tmp3_ = _tmp2_ == NULL;
      _g_free0 (_tmp2_);
      if (_tmp3_) {
      } else {
            ValaField* _tmp4_;
            gchar* _tmp5_ = NULL;
            gchar* _tmp6_;
            gchar* _tmp7_ = NULL;
            gchar* _tmp8_;
            _tmp4_ = f;
            _tmp5_ = vala_field_get_cname (_tmp4_);
            _tmp6_ = _tmp5_;
            _tmp7_ = g_strdup_printf ("Type for %s\n", _tmp6_);
            _tmp8_ = _tmp7_;
            valabind_compiler_warning (_tmp8_);
            _g_free0 (_tmp8_);
            _g_free0 (_tmp6_);
      }
      _tmp9_ = f;
      _tmp10_ = vala_variable_get_no_array_length ((ValaVariable*) _tmp9_);
      _tmp11_ = _tmp10_;
      if (_tmp11_) {
            g_print ("---> array without length\n");
      }
}


void swig_writer_walk_class (SwigWriter* self, const gchar* pfx, ValaClass* c) {
      const gchar* _tmp15_;
      ValaClass* _tmp16_;
      const gchar* _tmp17_ = NULL;
      const gchar* _tmp18_;
      gchar* _tmp19_;
      ValaClass* _tmp20_;
      gchar* _tmp21_ = NULL;
      ValaClass* _tmp22_;
      gboolean _tmp23_;
      ValaClass* _tmp61_;
      gboolean _tmp62_ = FALSE;
      gboolean _tmp95_;
      gchar* _tmp103_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (pfx != NULL);
      g_return_if_fail (c != NULL);
      {
            ValaClass* _tmp0_;
            ValaList* _tmp1_ = NULL;
            ValaList* _k_list;
            ValaList* _tmp2_;
            gint _tmp3_ = 0;
            gint _tmp4_;
            gint _k_size;
            gint _k_index;
            _tmp0_ = c;
            _tmp1_ = vala_class_get_classes (_tmp0_);
            _k_list = _tmp1_;
            _tmp2_ = _k_list;
            _tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
            _tmp4_ = _tmp3_;
            _k_size = _tmp4_;
            _k_index = -1;
            while (TRUE) {
                  gint _tmp5_;
                  gint _tmp6_;
                  gint _tmp7_;
                  ValaList* _tmp8_;
                  gint _tmp9_;
                  gpointer _tmp10_ = NULL;
                  ValaClass* k;
                  ValaClass* _tmp11_;
                  const gchar* _tmp12_ = NULL;
                  const gchar* _tmp13_;
                  ValaClass* _tmp14_;
                  _tmp5_ = _k_index;
                  _k_index = _tmp5_ + 1;
                  _tmp6_ = _k_index;
                  _tmp7_ = _k_size;
                  if (!(_tmp6_ < _tmp7_)) {
                        break;
                  }
                  _tmp8_ = _k_list;
                  _tmp9_ = _k_index;
                  _tmp10_ = vala_list_get (_tmp8_, _tmp9_);
                  k = (ValaClass*) _tmp10_;
                  _tmp11_ = c;
                  _tmp12_ = vala_symbol_get_name ((ValaSymbol*) _tmp11_);
                  _tmp13_ = _tmp12_;
                  _tmp14_ = k;
                  swig_writer_walk_class (self, _tmp13_, _tmp14_);
                  _vala_code_node_unref0 (k);
            }
            _vala_iterable_unref0 (_k_list);
      }
      _tmp15_ = pfx;
      _tmp16_ = c;
      _tmp17_ = vala_symbol_get_name ((ValaSymbol*) _tmp16_);
      _tmp18_ = _tmp17_;
      _tmp19_ = g_strconcat (_tmp15_, _tmp18_, NULL);
      _g_free0 (self->priv->classname);
      self->priv->classname = _tmp19_;
      _tmp20_ = c;
      _tmp21_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) _tmp20_, FALSE);
      _g_free0 (self->priv->classcname);
      self->priv->classcname = _tmp21_;
      _tmp22_ = c;
      swig_writer_process_includes (self, (ValaSymbol*) _tmp22_);
      _tmp23_ = self->glib_mode;
      if (_tmp23_) {
            const gchar* _tmp24_;
            const gchar* _tmp25_;
            gchar* _tmp26_ = NULL;
            const gchar* _tmp27_;
            const gchar* _tmp28_;
            gchar* _tmp29_ = NULL;
            gchar* _tmp30_;
            gchar* _tmp31_;
            _tmp24_ = self->priv->nspace;
            _tmp25_ = self->priv->classname;
            _tmp26_ = g_strdup_printf ("%s%s", _tmp24_, _tmp25_);
            _g_free0 (self->priv->classname);
            self->priv->classname = _tmp26_;
            _tmp27_ = self->priv->extends;
            _tmp28_ = self->priv->classcname;
            _tmp29_ = g_strdup_printf ("typedef struct _%s {\n%%extend {\n", _tmp28_);
            _tmp30_ = _tmp29_;
            _tmp31_ = g_strconcat (_tmp27_, _tmp30_, NULL);
            _g_free0 (self->priv->extends);
            self->priv->extends = _tmp31_;
            _g_free0 (_tmp30_);
      } else {
            const gchar* _tmp32_;
            const gchar* _tmp33_;
            gchar* _tmp34_ = NULL;
            gchar* _tmp35_;
            gchar* _tmp36_;
            _tmp32_ = self->priv->extends;
            _tmp33_ = self->priv->classname;
            _tmp34_ = g_strdup_printf ("%%extend %s {\n", _tmp33_);
            _tmp35_ = _tmp34_;
            _tmp36_ = g_strconcat (_tmp32_, _tmp35_, NULL);
            _g_free0 (self->priv->extends);
            self->priv->extends = _tmp36_;
            _g_free0 (_tmp35_);
      }
      {
            ValaClass* _tmp37_;
            ValaList* _tmp38_ = NULL;
            ValaList* _e_list;
            ValaList* _tmp39_;
            gint _tmp40_ = 0;
            gint _tmp41_;
            gint _e_size;
            gint _e_index;
            _tmp37_ = c;
            _tmp38_ = vala_class_get_enums (_tmp37_);
            _e_list = _tmp38_;
            _tmp39_ = _e_list;
            _tmp40_ = vala_collection_get_size ((ValaCollection*) _tmp39_);
            _tmp41_ = _tmp40_;
            _e_size = _tmp41_;
            _e_index = -1;
            while (TRUE) {
                  gint _tmp42_;
                  gint _tmp43_;
                  gint _tmp44_;
                  ValaList* _tmp45_;
                  gint _tmp46_;
                  gpointer _tmp47_ = NULL;
                  ValaEnum* e;
                  ValaEnum* _tmp48_;
                  _tmp42_ = _e_index;
                  _e_index = _tmp42_ + 1;
                  _tmp43_ = _e_index;
                  _tmp44_ = _e_size;
                  if (!(_tmp43_ < _tmp44_)) {
                        break;
                  }
                  _tmp45_ = _e_list;
                  _tmp46_ = _e_index;
                  _tmp47_ = vala_list_get (_tmp45_, _tmp46_);
                  e = (ValaEnum*) _tmp47_;
                  _tmp48_ = e;
                  swig_writer_walk_enum (self, _tmp48_);
                  _vala_code_node_unref0 (e);
            }
            _vala_iterable_unref0 (_e_list);
      }
      {
            ValaClass* _tmp49_;
            ValaList* _tmp50_ = NULL;
            ValaList* _f_list;
            ValaList* _tmp51_;
            gint _tmp52_ = 0;
            gint _tmp53_;
            gint _f_size;
            gint _f_index;
            _tmp49_ = c;
            _tmp50_ = vala_class_get_fields (_tmp49_);
            _f_list = _tmp50_;
            _tmp51_ = _f_list;
            _tmp52_ = vala_collection_get_size ((ValaCollection*) _tmp51_);
            _tmp53_ = _tmp52_;
            _f_size = _tmp53_;
            _f_index = -1;
            while (TRUE) {
                  gint _tmp54_;
                  gint _tmp55_;
                  gint _tmp56_;
                  ValaList* _tmp57_;
                  gint _tmp58_;
                  gpointer _tmp59_ = NULL;
                  ValaField* f;
                  ValaField* _tmp60_;
                  _tmp54_ = _f_index;
                  _f_index = _tmp54_ + 1;
                  _tmp55_ = _f_index;
                  _tmp56_ = _f_size;
                  if (!(_tmp55_ < _tmp56_)) {
                        break;
                  }
                  _tmp57_ = _f_list;
                  _tmp58_ = _f_index;
                  _tmp59_ = vala_list_get (_tmp57_, _tmp58_);
                  f = (ValaField*) _tmp59_;
                  _tmp60_ = f;
                  swig_writer_walk_field (self, _tmp60_);
                  _vala_code_node_unref0 (f);
            }
            _vala_iterable_unref0 (_f_list);
      }
      _tmp61_ = c;
      _tmp62_ = vala_typesymbol_is_reference_counting ((ValaTypeSymbol*) _tmp61_);
      if (_tmp62_) {
            ValaClass* _tmp63_;
            gchar* _tmp64_ = NULL;
            gchar* freefun;
            const gchar* _tmp65_;
            _tmp63_ = c;
            _tmp64_ = vala_typesymbol_get_unref_function ((ValaTypeSymbol*) _tmp63_);
            freefun = _tmp64_;
            _tmp65_ = freefun;
            if (_tmp65_ != NULL) {
                  const gchar* _tmp66_;
                  const gchar* _tmp67_;
                  const gchar* _tmp68_;
                  const gchar* _tmp69_;
                  gchar* _tmp70_ = NULL;
                  gchar* _tmp71_;
                  gchar* _tmp72_;
                  _tmp66_ = self->priv->extends;
                  _tmp67_ = self->priv->modulename;
                  _tmp68_ = self->priv->classname;
                  _tmp69_ = freefun;
                  _tmp70_ = g_strdup_printf ("  ~%s%s() {\n    %s (self);\n  }\n", _tmp67_, _tmp68_, _tmp69_);
                  _tmp71_ = _tmp70_;
                  _tmp72_ = g_strconcat (_tmp66_, _tmp71_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp72_;
                  _g_free0 (_tmp71_);
            }
            _g_free0 (freefun);
      } else {
            ValaClass* _tmp73_;
            gchar* _tmp74_ = NULL;
            gchar* freefun;
            const gchar* _tmp75_;
            _tmp73_ = c;
            _tmp74_ = vala_typesymbol_get_free_function ((ValaTypeSymbol*) _tmp73_);
            freefun = _tmp74_;
            _tmp75_ = freefun;
            if (_tmp75_ != NULL) {
                  const gchar* _tmp76_;
                  const gchar* _tmp77_;
                  const gchar* _tmp78_;
                  const gchar* _tmp79_;
                  gchar* _tmp80_ = NULL;
                  gchar* _tmp81_;
                  gchar* _tmp82_;
                  _tmp76_ = self->priv->extends;
                  _tmp77_ = self->priv->modulename;
                  _tmp78_ = self->priv->classname;
                  _tmp79_ = freefun;
                  _tmp80_ = g_strdup_printf ("  ~%s%s() {\n    %s (self);\n  }\n", _tmp77_, _tmp78_, _tmp79_);
                  _tmp81_ = _tmp80_;
                  _tmp82_ = g_strconcat (_tmp76_, _tmp81_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp82_;
                  _g_free0 (_tmp81_);
            }
            _g_free0 (freefun);
      }
      {
            ValaClass* _tmp83_;
            ValaList* _tmp84_ = NULL;
            ValaList* _m_list;
            ValaList* _tmp85_;
            gint _tmp86_ = 0;
            gint _tmp87_;
            gint _m_size;
            gint _m_index;
            _tmp83_ = c;
            _tmp84_ = vala_object_type_symbol_get_methods ((ValaObjectTypeSymbol*) _tmp83_);
            _m_list = _tmp84_;
            _tmp85_ = _m_list;
            _tmp86_ = vala_collection_get_size ((ValaCollection*) _tmp85_);
            _tmp87_ = _tmp86_;
            _m_size = _tmp87_;
            _m_index = -1;
            while (TRUE) {
                  gint _tmp88_;
                  gint _tmp89_;
                  gint _tmp90_;
                  ValaList* _tmp91_;
                  gint _tmp92_;
                  gpointer _tmp93_ = NULL;
                  ValaMethod* m;
                  ValaMethod* _tmp94_;
                  _tmp88_ = _m_index;
                  _m_index = _tmp88_ + 1;
                  _tmp89_ = _m_index;
                  _tmp90_ = _m_size;
                  if (!(_tmp89_ < _tmp90_)) {
                        break;
                  }
                  _tmp91_ = _m_list;
                  _tmp92_ = _m_index;
                  _tmp93_ = vala_list_get (_tmp91_, _tmp92_);
                  m = (ValaMethod*) _tmp93_;
                  _tmp94_ = m;
                  swig_writer_walk_method (self, _tmp94_);
                  _vala_code_node_unref0 (m);
            }
            _vala_iterable_unref0 (_m_list);
      }
      _tmp95_ = self->glib_mode;
      if (_tmp95_) {
            const gchar* _tmp96_;
            const gchar* _tmp97_;
            gchar* _tmp98_ = NULL;
            gchar* _tmp99_;
            gchar* _tmp100_;
            _tmp96_ = self->priv->extends;
            _tmp97_ = self->priv->classname;
            _tmp98_ = g_strdup_printf ("};\n} %s;\n", _tmp97_);
            _tmp99_ = _tmp98_;
            _tmp100_ = g_strconcat (_tmp96_, _tmp99_, NULL);
            _g_free0 (self->priv->extends);
            self->priv->extends = _tmp100_;
            _g_free0 (_tmp99_);
      } else {
            const gchar* _tmp101_;
            gchar* _tmp102_;
            _tmp101_ = self->priv->extends;
            _tmp102_ = g_strconcat (_tmp101_, "};\n", NULL);
            _g_free0 (self->priv->extends);
            self->priv->extends = _tmp102_;
      }
      _tmp103_ = g_strdup ("");
      _g_free0 (self->priv->classname);
      self->priv->classname = _tmp103_;
}


void swig_writer_walk_enum (SwigWriter* self, ValaEnum* e) {
      const gchar* _tmp0_;
      ValaEnum* _tmp1_;
      const gchar* _tmp2_ = NULL;
      const gchar* _tmp3_;
      gchar* _tmp4_;
      gchar* enumname;
      gchar* _tmp5_;
      gchar* tmp;
      const gchar* _tmp6_;
      ValaEnum* _tmp7_;
      const gchar* _tmp8_ = NULL;
      const gchar* _tmp9_;
      ValaEnum* _tmp10_;
      gchar* _tmp11_ = NULL;
      gchar* _tmp12_;
      gchar* _tmp13_ = NULL;
      gchar* _tmp14_;
      gchar* _tmp15_;
      const gchar* _tmp16_;
      const gchar* _tmp17_;
      gchar* _tmp18_ = NULL;
      gchar* _tmp19_;
      gchar* _tmp20_;
      const gchar* _tmp21_;
      const gchar* _tmp22_;
      gchar* _tmp23_ = NULL;
      gchar* _tmp24_;
      gchar* _tmp25_;
      const gchar* _tmp60_;
      gchar* _tmp61_;
      const gchar* _tmp62_;
      gchar* _tmp63_;
      gchar* _tmp64_;
      const gchar* _tmp65_;
      gchar* _tmp66_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (e != NULL);
      _tmp0_ = self->priv->classname;
      _tmp1_ = e;
      _tmp2_ = vala_symbol_get_name ((ValaSymbol*) _tmp1_);
      _tmp3_ = _tmp2_;
      _tmp4_ = g_strconcat (_tmp0_, _tmp3_, NULL);
      enumname = _tmp4_;
      _tmp5_ = g_strdup ("%{\n");
      tmp = _tmp5_;
      _tmp6_ = self->priv->enums;
      _tmp7_ = e;
      _tmp8_ = vala_symbol_get_name ((ValaSymbol*) _tmp7_);
      _tmp9_ = _tmp8_;
      _tmp10_ = e;
      _tmp11_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) _tmp10_, FALSE);
      _tmp12_ = _tmp11_;
      _tmp13_ = g_strdup_printf ("/* enum: %s (%s) */\n", _tmp9_, _tmp12_);
      _tmp14_ = _tmp13_;
      _tmp15_ = g_strconcat (_tmp6_, _tmp14_, NULL);
      _g_free0 (self->priv->enums);
      self->priv->enums = _tmp15_;
      _g_free0 (_tmp14_);
      _g_free0 (_tmp12_);
      _tmp16_ = self->priv->enums;
      _tmp17_ = enumname;
      _tmp18_ = g_strdup_printf ("enum %s {\n", _tmp17_);
      _tmp19_ = _tmp18_;
      _tmp20_ = g_strconcat (_tmp16_, _tmp19_, NULL);
      _g_free0 (self->priv->enums);
      self->priv->enums = _tmp20_;
      _g_free0 (_tmp19_);
      _tmp21_ = tmp;
      _tmp22_ = enumname;
      _tmp23_ = g_strdup_printf ("#define %s long int\n", _tmp22_);
      _tmp24_ = _tmp23_;
      _tmp25_ = g_strconcat (_tmp21_, _tmp24_, NULL);
      _g_free0 (tmp);
      tmp = _tmp25_;
      _g_free0 (_tmp24_);
      {
            ValaEnum* _tmp26_;
            ValaList* _tmp27_ = NULL;
            ValaList* _v_list;
            ValaList* _tmp28_;
            gint _tmp29_ = 0;
            gint _tmp30_;
            gint _v_size;
            gint _v_index;
            _tmp26_ = e;
            _tmp27_ = vala_enum_get_values (_tmp26_);
            _v_list = _tmp27_;
            _tmp28_ = _v_list;
            _tmp29_ = vala_collection_get_size ((ValaCollection*) _tmp28_);
            _tmp30_ = _tmp29_;
            _v_size = _tmp30_;
            _v_index = -1;
            while (TRUE) {
                  gint _tmp31_;
                  gint _tmp32_;
                  gint _tmp33_;
                  ValaList* _tmp34_;
                  gint _tmp35_;
                  gpointer _tmp36_ = NULL;
                  ValaEnumValue* v;
                  const gchar* _tmp37_;
                  ValaEnum* _tmp38_;
                  const gchar* _tmp39_ = NULL;
                  const gchar* _tmp40_;
                  ValaEnumValue* _tmp41_;
                  const gchar* _tmp42_ = NULL;
                  const gchar* _tmp43_;
                  gchar* _tmp44_ = NULL;
                  gchar* _tmp45_;
                  gchar* _tmp46_;
                  const gchar* _tmp47_;
                  ValaEnum* _tmp48_;
                  const gchar* _tmp49_ = NULL;
                  const gchar* _tmp50_;
                  ValaEnumValue* _tmp51_;
                  const gchar* _tmp52_ = NULL;
                  const gchar* _tmp53_;
                  ValaEnumValue* _tmp54_;
                  gchar* _tmp55_ = NULL;
                  gchar* _tmp56_;
                  gchar* _tmp57_ = NULL;
                  gchar* _tmp58_;
                  gchar* _tmp59_;
                  _tmp31_ = _v_index;
                  _v_index = _tmp31_ + 1;
                  _tmp32_ = _v_index;
                  _tmp33_ = _v_size;
                  if (!(_tmp32_ < _tmp33_)) {
                        break;
                  }
                  _tmp34_ = _v_list;
                  _tmp35_ = _v_index;
                  _tmp36_ = vala_list_get (_tmp34_, _tmp35_);
                  v = (ValaEnumValue*) _tmp36_;
                  _tmp37_ = self->priv->enums;
                  _tmp38_ = e;
                  _tmp39_ = vala_symbol_get_name ((ValaSymbol*) _tmp38_);
                  _tmp40_ = _tmp39_;
                  _tmp41_ = v;
                  _tmp42_ = vala_symbol_get_name ((ValaSymbol*) _tmp41_);
                  _tmp43_ = _tmp42_;
                  _tmp44_ = g_strdup_printf ("  %s_%s,\n", _tmp40_, _tmp43_);
                  _tmp45_ = _tmp44_;
                  _tmp46_ = g_strconcat (_tmp37_, _tmp45_, NULL);
                  _g_free0 (self->priv->enums);
                  self->priv->enums = _tmp46_;
                  _g_free0 (_tmp45_);
                  _tmp47_ = tmp;
                  _tmp48_ = e;
                  _tmp49_ = vala_symbol_get_name ((ValaSymbol*) _tmp48_);
                  _tmp50_ = _tmp49_;
                  _tmp51_ = v;
                  _tmp52_ = vala_symbol_get_name ((ValaSymbol*) _tmp51_);
                  _tmp53_ = _tmp52_;
                  _tmp54_ = v;
                  _tmp55_ = vala_constant_get_cname ((ValaConstant*) _tmp54_);
                  _tmp56_ = _tmp55_;
                  _tmp57_ = g_strdup_printf ("#define %s_%s %s\n", _tmp50_, _tmp53_, _tmp56_);
                  _tmp58_ = _tmp57_;
                  _tmp59_ = g_strconcat (_tmp47_, _tmp58_, NULL);
                  _g_free0 (tmp);
                  tmp = _tmp59_;
                  _g_free0 (_tmp58_);
                  _g_free0 (_tmp56_);
                  _vala_code_node_unref0 (v);
            }
            _vala_iterable_unref0 (_v_list);
      }
      _tmp60_ = self->priv->enums;
      _tmp61_ = g_strconcat (_tmp60_, "};\n", NULL);
      _g_free0 (self->priv->enums);
      self->priv->enums = _tmp61_;
      _tmp62_ = tmp;
      _tmp63_ = g_strconcat (_tmp62_, "%}\n", NULL);
      _tmp64_ = _tmp63_;
      _tmp65_ = self->priv->enums;
      _tmp66_ = g_strconcat (_tmp64_, _tmp65_, NULL);
      _g_free0 (self->priv->enums);
      self->priv->enums = _tmp66_;
      _g_free0 (_tmp64_);
      _g_free0 (tmp);
      _g_free0 (enumname);
}


static inline gboolean swig_writer_is_generic (SwigWriter* self, const gchar* type) {
      gboolean result = FALSE;
      gboolean _tmp0_ = FALSE;
      gboolean _tmp1_ = FALSE;
      gboolean _tmp2_;
      gboolean _tmp5_;
      gboolean _tmp8_;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (type != NULL, FALSE);
      _tmp2_ = self->cxx_mode;
      if (_tmp2_) {
            const gchar* _tmp3_;
            gint _tmp4_ = 0;
            _tmp3_ = type;
            _tmp4_ = string_index_of (_tmp3_, "<", 0);
            _tmp1_ = _tmp4_ != (-1);
      } else {
            _tmp1_ = FALSE;
      }
      _tmp5_ = _tmp1_;
      if (_tmp5_) {
            const gchar* _tmp6_;
            gint _tmp7_ = 0;
            _tmp6_ = type;
            _tmp7_ = string_index_of (_tmp6_, ">", 0);
            _tmp0_ = _tmp7_ != (-1);
      } else {
            _tmp0_ = FALSE;
      }
      _tmp8_ = _tmp0_;
      result = _tmp8_;
      return result;
}


static gpointer _vala_code_node_ref0 (gpointer self) {
      return self ? vala_code_node_ref (self) : NULL;
}


void swig_writer_walk_method (SwigWriter* self, ValaMethod* m) {
      gboolean first;
      ValaMethod* _tmp0_;
      gchar* _tmp1_ = NULL;
      gchar* cname;
      ValaMethod* _tmp2_;
      const gchar* _tmp3_ = NULL;
      const gchar* _tmp4_;
      gchar* _tmp5_ = NULL;
      gchar* alias;
      gchar* ret = NULL;
      gchar* _tmp6_;
      gchar* def_args;
      gchar* _tmp7_;
      gchar* call_args;
      gboolean void_return = FALSE;
      ValaMethod* _tmp8_;
      ValaMemberBinding _tmp9_ = 0;
      ValaMemberBinding _tmp10_;
      gboolean is_static;
      ValaMethod* _tmp11_;
      gboolean is_constructor;
      ValaMethod* _tmp12_;
      ValaDataType* _tmp13_ = NULL;
      ValaDataType* _tmp14_;
      gchar* _tmp15_ = NULL;
      const gchar* _tmp16_;
      gboolean _tmp17_ = FALSE;
      const gchar* _tmp26_;
      const gchar* _tmp30_;
      ValaMethod* _tmp31_;
      gboolean _tmp32_ = FALSE;
      gchar* _tmp33_;
      gchar* applys;
      gchar* _tmp34_;
      gchar* clears;
      gchar* pfx = NULL;
      const gchar* _tmp106_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (m != NULL);
      first = TRUE;
      _tmp0_ = m;
      _tmp1_ = vala_method_get_cname (_tmp0_);
      cname = _tmp1_;
      _tmp2_ = m;
      _tmp3_ = vala_symbol_get_name ((ValaSymbol*) _tmp2_);
      _tmp4_ = _tmp3_;
      _tmp5_ = swig_writer_get_alias (self, _tmp4_);
      alias = _tmp5_;
      _tmp6_ = g_strdup ("");
      def_args = _tmp6_;
      _tmp7_ = g_strdup ("");
      call_args = _tmp7_;
      _tmp8_ = m;
      _tmp9_ = vala_method_get_binding (_tmp8_);
      _tmp10_ = _tmp9_;
      is_static = (_tmp10_ & VALA_MEMBER_BINDING_STATIC) != 0;
      _tmp11_ = m;
      is_constructor = VALA_IS_CREATION_METHOD (_tmp11_);
      _tmp12_ = m;
      _tmp13_ = vala_method_get_return_type (_tmp12_);
      _tmp14_ = _tmp13_;
      _tmp15_ = vala_code_node_to_string ((ValaCodeNode*) _tmp14_);
      _g_free0 (ret);
      ret = _tmp15_;
      _tmp16_ = ret;
      _tmp17_ = swig_writer_is_generic (self, _tmp16_);
      if (_tmp17_) {
            const gchar* _tmp18_;
            gchar* _tmp19_ = NULL;
            _tmp18_ = ret;
            _tmp19_ = swig_writer_get_ctype (self, _tmp18_);
            _g_free0 (ret);
            ret = _tmp19_;
      } else {
            ValaMethod* _tmp20_;
            ValaDataType* _tmp21_ = NULL;
            ValaDataType* _tmp22_;
            gchar* _tmp23_ = NULL;
            gchar* _tmp24_;
            gchar* _tmp25_ = NULL;
            _tmp20_ = m;
            _tmp21_ = vala_method_get_return_type (_tmp20_);
            _tmp22_ = _tmp21_;
            _tmp23_ = vala_data_type_get_cname (_tmp22_);
            _tmp24_ = _tmp23_;
            _tmp25_ = swig_writer_get_ctype (self, _tmp24_);
            _g_free0 (ret);
            ret = _tmp25_;
            _g_free0 (_tmp24_);
      }
      _tmp26_ = ret;
      if (_tmp26_ == NULL) {
            const gchar* _tmp27_;
            gchar* _tmp28_ = NULL;
            gchar* _tmp29_;
            _tmp27_ = cname;
            _tmp28_ = g_strdup_printf ("Cannot resolve return type for %s\n", _tmp27_);
            _tmp29_ = _tmp28_;
            valabind_compiler_error (_tmp29_);
            _g_free0 (_tmp29_);
      }
      _tmp30_ = ret;
      void_return = g_strcmp0 (_tmp30_, "void") == 0;
      _tmp31_ = m;
      _tmp32_ = vala_symbol_is_private_symbol ((ValaSymbol*) _tmp31_);
      if (_tmp32_) {
            _g_free0 (call_args);
            _g_free0 (def_args);
            _g_free0 (ret);
            _g_free0 (alias);
            _g_free0 (cname);
            return;
      }
      _tmp33_ = g_strdup ("");
      applys = _tmp33_;
      _tmp34_ = g_strdup ("");
      clears = _tmp34_;
      {
            ValaMethod* _tmp35_;
            ValaList* _tmp36_ = NULL;
            ValaList* _foo_list;
            ValaList* _tmp37_;
            gint _tmp38_ = 0;
            gint _tmp39_;
            gint _foo_size;
            gint _foo_index;
            _tmp35_ = m;
            _tmp36_ = vala_method_get_parameters (_tmp35_);
            _foo_list = _tmp36_;
            _tmp37_ = _foo_list;
            _tmp38_ = vala_collection_get_size ((ValaCollection*) _tmp37_);
            _tmp39_ = _tmp38_;
            _foo_size = _tmp39_;
            _foo_index = -1;
            while (TRUE) {
                  gint _tmp40_;
                  gint _tmp41_;
                  gint _tmp42_;
                  ValaList* _tmp43_;
                  gint _tmp44_;
                  gpointer _tmp45_ = NULL;
                  ValaParameter* foo;
                  ValaParameter* _tmp46_;
                  const gchar* _tmp47_ = NULL;
                  const gchar* _tmp48_;
                  gchar* _tmp49_;
                  gchar* arg_name;
                  ValaParameter* _tmp50_;
                  ValaDataType* _tmp51_ = NULL;
                  ValaDataType* _tmp52_;
                  ValaDataType* _tmp53_;
                  ValaDataType* bar;
                  ValaDataType* _tmp54_;
                  ValaDataType* _tmp55_;
                  gchar* _tmp56_ = NULL;
                  gchar* _tmp57_;
                  gchar* _tmp58_ = NULL;
                  gchar* _tmp59_;
                  gchar* arg_type;
                  gboolean _tmp60_;
                  ValaParameter* _tmp63_;
                  ValaParameterDirection _tmp64_ = 0;
                  ValaParameterDirection _tmp65_;
                  const gchar* _tmp93_;
                  const gchar* _tmp94_;
                  const gchar* _tmp95_;
                  gchar* _tmp96_ = NULL;
                  gchar* _tmp97_;
                  gchar* _tmp98_;
                  const gchar* _tmp99_;
                  const gchar* _tmp100_;
                  const gchar* _tmp101_;
                  const gchar* _tmp102_;
                  gchar* _tmp103_ = NULL;
                  gchar* _tmp104_;
                  gchar* _tmp105_;
                  _tmp40_ = _foo_index;
                  _foo_index = _tmp40_ + 1;
                  _tmp41_ = _foo_index;
                  _tmp42_ = _foo_size;
                  if (!(_tmp41_ < _tmp42_)) {
                        break;
                  }
                  _tmp43_ = _foo_list;
                  _tmp44_ = _foo_index;
                  _tmp45_ = vala_list_get (_tmp43_, _tmp44_);
                  foo = (ValaParameter*) _tmp45_;
                  _tmp46_ = foo;
                  _tmp47_ = vala_symbol_get_name ((ValaSymbol*) _tmp46_);
                  _tmp48_ = _tmp47_;
                  _tmp49_ = g_strdup (_tmp48_);
                  arg_name = _tmp49_;
                  _tmp50_ = foo;
                  _tmp51_ = vala_variable_get_variable_type ((ValaVariable*) _tmp50_);
                  _tmp52_ = _tmp51_;
                  _tmp53_ = _vala_code_node_ref0 (_tmp52_);
                  bar = _tmp53_;
                  _tmp54_ = bar;
                  if (_tmp54_ == NULL) {
                        _vala_code_node_unref0 (bar);
                        _g_free0 (arg_name);
                        _vala_code_node_unref0 (foo);
                        continue;
                  }
                  _tmp55_ = bar;
                  _tmp56_ = vala_data_type_get_cname (_tmp55_);
                  _tmp57_ = _tmp56_;
                  _tmp58_ = swig_writer_get_ctype (self, _tmp57_);
                  _tmp59_ = _tmp58_;
                  _g_free0 (_tmp57_);
                  arg_type = _tmp59_;
                  _tmp60_ = first;
                  if (_tmp60_) {
                        gchar* _tmp61_;
                        _tmp61_ = g_strdup ("");
                        _g_free0 (pfx);
                        pfx = _tmp61_;
                        first = FALSE;
                  } else {
                        gchar* _tmp62_;
                        _tmp62_ = g_strdup (", ");
                        _g_free0 (pfx);
                        pfx = _tmp62_;
                  }
                  _tmp63_ = foo;
                  _tmp64_ = vala_parameter_get_direction (_tmp63_);
                  _tmp65_ = _tmp64_;
                  if (_tmp65_ != VALA_PARAMETER_DIRECTION_IN) {
                        gchar* _tmp66_;
                        gchar* var_name;
                        ValaParameter* _tmp67_;
                        ValaParameterDirection _tmp68_ = 0;
                        ValaParameterDirection _tmp69_;
                        const gchar* _tmp75_;
                        gint _tmp76_ = 0;
                        const gchar* _tmp79_;
                        const gchar* _tmp80_;
                        const gchar* _tmp81_;
                        const gchar* _tmp82_;
                        const gchar* _tmp83_;
                        gchar* _tmp84_ = NULL;
                        gchar* _tmp85_;
                        gchar* _tmp86_;
                        const gchar* _tmp87_;
                        const gchar* _tmp88_;
                        const gchar* _tmp89_;
                        gchar* _tmp90_ = NULL;
                        gchar* _tmp91_;
                        gchar* _tmp92_;
                        _tmp66_ = g_strdup ("");
                        var_name = _tmp66_;
                        _tmp67_ = foo;
                        _tmp68_ = vala_parameter_get_direction (_tmp67_);
                        _tmp69_ = _tmp68_;
                        if (_tmp69_ == VALA_PARAMETER_DIRECTION_OUT) {
                              gchar* _tmp70_;
                              _tmp70_ = g_strdup ("OUTPUT");
                              _g_free0 (var_name);
                              var_name = _tmp70_;
                        } else {
                              ValaParameter* _tmp71_;
                              ValaParameterDirection _tmp72_ = 0;
                              ValaParameterDirection _tmp73_;
                              _tmp71_ = foo;
                              _tmp72_ = vala_parameter_get_direction (_tmp71_);
                              _tmp73_ = _tmp72_;
                              if (_tmp73_ == VALA_PARAMETER_DIRECTION_REF) {
                                    gchar* _tmp74_;
                                    _tmp74_ = g_strdup ("INOUT");
                                    _g_free0 (var_name);
                                    var_name = _tmp74_;
                              }
                        }
                        _tmp75_ = arg_type;
                        _tmp76_ = string_index_of (_tmp75_, "*", 0);
                        if (_tmp76_ == (-1)) {
                              const gchar* _tmp77_;
                              gchar* _tmp78_;
                              _tmp77_ = arg_type;
                              _tmp78_ = g_strconcat (_tmp77_, "*", NULL);
                              _g_free0 (arg_type);
                              arg_type = _tmp78_;
                        }
                        _tmp79_ = applys;
                        _tmp80_ = arg_type;
                        _tmp81_ = var_name;
                        _tmp82_ = arg_type;
                        _tmp83_ = arg_name;
                        _tmp84_ = g_strdup_printf ("  %%apply %s %s { %s %s };\n", _tmp80_, _tmp81_, _tmp82_, _tmp83_);
                        _tmp85_ = _tmp84_;
                        _tmp86_ = g_strconcat (_tmp79_, _tmp85_, NULL);
                        _g_free0 (applys);
                        applys = _tmp86_;
                        _g_free0 (_tmp85_);
                        _tmp87_ = clears;
                        _tmp88_ = arg_type;
                        _tmp89_ = arg_name;
                        _tmp90_ = g_strdup_printf ("  %%clear %s %s;\n", _tmp88_, _tmp89_);
                        _tmp91_ = _tmp90_;
                        _tmp92_ = g_strconcat (_tmp87_, _tmp91_, NULL);
                        _g_free0 (clears);
                        clears = _tmp92_;
                        _g_free0 (_tmp91_);
                        _g_free0 (var_name);
                  }
                  _tmp93_ = call_args;
                  _tmp94_ = pfx;
                  _tmp95_ = arg_name;
                  _tmp96_ = g_strdup_printf ("%s%s", _tmp94_, _tmp95_);
                  _tmp97_ = _tmp96_;
                  _tmp98_ = g_strconcat (_tmp93_, _tmp97_, NULL);
                  _g_free0 (call_args);
                  call_args = _tmp98_;
                  _g_free0 (_tmp97_);
                  _tmp99_ = def_args;
                  _tmp100_ = pfx;
                  _tmp101_ = arg_type;
                  _tmp102_ = arg_name;
                  _tmp103_ = g_strdup_printf ("%s%s %s", _tmp100_, _tmp101_, _tmp102_);
                  _tmp104_ = _tmp103_;
                  _tmp105_ = g_strconcat (_tmp99_, _tmp104_, NULL);
                  _g_free0 (def_args);
                  def_args = _tmp105_;
                  _g_free0 (_tmp104_);
                  _g_free0 (arg_type);
                  _vala_code_node_unref0 (bar);
                  _g_free0 (arg_name);
                  _vala_code_node_unref0 (foo);
            }
            _vala_iterable_unref0 (_foo_list);
      }
      _tmp106_ = self->priv->classname;
      if (g_strcmp0 (_tmp106_, "") == 0) {
            const gchar* _tmp107_;
            const gchar* _tmp108_;
            const gchar* _tmp109_;
            const gchar* _tmp110_;
            gchar* _tmp111_ = NULL;
            gchar* _tmp112_;
            gchar* _tmp113_;
            _tmp107_ = self->priv->externs;
            _tmp108_ = ret;
            _tmp109_ = cname;
            _tmp110_ = def_args;
            _tmp111_ = g_strdup_printf ("extern %s %s (%s);\n", _tmp108_, _tmp109_, _tmp110_);
            _tmp112_ = _tmp111_;
            _tmp113_ = g_strconcat (_tmp107_, _tmp112_, NULL);
            _g_free0 (self->priv->externs);
            self->priv->externs = _tmp113_;
            _g_free0 (_tmp112_);
      } else {
            gboolean _tmp114_;
            _tmp114_ = is_constructor;
            if (_tmp114_) {
                  const gchar* _tmp115_;
                  const gchar* _tmp116_;
                  const gchar* _tmp117_;
                  const gchar* _tmp118_;
                  gchar* _tmp119_ = NULL;
                  gchar* _tmp120_;
                  gchar* _tmp121_;
                  const gchar* _tmp122_;
                  const gchar* _tmp123_;
                  gchar* _tmp124_;
                  const gchar* _tmp125_;
                  const gchar* _tmp126_;
                  const gchar* _tmp127_;
                  gchar* _tmp128_ = NULL;
                  gchar* _tmp129_;
                  gchar* _tmp130_;
                  gboolean _tmp131_;
                  const gchar* _tmp134_;
                  const gchar* _tmp135_;
                  const gchar* _tmp136_;
                  gchar* _tmp137_ = NULL;
                  gchar* _tmp138_;
                  gchar* _tmp139_;
                  const gchar* _tmp140_;
                  const gchar* _tmp141_;
                  gchar* _tmp142_;
                  _tmp115_ = self->priv->externs;
                  _tmp116_ = self->priv->classcname;
                  _tmp117_ = cname;
                  _tmp118_ = def_args;
                  _tmp119_ = g_strdup_printf ("extern %s* %s (%s);\n", _tmp116_, _tmp117_, _tmp118_);
                  _tmp120_ = _tmp119_;
                  _tmp121_ = g_strconcat (_tmp115_, _tmp120_, NULL);
                  _g_free0 (self->priv->externs);
                  self->priv->externs = _tmp121_;
                  _g_free0 (_tmp120_);
                  _tmp122_ = self->priv->extends;
                  _tmp123_ = applys;
                  _tmp124_ = g_strconcat (_tmp122_, _tmp123_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp124_;
                  _tmp125_ = self->priv->extends;
                  _tmp126_ = self->priv->classname;
                  _tmp127_ = def_args;
                  _tmp128_ = g_strdup_printf ("  %s (%s) {\n", _tmp126_, _tmp127_);
                  _tmp129_ = _tmp128_;
                  _tmp130_ = g_strconcat (_tmp125_, _tmp129_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp130_;
                  _g_free0 (_tmp129_);
                  _tmp131_ = self->glib_mode;
                  if (_tmp131_) {
                        const gchar* _tmp132_;
                        gchar* _tmp133_;
                        _tmp132_ = self->priv->extends;
                        _tmp133_ = g_strconcat (_tmp132_, "    g_type_init ();\n", NULL);
                        _g_free0 (self->priv->extends);
                        self->priv->extends = _tmp133_;
                  }
                  _tmp134_ = self->priv->extends;
                  _tmp135_ = cname;
                  _tmp136_ = call_args;
                  _tmp137_ = g_strdup_printf ("    return %s (%s);\n  }\n", _tmp135_, _tmp136_);
                  _tmp138_ = _tmp137_;
                  _tmp139_ = g_strconcat (_tmp134_, _tmp138_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp139_;
                  _g_free0 (_tmp138_);
                  _tmp140_ = self->priv->extends;
                  _tmp141_ = clears;
                  _tmp142_ = g_strconcat (_tmp140_, _tmp141_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp142_;
            } else {
                  gboolean _tmp143_;
                  const gchar* _tmp155_;
                  const gchar* _tmp156_;
                  const gchar* _tmp157_;
                  const gchar* _tmp158_;
                  const gchar* _tmp159_;
                  gchar* _tmp160_ = NULL;
                  gchar* _tmp161_;
                  gchar* _tmp162_;
                  const gchar* _tmp163_;
                  const gchar* _tmp164_;
                  gchar* _tmp165_;
                  const gchar* _tmp166_;
                  gboolean _tmp167_;
                  gboolean _tmp182_ = FALSE;
                  gboolean _tmp183_;
                  gboolean _tmp186_;
                  const gchar* _tmp299_;
                  const gchar* _tmp300_;
                  gchar* _tmp301_;
                  _tmp143_ = is_static;
                  if (_tmp143_) {
                        const gchar* _tmp144_;
                        const gchar* _tmp145_;
                        const gchar* _tmp146_;
                        const gchar* _tmp147_;
                        gchar* _tmp148_ = NULL;
                        gchar* _tmp149_;
                        gchar* _tmp150_;
                        _tmp144_ = self->priv->statics;
                        _tmp145_ = ret;
                        _tmp146_ = cname;
                        _tmp147_ = def_args;
                        _tmp148_ = g_strdup_printf ("extern %s %s (%s);\n", _tmp145_, _tmp146_, _tmp147_);
                        _tmp149_ = _tmp148_;
                        _tmp150_ = g_strconcat (_tmp144_, _tmp149_, NULL);
                        _g_free0 (self->priv->statics);
                        self->priv->statics = _tmp150_;
                        _g_free0 (_tmp149_);
                  } else {
                        const gchar* _tmp151_;
                        _tmp151_ = call_args;
                        if (g_strcmp0 (_tmp151_, "") == 0) {
                              gchar* _tmp152_;
                              _tmp152_ = g_strdup ("self");
                              _g_free0 (call_args);
                              call_args = _tmp152_;
                        } else {
                              const gchar* _tmp153_;
                              gchar* _tmp154_;
                              _tmp153_ = call_args;
                              _tmp154_ = g_strconcat ("self, ", _tmp153_, NULL);
                              _g_free0 (call_args);
                              call_args = _tmp154_;
                        }
                  }
                  _tmp155_ = self->priv->externs;
                  _tmp156_ = ret;
                  _tmp157_ = cname;
                  _tmp158_ = self->priv->classname;
                  _tmp159_ = def_args;
                  _tmp160_ = g_strdup_printf ("extern %s %s (%s*, %s);\n", _tmp156_, _tmp157_, _tmp158_, _tmp159_);
                  _tmp161_ = _tmp160_;
                  _tmp162_ = g_strconcat (_tmp155_, _tmp161_, NULL);
                  _g_free0 (self->priv->externs);
                  self->priv->externs = _tmp162_;
                  _g_free0 (_tmp161_);
                  _tmp163_ = self->priv->extends;
                  _tmp164_ = applys;
                  _tmp165_ = g_strconcat (_tmp163_, _tmp164_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp165_;
                  _tmp166_ = ret;
                  if (g_strcmp0 (_tmp166_, "std::vector<string>") == 0) {
                        valabind_compiler_warning ("std::vector<string> is not supported yet");
                        _g_free0 (pfx);
                        _g_free0 (clears);
                        _g_free0 (applys);
                        _g_free0 (call_args);
                        _g_free0 (def_args);
                        _g_free0 (ret);
                        _g_free0 (alias);
                        _g_free0 (cname);
                        return;
                  }
                  _tmp167_ = is_static;
                  if (_tmp167_) {
                        const gchar* _tmp168_;
                        const gchar* _tmp169_;
                        const gchar* _tmp170_;
                        const gchar* _tmp171_;
                        gchar* _tmp172_ = NULL;
                        gchar* _tmp173_;
                        gchar* _tmp174_;
                        _tmp168_ = self->priv->extends;
                        _tmp169_ = ret;
                        _tmp170_ = alias;
                        _tmp171_ = def_args;
                        _tmp172_ = g_strdup_printf ("  static %s %s (%s) {\n", _tmp169_, _tmp170_, _tmp171_);
                        _tmp173_ = _tmp172_;
                        _tmp174_ = g_strconcat (_tmp168_, _tmp173_, NULL);
                        _g_free0 (self->priv->extends);
                        self->priv->extends = _tmp174_;
                        _g_free0 (_tmp173_);
                  } else {
                        const gchar* _tmp175_;
                        const gchar* _tmp176_;
                        const gchar* _tmp177_;
                        const gchar* _tmp178_;
                        gchar* _tmp179_ = NULL;
                        gchar* _tmp180_;
                        gchar* _tmp181_;
                        _tmp175_ = self->priv->extends;
                        _tmp176_ = ret;
                        _tmp177_ = alias;
                        _tmp178_ = def_args;
                        _tmp179_ = g_strdup_printf ("   %s %s (%s) {\n", _tmp176_, _tmp177_, _tmp178_);
                        _tmp180_ = _tmp179_;
                        _tmp181_ = g_strconcat (_tmp175_, _tmp180_, NULL);
                        _g_free0 (self->priv->extends);
                        self->priv->extends = _tmp181_;
                        _g_free0 (_tmp180_);
                  }
                  _tmp183_ = self->cxx_mode;
                  if (_tmp183_) {
                        const gchar* _tmp184_;
                        gint _tmp185_ = 0;
                        _tmp184_ = ret;
                        _tmp185_ = string_index_of (_tmp184_, "std::vector", 0);
                        _tmp182_ = _tmp185_ != (-1);
                  } else {
                        _tmp182_ = FALSE;
                  }
                  _tmp186_ = _tmp182_;
                  if (_tmp186_) {
                        const gchar* _tmp187_;
                        gint _tmp188_ = 0;
                        gint ptr;
                        gchar* _tmp189_ = NULL;
                        gint _tmp190_;
                        const gchar* _tmp199_;
                        gchar* _tmp200_;
                        gchar* iter_type;
                        const gchar* _tmp201_;
                        gchar* _tmp202_ = NULL;
                        const gchar* _tmp203_;
                        gchar* _tmp204_ = NULL;
                        const gchar* _tmp205_;
                        ValaMethod* _tmp206_;
                        ValaDataType* _tmp207_ = NULL;
                        ValaDataType* _tmp208_;
                        gchar* _tmp209_ = NULL;
                        gchar* _tmp210_;
                        gint _tmp211_ = 0;
                        gboolean _tmp212_;
                        const gchar* _tmp284_;
                        const gchar* _tmp285_;
                        const gchar* _tmp286_;
                        gchar* _tmp287_ = NULL;
                        gchar* _tmp288_;
                        gchar* _tmp289_;
                        _tmp187_ = ret;
                        _tmp188_ = string_index_of (_tmp187_, "<", 0);
                        ptr = _tmp188_;
                        _tmp190_ = ptr;
                        if (_tmp190_ == (-1)) {
                              const gchar* _tmp191_;
                              gchar* _tmp192_;
                              _tmp191_ = ret;
                              _tmp192_ = g_strdup (_tmp191_);
                              _g_free0 (_tmp189_);
                              _tmp189_ = _tmp192_;
                        } else {
                              const gchar* _tmp193_;
                              gint _tmp194_;
                              const gchar* _tmp195_;
                              gint _tmp196_ = 0;
                              gint _tmp197_;
                              gchar* _tmp198_ = NULL;
                              _tmp193_ = ret;
                              _tmp194_ = ptr;
                              _tmp195_ = ret;
                              _tmp196_ = strlen (_tmp195_);
                              _tmp197_ = _tmp196_;
                              _tmp198_ = string_slice (_tmp193_, (glong) _tmp194_, (glong) _tmp197_);
                              _g_free0 (_tmp189_);
                              _tmp189_ = _tmp198_;
                        }
                        _tmp199_ = _tmp189_;
                        _tmp200_ = g_strdup (_tmp199_);
                        iter_type = _tmp200_;
                        _tmp201_ = iter_type;
                        _tmp202_ = string_replace (_tmp201_, "<", "");
                        _g_free0 (iter_type);
                        iter_type = _tmp202_;
                        _tmp203_ = iter_type;
                        _tmp204_ = string_replace (_tmp203_, ">", "");
                        _g_free0 (iter_type);
                        iter_type = _tmp204_;
                        _tmp205_ = iter_type;
                        if (g_strcmp0 (_tmp205_, "G*") == 0) {
                              valabind_compiler_error ("Fuck, no <G> type support.\n");
                        }
                        _tmp206_ = m;
                        _tmp207_ = vala_method_get_return_type (_tmp206_);
                        _tmp208_ = _tmp207_;
                        _tmp209_ = vala_code_node_to_string ((ValaCodeNode*) _tmp208_);
                        _tmp210_ = _tmp209_;
                        _tmp211_ = string_index_of (_tmp210_, "RFList", 0);
                        _tmp212_ = _tmp211_ != (-1);
                        _g_free0 (_tmp210_);
                        if (_tmp212_) {
                              const gchar* _tmp213_;
                              const gchar* _tmp214_;
                              gchar* _tmp215_ = NULL;
                              gchar* _tmp216_;
                              gchar* _tmp217_;
                              const gchar* _tmp218_;
                              gchar* _tmp219_;
                              const gchar* _tmp220_;
                              const gchar* _tmp221_;
                              gchar* _tmp222_ = NULL;
                              gchar* _tmp223_;
                              gchar* _tmp224_;
                              const gchar* _tmp225_;
                              const gchar* _tmp226_;
                              const gchar* _tmp227_;
                              gchar* _tmp228_ = NULL;
                              gchar* _tmp229_;
                              gchar* _tmp230_;
                              const gchar* _tmp231_;
                              gchar* _tmp232_;
                              const gchar* _tmp233_;
                              const gchar* _tmp234_;
                              gchar* _tmp235_ = NULL;
                              gchar* _tmp236_;
                              gchar* _tmp237_;
                              const gchar* _tmp238_;
                              gchar* _tmp239_;
                              const gchar* _tmp240_;
                              gchar* _tmp241_;
                              const gchar* _tmp242_;
                              gchar* _tmp243_;
                              _tmp213_ = self->priv->extends;
                              _tmp214_ = ret;
                              _tmp215_ = g_strdup_printf ("    %s ret;\n", _tmp214_);
                              _tmp216_ = _tmp215_;
                              _tmp217_ = g_strconcat (_tmp213_, _tmp216_, NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp217_;
                              _g_free0 (_tmp216_);
                              _tmp218_ = self->priv->extends;
                              _tmp219_ = g_strconcat (_tmp218_, "    void** array;\n", NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp219_;
                              _tmp220_ = self->priv->extends;
                              _tmp221_ = iter_type;
                              _tmp222_ = g_strdup_printf ("    %s *item;\n", _tmp221_);
                              _tmp223_ = _tmp222_;
                              _tmp224_ = g_strconcat (_tmp220_, _tmp223_, NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp224_;
                              _g_free0 (_tmp223_);
                              _tmp225_ = self->priv->extends;
                              _tmp226_ = cname;
                              _tmp227_ = call_args;
                              _tmp228_ = g_strdup_printf ("    array = %s (%s);\n", _tmp226_, _tmp227_);
                              _tmp229_ = _tmp228_;
                              _tmp230_ = g_strconcat (_tmp225_, _tmp229_, NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp230_;
                              _g_free0 (_tmp229_);
                              _tmp231_ = self->priv->extends;
                              _tmp232_ = g_strconcat (_tmp231_, "    r_flist_rewind (array);\n", NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp232_;
                              _tmp233_ = self->priv->extends;
                              _tmp234_ = iter_type;
                              _tmp235_ = g_strdup_printf ("    while (*array != 0 && (item = (%s*)(*array++)))\n", _tmp234_);
                              _tmp236_ = _tmp235_;
                              _tmp237_ = g_strconcat (_tmp233_, _tmp236_, NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp237_;
                              _g_free0 (_tmp236_);
                              _tmp238_ = self->priv->extends;
                              _tmp239_ = g_strconcat (_tmp238_, "        ret.push_back(*item);\n", NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp239_;
                              _tmp240_ = self->priv->extends;
                              _tmp241_ = g_strconcat (_tmp240_, "    return ret;\n", NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp241_;
                              _tmp242_ = self->priv->extends;
                              _tmp243_ = g_strconcat (_tmp242_, "  }\n", NULL);
                              _g_free0 (self->priv->extends);
                              self->priv->extends = _tmp243_;
                        } else {
                              ValaMethod* _tmp244_;
                              ValaDataType* _tmp245_ = NULL;
                              ValaDataType* _tmp246_;
                              gchar* _tmp247_ = NULL;
                              gchar* _tmp248_;
                              gint _tmp249_ = 0;
                              gboolean _tmp250_;
                              _tmp244_ = m;
                              _tmp245_ = vala_method_get_return_type (_tmp244_);
                              _tmp246_ = _tmp245_;
                              _tmp247_ = vala_code_node_to_string ((ValaCodeNode*) _tmp246_);
                              _tmp248_ = _tmp247_;
                              _tmp249_ = string_index_of (_tmp248_, "RList", 0);
                              _tmp250_ = _tmp249_ != (-1);
                              _g_free0 (_tmp248_);
                              if (_tmp250_) {
                                    const gchar* _tmp251_;
                                    gchar* _tmp252_ = NULL;
                                    const gchar* _tmp253_;
                                    const gchar* _tmp254_;
                                    gchar* _tmp255_ = NULL;
                                    gchar* _tmp256_;
                                    gchar* _tmp257_;
                                    const gchar* _tmp258_;
                                    gchar* _tmp259_;
                                    const gchar* _tmp260_;
                                    gchar* _tmp261_;
                                    const gchar* _tmp262_;
                                    const gchar* _tmp263_;
                                    gchar* _tmp264_ = NULL;
                                    gchar* _tmp265_;
                                    gchar* _tmp266_;
                                    const gchar* _tmp267_;
                                    const gchar* _tmp268_;
                                    const gchar* _tmp269_;
                                    gchar* _tmp270_ = NULL;
                                    gchar* _tmp271_;
                                    gchar* _tmp272_;
                                    const gchar* _tmp273_;
                                    const gchar* _tmp274_;
                                    gchar* _tmp275_ = NULL;
                                    gchar* _tmp276_;
                                    gchar* _tmp277_;
                                    const gchar* _tmp278_;
                                    gchar* _tmp279_;
                                    const gchar* _tmp280_;
                                    gchar* _tmp281_;
                                    const gchar* _tmp282_;
                                    gchar* _tmp283_;
                                    _tmp251_ = ret;
                                    _tmp252_ = string_replace (_tmp251_, "string", "const char*");
                                    _g_free0 (ret);
                                    ret = _tmp252_;
                                    _tmp253_ = self->priv->extends;
                                    _tmp254_ = ret;
                                    _tmp255_ = g_strdup_printf ("    %s ret;\n", _tmp254_);
                                    _tmp256_ = _tmp255_;
                                    _tmp257_ = g_strconcat (_tmp253_, _tmp256_, NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp257_;
                                    _g_free0 (_tmp256_);
                                    _tmp258_ = self->priv->extends;
                                    _tmp259_ = g_strconcat (_tmp258_, "    RList *list;\n", NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp259_;
                                    _tmp260_ = self->priv->extends;
                                    _tmp261_ = g_strconcat (_tmp260_, "    RListIter *iter;\n", NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp261_;
                                    _tmp262_ = self->priv->extends;
                                    _tmp263_ = iter_type;
                                    _tmp264_ = g_strdup_printf ("    %s *item;\n", _tmp263_);
                                    _tmp265_ = _tmp264_;
                                    _tmp266_ = g_strconcat (_tmp262_, _tmp265_, NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp266_;
                                    _g_free0 (_tmp265_);
                                    _tmp267_ = self->priv->extends;
                                    _tmp268_ = cname;
                                    _tmp269_ = call_args;
                                    _tmp270_ = g_strdup_printf ("    list = %s (%s);\n", _tmp268_, _tmp269_);
                                    _tmp271_ = _tmp270_;
                                    _tmp272_ = g_strconcat (_tmp267_, _tmp271_, NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp272_;
                                    _g_free0 (_tmp271_);
                                    _tmp273_ = self->priv->extends;
                                    _tmp274_ = iter_type;
                                    _tmp275_ = g_strdup_printf ("    for (iter = list->head; iter && (item = (%s*)iter->data); iter = i" \
"ter->n)\n", _tmp274_);
                                    _tmp276_ = _tmp275_;
                                    _tmp277_ = g_strconcat (_tmp273_, _tmp276_, NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp277_;
                                    _g_free0 (_tmp276_);
                                    _tmp278_ = self->priv->extends;
                                    _tmp279_ = g_strconcat (_tmp278_, "        ret.push_back(*item);\n", NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp279_;
                                    _tmp280_ = self->priv->extends;
                                    _tmp281_ = g_strconcat (_tmp280_, "    return ret;\n", NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp281_;
                                    _tmp282_ = self->priv->extends;
                                    _tmp283_ = g_strconcat (_tmp282_, "  }\n", NULL);
                                    _g_free0 (self->priv->extends);
                                    self->priv->extends = _tmp283_;
                              }
                        }
                        _tmp284_ = self->priv->vectors;
                        _tmp285_ = iter_type;
                        _tmp286_ = iter_type;
                        _tmp287_ = g_strdup_printf ("  %%template(%sVector) std::vector<%s>;\n", _tmp285_, _tmp286_);
                        _tmp288_ = _tmp287_;
                        _tmp289_ = g_strconcat (_tmp284_, _tmp288_, NULL);
                        _g_free0 (self->priv->vectors);
                        self->priv->vectors = _tmp289_;
                        _g_free0 (_tmp288_);
                        _g_free0 (iter_type);
                        _g_free0 (_tmp189_);
                  } else {
                        const gchar* _tmp290_ = NULL;
                        gboolean _tmp291_;
                        const gchar* _tmp292_;
                        const gchar* _tmp293_;
                        const gchar* _tmp294_;
                        const gchar* _tmp295_;
                        gchar* _tmp296_ = NULL;
                        gchar* _tmp297_;
                        gchar* _tmp298_;
                        _tmp291_ = void_return;
                        if (_tmp291_) {
                              _tmp290_ = "";
                        } else {
                              _tmp290_ = "return";
                        }
                        _tmp292_ = self->priv->extends;
                        _tmp293_ = _tmp290_;
                        _tmp294_ = cname;
                        _tmp295_ = call_args;
                        _tmp296_ = g_strdup_printf ("    %s %s (%s);\n  }\n", _tmp293_, _tmp294_, _tmp295_);
                        _tmp297_ = _tmp296_;
                        _tmp298_ = g_strconcat (_tmp292_, _tmp297_, NULL);
                        _g_free0 (self->priv->extends);
                        self->priv->extends = _tmp298_;
                        _g_free0 (_tmp297_);
                  }
                  _tmp299_ = self->priv->extends;
                  _tmp300_ = clears;
                  _tmp301_ = g_strconcat (_tmp299_, _tmp300_, NULL);
                  _g_free0 (self->priv->extends);
                  self->priv->extends = _tmp301_;
            }
      }
      _g_free0 (pfx);
      _g_free0 (clears);
      _g_free0 (applys);
      _g_free0 (call_args);
      _g_free0 (def_args);
      _g_free0 (ret);
      _g_free0 (alias);
      _g_free0 (cname);
}


static gpointer _vala_source_reference_ref0 (gpointer self) {
      return self ? vala_source_reference_ref (self) : NULL;
}


static void swig_writer_real_visit_namespace (ValaCodeVisitor* base, ValaNamespace* ns) {
      SwigWriter * self;
      ValaNamespace* _tmp0_;
      const gchar* _tmp1_ = NULL;
      const gchar* _tmp2_;
      ValaNamespace* _tmp3_;
      ValaSourceReference* _tmp4_ = NULL;
      ValaSourceReference* _tmp5_;
      ValaSourceReference* _tmp6_;
      ValaSourceReference* sr;
      gboolean _tmp7_ = FALSE;
      ValaSourceReference* _tmp8_;
      gboolean _tmp15_;
      ValaNamespace* _tmp16_;
      const gchar* _tmp17_ = NULL;
      const gchar* _tmp18_;
      gchar* _tmp19_;
      ValaNamespace* _tmp20_;
      gboolean _tmp21_ = FALSE;
      gboolean _tmp22_;
      gboolean _tmp30_;
      self = (SwigWriter*) base;
      g_return_if_fail (ns != NULL);
      _tmp0_ = ns;
      _tmp1_ = vala_symbol_get_name ((ValaSymbol*) _tmp0_);
      _tmp2_ = _tmp1_;
      if (_tmp2_ == NULL) {
            return;
      }
      _tmp3_ = ns;
      _tmp4_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp3_);
      _tmp5_ = _tmp4_;
      _tmp6_ = _vala_source_reference_ref0 (_tmp5_);
      sr = _tmp6_;
      _tmp8_ = sr;
      if (_tmp8_ != NULL) {
            ValaSourceReference* _tmp9_;
            ValaSourceFile* _tmp10_ = NULL;
            ValaSourceFile* _tmp11_;
            const gchar* _tmp12_ = NULL;
            const gchar* _tmp13_;
            gboolean _tmp14_ = FALSE;
            _tmp9_ = sr;
            _tmp10_ = vala_source_reference_get_file (_tmp9_);
            _tmp11_ = _tmp10_;
            _tmp12_ = vala_source_file_get_filename (_tmp11_);
            _tmp13_ = _tmp12_;
            _tmp14_ = swig_writer_is_target_file (self, _tmp13_);
            _tmp7_ = !_tmp14_;
      } else {
            _tmp7_ = FALSE;
      }
      _tmp15_ = _tmp7_;
      if (_tmp15_) {
            _vala_source_reference_unref0 (sr);
            return;
      }
      _tmp16_ = ns;
      _tmp17_ = vala_symbol_get_name ((ValaSymbol*) _tmp16_);
      _tmp18_ = _tmp17_;
      _tmp19_ = g_strdup (_tmp18_);
      _g_free0 (self->priv->nspace);
      self->priv->nspace = _tmp19_;
      _tmp20_ = ns;
      swig_writer_process_includes (self, (ValaSymbol*) _tmp20_);
      _tmp22_ = self->pkgmode;
      if (_tmp22_) {
            ValaSourceReference* _tmp23_;
            ValaSourceFile* _tmp24_ = NULL;
            ValaSourceFile* _tmp25_;
            const gchar* _tmp26_ = NULL;
            const gchar* _tmp27_;
            const gchar* _tmp28_;
            gint _tmp29_ = 0;
            _tmp23_ = sr;
            _tmp24_ = vala_source_reference_get_file (_tmp23_);
            _tmp25_ = _tmp24_;
            _tmp26_ = vala_source_file_get_filename (_tmp25_);
            _tmp27_ = _tmp26_;
            _tmp28_ = self->pkgname;
            _tmp29_ = string_index_of (_tmp27_, _tmp28_, 0);
            _tmp21_ = _tmp29_ == (-1);
      } else {
            _tmp21_ = FALSE;
      }
      _tmp30_ = _tmp21_;
      if (_tmp30_) {
            _vala_source_reference_unref0 (sr);
            return;
      }
      {
            ValaNamespace* _tmp31_;
            ValaList* _tmp32_ = NULL;
            ValaList* _f_list;
            ValaList* _tmp33_;
            gint _tmp34_ = 0;
            gint _tmp35_;
            gint _f_size;
            gint _f_index;
            _tmp31_ = ns;
            _tmp32_ = vala_namespace_get_fields (_tmp31_);
            _f_list = _tmp32_;
            _tmp33_ = _f_list;
            _tmp34_ = vala_collection_get_size ((ValaCollection*) _tmp33_);
            _tmp35_ = _tmp34_;
            _f_size = _tmp35_;
            _f_index = -1;
            while (TRUE) {
                  gint _tmp36_;
                  gint _tmp37_;
                  gint _tmp38_;
                  ValaList* _tmp39_;
                  gint _tmp40_;
                  gpointer _tmp41_ = NULL;
                  ValaField* f;
                  ValaField* _tmp42_;
                  _tmp36_ = _f_index;
                  _f_index = _tmp36_ + 1;
                  _tmp37_ = _f_index;
                  _tmp38_ = _f_size;
                  if (!(_tmp37_ < _tmp38_)) {
                        break;
                  }
                  _tmp39_ = _f_list;
                  _tmp40_ = _f_index;
                  _tmp41_ = vala_list_get (_tmp39_, _tmp40_);
                  f = (ValaField*) _tmp41_;
                  _tmp42_ = f;
                  swig_writer_walk_field (self, _tmp42_);
                  _vala_code_node_unref0 (f);
            }
            _vala_iterable_unref0 (_f_list);
      }
      {
            ValaNamespace* _tmp43_;
            ValaList* _tmp44_ = NULL;
            ValaList* _e_list;
            ValaList* _tmp45_;
            gint _tmp46_ = 0;
            gint _tmp47_;
            gint _e_size;
            gint _e_index;
            _tmp43_ = ns;
            _tmp44_ = vala_namespace_get_enums (_tmp43_);
            _e_list = _tmp44_;
            _tmp45_ = _e_list;
            _tmp46_ = vala_collection_get_size ((ValaCollection*) _tmp45_);
            _tmp47_ = _tmp46_;
            _e_size = _tmp47_;
            _e_index = -1;
            while (TRUE) {
                  gint _tmp48_;
                  gint _tmp49_;
                  gint _tmp50_;
                  ValaList* _tmp51_;
                  gint _tmp52_;
                  gpointer _tmp53_ = NULL;
                  ValaEnum* e;
                  ValaEnum* _tmp54_;
                  _tmp48_ = _e_index;
                  _e_index = _tmp48_ + 1;
                  _tmp49_ = _e_index;
                  _tmp50_ = _e_size;
                  if (!(_tmp49_ < _tmp50_)) {
                        break;
                  }
                  _tmp51_ = _e_list;
                  _tmp52_ = _e_index;
                  _tmp53_ = vala_list_get (_tmp51_, _tmp52_);
                  e = (ValaEnum*) _tmp53_;
                  _tmp54_ = e;
                  swig_writer_walk_enum (self, _tmp54_);
                  _vala_code_node_unref0 (e);
            }
            _vala_iterable_unref0 (_e_list);
      }
      {
            ValaNamespace* _tmp55_;
            ValaList* _tmp56_ = NULL;
            ValaList* _c_list;
            ValaList* _tmp57_;
            gint _tmp58_ = 0;
            gint _tmp59_;
            gint _c_size;
            gint _c_index;
            _tmp55_ = ns;
            _tmp56_ = vala_namespace_get_structs (_tmp55_);
            _c_list = _tmp56_;
            _tmp57_ = _c_list;
            _tmp58_ = vala_collection_get_size ((ValaCollection*) _tmp57_);
            _tmp59_ = _tmp58_;
            _c_size = _tmp59_;
            _c_index = -1;
            while (TRUE) {
                  gint _tmp60_;
                  gint _tmp61_;
                  gint _tmp62_;
                  ValaList* _tmp63_;
                  gint _tmp64_;
                  gpointer _tmp65_ = NULL;
                  ValaStruct* c;
                  _tmp60_ = _c_index;
                  _c_index = _tmp60_ + 1;
                  _tmp61_ = _c_index;
                  _tmp62_ = _c_size;
                  if (!(_tmp61_ < _tmp62_)) {
                        break;
                  }
                  _tmp63_ = _c_list;
                  _tmp64_ = _c_index;
                  _tmp65_ = vala_list_get (_tmp63_, _tmp64_);
                  c = (ValaStruct*) _tmp65_;
                  {
                        ValaStruct* _tmp66_;
                        ValaList* _tmp67_ = NULL;
                        ValaList* _m_list;
                        ValaList* _tmp68_;
                        gint _tmp69_ = 0;
                        gint _tmp70_;
                        gint _m_size;
                        gint _m_index;
                        _tmp66_ = c;
                        _tmp67_ = vala_struct_get_methods (_tmp66_);
                        _m_list = _tmp67_;
                        _tmp68_ = _m_list;
                        _tmp69_ = vala_collection_get_size ((ValaCollection*) _tmp68_);
                        _tmp70_ = _tmp69_;
                        _m_size = _tmp70_;
                        _m_index = -1;
                        while (TRUE) {
                              gint _tmp71_;
                              gint _tmp72_;
                              gint _tmp73_;
                              ValaList* _tmp74_;
                              gint _tmp75_;
                              gpointer _tmp76_ = NULL;
                              ValaMethod* m;
                              ValaMethod* _tmp77_;
                              _tmp71_ = _m_index;
                              _m_index = _tmp71_ + 1;
                              _tmp72_ = _m_index;
                              _tmp73_ = _m_size;
                              if (!(_tmp72_ < _tmp73_)) {
                                    break;
                              }
                              _tmp74_ = _m_list;
                              _tmp75_ = _m_index;
                              _tmp76_ = vala_list_get (_tmp74_, _tmp75_);
                              m = (ValaMethod*) _tmp76_;
                              _tmp77_ = m;
                              swig_writer_walk_method (self, _tmp77_);
                              _vala_code_node_unref0 (m);
                        }
                        _vala_iterable_unref0 (_m_list);
                  }
                  {
                        ValaStruct* _tmp78_;
                        ValaList* _tmp79_ = NULL;
                        ValaList* _f_list;
                        ValaList* _tmp80_;
                        gint _tmp81_ = 0;
                        gint _tmp82_;
                        gint _f_size;
                        gint _f_index;
                        _tmp78_ = c;
                        _tmp79_ = vala_struct_get_fields (_tmp78_);
                        _f_list = _tmp79_;
                        _tmp80_ = _f_list;
                        _tmp81_ = vala_collection_get_size ((ValaCollection*) _tmp80_);
                        _tmp82_ = _tmp81_;
                        _f_size = _tmp82_;
                        _f_index = -1;
                        while (TRUE) {
                              gint _tmp83_;
                              gint _tmp84_;
                              gint _tmp85_;
                              ValaList* _tmp86_;
                              gint _tmp87_;
                              gpointer _tmp88_ = NULL;
                              ValaField* f;
                              ValaField* _tmp89_;
                              _tmp83_ = _f_index;
                              _f_index = _tmp83_ + 1;
                              _tmp84_ = _f_index;
                              _tmp85_ = _f_size;
                              if (!(_tmp84_ < _tmp85_)) {
                                    break;
                              }
                              _tmp86_ = _f_list;
                              _tmp87_ = _f_index;
                              _tmp88_ = vala_list_get (_tmp86_, _tmp87_);
                              f = (ValaField*) _tmp88_;
                              _tmp89_ = f;
                              swig_writer_walk_field (self, _tmp89_);
                              _vala_code_node_unref0 (f);
                        }
                        _vala_iterable_unref0 (_f_list);
                  }
                  _vala_code_node_unref0 (c);
            }
            _vala_iterable_unref0 (_c_list);
      }
      {
            ValaNamespace* _tmp90_;
            ValaList* _tmp91_ = NULL;
            ValaList* _m_list;
            ValaList* _tmp92_;
            gint _tmp93_ = 0;
            gint _tmp94_;
            gint _m_size;
            gint _m_index;
            _tmp90_ = ns;
            _tmp91_ = vala_namespace_get_methods (_tmp90_);
            _m_list = _tmp91_;
            _tmp92_ = _m_list;
            _tmp93_ = vala_collection_get_size ((ValaCollection*) _tmp92_);
            _tmp94_ = _tmp93_;
            _m_size = _tmp94_;
            _m_index = -1;
            while (TRUE) {
                  gint _tmp95_;
                  gint _tmp96_;
                  gint _tmp97_;
                  ValaList* _tmp98_;
                  gint _tmp99_;
                  gpointer _tmp100_ = NULL;
                  ValaMethod* m;
                  ValaMethod* _tmp101_;
                  _tmp95_ = _m_index;
                  _m_index = _tmp95_ + 1;
                  _tmp96_ = _m_index;
                  _tmp97_ = _m_size;
                  if (!(_tmp96_ < _tmp97_)) {
                        break;
                  }
                  _tmp98_ = _m_list;
                  _tmp99_ = _m_index;
                  _tmp100_ = vala_list_get (_tmp98_, _tmp99_);
                  m = (ValaMethod*) _tmp100_;
                  _tmp101_ = m;
                  swig_writer_walk_method (self, _tmp101_);
                  _vala_code_node_unref0 (m);
            }
            _vala_iterable_unref0 (_m_list);
      }
      {
            ValaNamespace* _tmp102_;
            ValaList* _tmp103_ = NULL;
            ValaList* _c_list;
            ValaList* _tmp104_;
            gint _tmp105_ = 0;
            gint _tmp106_;
            gint _c_size;
            gint _c_index;
            _tmp102_ = ns;
            _tmp103_ = vala_namespace_get_classes (_tmp102_);
            _c_list = _tmp103_;
            _tmp104_ = _c_list;
            _tmp105_ = vala_collection_get_size ((ValaCollection*) _tmp104_);
            _tmp106_ = _tmp105_;
            _c_size = _tmp106_;
            _c_index = -1;
            while (TRUE) {
                  gint _tmp107_;
                  gint _tmp108_;
                  gint _tmp109_;
                  ValaList* _tmp110_;
                  gint _tmp111_;
                  gpointer _tmp112_ = NULL;
                  ValaClass* c;
                  ValaClass* _tmp113_;
                  _tmp107_ = _c_index;
                  _c_index = _tmp107_ + 1;
                  _tmp108_ = _c_index;
                  _tmp109_ = _c_size;
                  if (!(_tmp108_ < _tmp109_)) {
                        break;
                  }
                  _tmp110_ = _c_list;
                  _tmp111_ = _c_index;
                  _tmp112_ = vala_list_get (_tmp110_, _tmp111_);
                  c = (ValaClass*) _tmp112_;
                  _tmp113_ = c;
                  swig_writer_walk_class (self, "", _tmp113_);
                  _vala_code_node_unref0 (c);
            }
            _vala_iterable_unref0 (_c_list);
      }
      _vala_source_reference_unref0 (sr);
}


static gpointer _vala_code_context_ref0 (gpointer self) {
      return self ? vala_code_context_ref (self) : NULL;
}


void swig_writer_write_file (SwigWriter* self, ValaCodeContext* context, const gchar* filename) {
      const gchar* _tmp0_;
      FILE* _tmp1_ = NULL;
      FILE* _tmp2_;
      ValaCodeContext* _tmp6_;
      ValaCodeContext* _tmp7_;
      ValaCodeContext* _tmp8_;
      FILE* _tmp9_;
      const gchar* _tmp10_;
      gboolean _tmp11_;
      GList* _tmp13_;
      guint _tmp14_ = 0U;
      FILE* _tmp23_;
      GList* _tmp24_;
      gboolean _tmp28_;
      FILE* _tmp33_;
      const gchar* _tmp34_;
      gboolean _tmp35_;
      FILE* _tmp38_;
      const gchar* _tmp39_;
      FILE* _tmp40_;
      const gchar* _tmp41_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (context != NULL);
      g_return_if_fail (filename != NULL);
      _tmp0_ = filename;
      _tmp1_ = fopen (_tmp0_, "w");
      _fclose0 (self->priv->stream);
      self->priv->stream = _tmp1_;
      _tmp2_ = self->priv->stream;
      if (_tmp2_ == NULL) {
            const gchar* _tmp3_;
            gchar* _tmp4_ = NULL;
            gchar* _tmp5_;
            _tmp3_ = filename;
            _tmp4_ = g_strdup_printf ("Cannot open %s for writing", _tmp3_);
            _tmp5_ = _tmp4_;
            g_error ("swigwriter.vala:415: %s", _tmp5_);
            _g_free0 (_tmp5_);
      }
      _tmp6_ = context;
      _tmp7_ = _vala_code_context_ref0 (_tmp6_);
      _vala_code_context_unref0 (self->priv->context);
      self->priv->context = _tmp7_;
      _tmp8_ = context;
      vala_code_context_accept (_tmp8_, (ValaCodeVisitor*) self);
      _tmp9_ = self->priv->stream;
      _tmp10_ = self->priv->modulename;
      fprintf (_tmp9_, "%%module %s\n%%{\n", _tmp10_);
      _tmp11_ = self->cxx_mode;
      if (!_tmp11_) {
            FILE* _tmp12_;
            _tmp12_ = self->priv->stream;
            fprintf (_tmp12_, "%s", "#define bool int\n" "#define true 1\n" "#define false 0\n");
      }
      _tmp13_ = self->includefiles;
      _tmp14_ = g_list_length (_tmp13_);
      if (_tmp14_ > ((guint) 0)) {
            gboolean _tmp15_;
            GList* _tmp17_;
            gboolean _tmp21_;
            _tmp15_ = self->cxx_mode;
            if (_tmp15_) {
                  FILE* _tmp16_;
                  _tmp16_ = self->priv->stream;
                  fprintf (_tmp16_, "extern \"C\" {\n");
            }
            _tmp17_ = self->includefiles;
            {
                  GList* inc_collection = NULL;
                  GList* inc_it = NULL;
                  inc_collection = _tmp17_;
                  for (inc_it = inc_collection; inc_it != NULL; inc_it = inc_it->next) {
                        gchar* _tmp18_;
                        gchar* inc = NULL;
                        _tmp18_ = g_strdup ((const gchar*) inc_it->data);
                        inc = _tmp18_;
                        {
                              FILE* _tmp19_;
                              const gchar* _tmp20_;
                              _tmp19_ = self->priv->stream;
                              _tmp20_ = inc;
                              fprintf (_tmp19_, "#include <%s>\n", _tmp20_);
                              _g_free0 (inc);
                        }
                  }
            }
            _tmp21_ = self->cxx_mode;
            if (_tmp21_) {
                  FILE* _tmp22_;
                  _tmp22_ = self->priv->stream;
                  fprintf (_tmp22_, "}\n#include <vector>\n");
            }
      }
      _tmp23_ = self->priv->stream;
      fprintf (_tmp23_, "%%}\n");
      _tmp24_ = self->includefiles;
      {
            GList* inc_collection = NULL;
            GList* inc_it = NULL;
            inc_collection = _tmp24_;
            for (inc_it = inc_collection; inc_it != NULL; inc_it = inc_it->next) {
                  gchar* _tmp25_;
                  gchar* inc = NULL;
                  _tmp25_ = g_strdup ((const gchar*) inc_it->data);
                  inc = _tmp25_;
                  {
                        FILE* _tmp26_;
                        const gchar* _tmp27_;
                        _tmp26_ = self->priv->stream;
                        _tmp27_ = inc;
                        fprintf (_tmp26_, "%%include <%s>\n", _tmp27_);
                        _g_free0 (inc);
                  }
            }
      }
      _tmp28_ = self->cxx_mode;
      if (_tmp28_) {
            FILE* _tmp29_;
            const gchar* _tmp30_;
            _tmp29_ = self->priv->stream;
            fprintf (_tmp29_, "%%include \"std_vector.i\"\n\n");
            _tmp30_ = self->priv->vectors;
            if (g_strcmp0 (_tmp30_, "") != 0) {
                  FILE* _tmp31_;
                  const gchar* _tmp32_;
                  _tmp31_ = self->priv->stream;
                  _tmp32_ = self->priv->vectors;
                  fprintf (_tmp31_, "namespace std {\n%s}\n", _tmp32_);
            }
      }
      _tmp33_ = self->priv->stream;
      _tmp34_ = self->priv->enums;
      fprintf (_tmp33_, "%s\n", _tmp34_);
      _tmp35_ = self->show_externs;
      if (_tmp35_) {
            FILE* _tmp36_;
            const gchar* _tmp37_;
            _tmp36_ = self->priv->stream;
            _tmp37_ = self->priv->externs;
            fprintf (_tmp36_, "%s\n", _tmp37_);
      }
      _tmp38_ = self->priv->stream;
      _tmp39_ = self->priv->statics;
      fprintf (_tmp38_, "%s\n", _tmp39_);
      _tmp40_ = self->priv->stream;
      _tmp41_ = self->priv->extends;
      fprintf (_tmp40_, "%s\n", _tmp41_);
      _fclose0 (self->priv->stream);
      self->priv->stream = NULL;
}


static void swig_writer_class_init (SwigWriterClass * klass) {
      swig_writer_parent_class = g_type_class_peek_parent (klass);
      VALA_CODE_VISITOR_CLASS (klass)->finalize = swig_writer_finalize;
      g_type_class_add_private (klass, sizeof (SwigWriterPrivate));
      VALA_CODE_VISITOR_CLASS (klass)->visit_source_file = swig_writer_real_visit_source_file;
      VALA_CODE_VISITOR_CLASS (klass)->visit_namespace = swig_writer_real_visit_namespace;
}


static void swig_writer_instance_init (SwigWriter * self) {
      self->priv = SWIG_WRITER_GET_PRIVATE (self);
}


static void swig_writer_finalize (ValaCodeVisitor* obj) {
      SwigWriter * self;
      self = SWIG_WRITER (obj);
      _g_free0 (self->pkgname);
      self->files = (_vala_array_free (self->files, self->files_length1, (GDestroyNotify) g_free), NULL);
      __g_list_free__g_free0_0 (self->includefiles);
      __g_list_free__vala_code_node_unref0_0 (self->methods);
      _vala_code_context_unref0 (self->priv->context);
      _fclose0 (self->priv->stream);
      _g_free0 (self->priv->classname);
      _g_free0 (self->priv->classcname);
      _g_free0 (self->priv->externs);
      _g_free0 (self->priv->statics);
      _g_free0 (self->priv->extends);
      _g_free0 (self->priv->enums);
      _g_free0 (self->priv->vectors);
      _g_free0 (self->priv->nspace);
      _g_free0 (self->priv->modulename);
      VALA_CODE_VISITOR_CLASS (swig_writer_parent_class)->finalize (obj);
}


GType swig_writer_get_type (void) {
      static volatile gsize swig_writer_type_id__volatile = 0;
      if (g_once_init_enter (&swig_writer_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (SwigWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) swig_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwigWriter), 0, (GInstanceInitFunc) swig_writer_instance_init, NULL };
            GType swig_writer_type_id;
            swig_writer_type_id = g_type_register_static (VALA_TYPE_CODE_VISITOR, "SwigWriter", &g_define_type_info, 0);
            g_once_init_leave (&swig_writer_type_id__volatile, swig_writer_type_id);
      }
      return swig_writer_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      if ((array != NULL) && (destroy_func != NULL)) {
            int i;
            for (i = 0; i < array_length; i = i + 1) {
                  if (((gpointer*) array)[i] != NULL) {
                        destroy_func (((gpointer*) array)[i]);
                  }
            }
      }
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      _vala_array_destroy (array, array_length, destroy_func);
      g_free (array);
}


static gint _vala_array_length (gpointer array) {
      int length;
      length = 0;
      if (array) {
            while (((gpointer*) array)[length]) {
                  length++;
            }
      }
      return length;
}




Generated by  Doxygen 1.6.0   Back to index