Logo Search packages:      
Sourcecode: valatoys version File versions  Download package

vbftest.c

/* vbftest.c generated by valac 0.10.0, the Vala compiler
 * generated from vbftest.vala, do not modify */

/*
 *  vbftest.vala - Vala Build Framework library
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <vbf.h>
#include <valagee.h>
#include <stdio.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>


#define VBF_TESTS_TYPE_OPEN_TEST (vbf_tests_open_test_get_type ())
#define VBF_TESTS_OPEN_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTest))
#define VBF_TESTS_OPEN_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTestClass))
#define VBF_TESTS_IS_OPEN_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TESTS_TYPE_OPEN_TEST))
#define VBF_TESTS_IS_OPEN_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TESTS_TYPE_OPEN_TEST))
#define VBF_TESTS_OPEN_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTestClass))

typedef struct _VbfTestsOpenTest VbfTestsOpenTest;
typedef struct _VbfTestsOpenTestClass VbfTestsOpenTestClass;
typedef struct _VbfTestsOpenTestPrivate VbfTestsOpenTestPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_collection_object_unref0(var) ((var == NULL) ? NULL : (var = (vala_collection_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vbf_tests_open_test_unref0(var) ((var == NULL) ? NULL : (var = (vbf_tests_open_test_unref (var), NULL)))
typedef struct _VbfTestsParamSpecOpenTest VbfTestsParamSpecOpenTest;

00053 struct _VbfTestsOpenTest {
      GTypeInstance parent_instance;
      volatile int ref_count;
      VbfTestsOpenTestPrivate * priv;
};

00059 struct _VbfTestsOpenTestClass {
      GTypeClass parent_class;
      void (*finalize) (VbfTestsOpenTest *self);
};

00064 struct _VbfTestsParamSpecOpenTest {
      GParamSpec parent_instance;
};


static char** vbf_tests_open_test_projects;
static gint vbf_tests_open_test_projects_length1;
static char** vbf_tests_open_test_projects = NULL;
static gint vbf_tests_open_test_projects_length1 = 0;
static gint _vbf_tests_open_test_projects_size_ = 0;
static gboolean vbf_tests_open_test_dump_variables;
static gboolean vbf_tests_open_test_dump_variables = FALSE;
static gpointer vbf_tests_open_test_parent_class = NULL;

gpointer vbf_tests_open_test_ref (gpointer instance);
void vbf_tests_open_test_unref (gpointer instance);
GParamSpec* vbf_tests_param_spec_open_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vbf_tests_value_set_open_test (GValue* value, gpointer v_object);
void vbf_tests_value_take_open_test (GValue* value, gpointer v_object);
gpointer vbf_tests_value_get_open_test (const GValue* value);
GType vbf_tests_open_test_get_type (void) G_GNUC_CONST;
enum  {
      VBF_TESTS_OPEN_TEST_DUMMY_PROPERTY
};
gboolean vbf_tests_open_test_run (VbfTestsOpenTest* self, const char* project_name);
static void vbf_tests_open_test_dump_project (VbfTestsOpenTest* self, VbfProject* project);
static char* vbf_tests_open_test_get_target_type_description (VbfTestsOpenTest* self, VbfTargetTypes type);
static char* vbf_tests_open_test_get_source_type_description (VbfTestsOpenTest* self, VbfFileTypes type);
gint vbf_tests_open_test_main (char** args, int args_length1);
VbfTestsOpenTest* vbf_tests_open_test_new (void);
VbfTestsOpenTest* vbf_tests_open_test_construct (GType object_type);
static void vbf_tests_open_test_finalize (VbfTestsOpenTest* obj);

static const GOptionEntry VBF_TESTS_OPEN_TEST_options[3] = {{"dump-variables", 'd', 0, G_OPTION_ARG_INT, &vbf_tests_open_test_dump_variables, "Dump variables", "0 or 1"}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vbf_tests_open_test_projects, "Projects DIR", "PROJECT_DIR"}, {NULL}};


gboolean vbf_tests_open_test_run (VbfTestsOpenTest* self, const char* project_name) {
      gboolean result = FALSE;
      VbfIProjectBackend* pm;
      gboolean res;
      const char* _tmp1_;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (project_name != NULL, FALSE);
      pm = (VbfIProjectBackend*) vbf_backends_autotools_new ();
      g_print ("Probing directory '%s' ...", project_name);
      res = vbf_iproject_backend_probe (pm, project_name);
      if (!res) {
            VbfIProjectBackend* _tmp0_;
            pm = (_tmp0_ = (VbfIProjectBackend*) vbf_backends_smart_folder_new (), _g_object_unref0 (pm), _tmp0_);
            res = vbf_iproject_backend_probe (pm, project_name);
      }
      _tmp1_ = NULL;
      if (res) {
            _tmp1_ = "OK";
      } else {
            _tmp1_ = "KO";
      }
      g_print ("%s\n", _tmp1_);
      if (res) {
            VbfProject* project;
            g_print ("Opening project\n");
            project = vbf_iproject_backend_open (pm, project_name);
            if (project != NULL) {
                  g_print ("Dumping...\n");
                  vbf_tests_open_test_dump_project (self, project);
                  result = TRUE;
                  _g_object_unref0 (project);
                  _g_object_unref0 (pm);
                  return result;
            } else {
                  g_print ("Error\n");
                  result = FALSE;
                  _g_object_unref0 (project);
                  _g_object_unref0 (pm);
                  return result;
            }
            _g_object_unref0 (project);
      }
      result = FALSE;
      _g_object_unref0 (pm);
      return result;
}


static void vbf_tests_open_test_dump_project (VbfTestsOpenTest* self, VbfProject* project) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (project != NULL);
      g_print ("PROJECT:\n");
      g_print ("  name.... %s\n", project->name);
      g_print ("  version. %s\n", project->version);
      g_print ("  url..... %s\n", project->url);
      g_print ("  MODULES\n");
      {
            ValaList* _tmp0_;
            ValaIterator* _tmp1_;
            ValaIterator* _module_it;
            _module_it = (_tmp1_ = vala_iterable_iterator ((ValaIterable*) (_tmp0_ = vbf_project_get_modules (project))), _vala_collection_object_unref0 (_tmp0_), _tmp1_);
            while (TRUE) {
                  VbfModule* module;
                  if (!vala_iterator_next (_module_it)) {
                        break;
                  }
                  module = (VbfModule*) vala_iterator_get (_module_it);
                  g_print ("    MODULE\n");
                  g_print ("      name %s\n", module->name);
                  g_print ("      PACKAGES\n");
                  {
                        ValaList* _tmp2_;
                        ValaIterator* _tmp3_;
                        ValaIterator* _package_it;
                        _package_it = (_tmp3_ = vala_iterable_iterator ((ValaIterable*) (_tmp2_ = vbf_module_get_packages (module))), _vala_collection_object_unref0 (_tmp2_), _tmp3_);
                        while (TRUE) {
                              VbfPackage* package;
                              char* _tmp4_;
                              if (!vala_iterator_next (_package_it)) {
                                    break;
                              }
                              package = (VbfPackage*) vala_iterator_get (_package_it);
                              g_print ("        PACKAGE\n");
                              g_print ("          name....... %s\n", package->name);
                              g_print ("          constraint. %s\n", package->constraint);
                              g_print ("          version.... %s\n", _tmp4_ = vbf_config_node_to_string (package->version));
                              _g_free0 (_tmp4_);
                              _g_object_unref0 (package);
                        }
                        _vala_collection_object_unref0 (_package_it);
                  }
                  _g_object_unref0 (module);
            }
            _vala_collection_object_unref0 (_module_it);
      }
      g_print ("  GROUPS\n");
      {
            ValaList* _tmp5_;
            ValaIterator* _tmp6_;
            ValaIterator* _group_it;
            _group_it = (_tmp6_ = vala_iterable_iterator ((ValaIterable*) (_tmp5_ = vbf_project_get_groups (project))), _vala_collection_object_unref0 (_tmp5_), _tmp6_);
            while (TRUE) {
                  VbfGroup* group;
                  if (!vala_iterator_next (_group_it)) {
                        break;
                  }
                  group = (VbfGroup*) vala_iterator_get (_group_it);
                  g_print ("    GROUP\n");
                  g_print ("      name %s\n", group->name);
                  g_print ("      TARGETS\n");
                  {
                        ValaList* _tmp7_;
                        ValaIterator* _tmp8_;
                        ValaIterator* _target_it;
                        _target_it = (_tmp8_ = vala_iterable_iterator ((ValaIterable*) (_tmp7_ = vbf_group_get_targets (group))), _vala_collection_object_unref0 (_tmp7_), _tmp8_);
                        while (TRUE) {
                              VbfTarget* target;
                              char* _tmp9_;
                              if (!vala_iterator_next (_target_it)) {
                                    break;
                              }
                              target = (VbfTarget*) vala_iterator_get (_target_it);
                              g_print ("        TARGET\n");
                              g_print ("          name %s %s\n", _tmp9_ = vbf_tests_open_test_get_target_type_description (self, target->type), target->name);
                              _g_free0 (_tmp9_);
                              g_print ("          VAPI DIRS\n");
                              {
                                    ValaList* _tmp10_;
                                    ValaIterator* _tmp11_;
                                    ValaIterator* _path_it;
                                    _path_it = (_tmp11_ = vala_iterable_iterator ((ValaIterable*) (_tmp10_ = vbf_target_get_include_dirs (target))), _vala_collection_object_unref0 (_tmp10_), _tmp11_);
                                    while (TRUE) {
                                          char* path;
                                          if (!vala_iterator_next (_path_it)) {
                                                break;
                                          }
                                          path = (char*) vala_iterator_get (_path_it);
                                          g_print ("            directory %s\n", path);
                                          _g_free0 (path);
                                    }
                                    _vala_collection_object_unref0 (_path_it);
                              }
                              g_print ("          SOURCES\n");
                              {
                                    ValaList* _tmp12_;
                                    ValaIterator* _tmp13_;
                                    ValaIterator* _source_it;
                                    _source_it = (_tmp13_ = vala_iterable_iterator ((ValaIterable*) (_tmp12_ = vbf_target_get_sources (target))), _vala_collection_object_unref0 (_tmp12_), _tmp13_);
                                    while (TRUE) {
                                          VbfSource* source;
                                          char* _tmp14_;
                                          if (!vala_iterator_next (_source_it)) {
                                                break;
                                          }
                                          source = (VbfSource*) vala_iterator_get (_source_it);
                                          g_print ("            SOURCE %sfilename %s\n", _tmp14_ = vbf_tests_open_test_get_source_type_description (self, ((VbfFile*) source)->type), ((VbfFile*) source)->filename);
                                          _g_free0 (_tmp14_);
                                          _g_object_unref0 (source);
                                    }
                                    _vala_collection_object_unref0 (_source_it);
                              }
                              g_print ("          OTHER FILES\n");
                              {
                                    ValaList* _tmp15_;
                                    ValaIterator* _tmp16_;
                                    ValaIterator* _file_it;
                                    _file_it = (_tmp16_ = vala_iterable_iterator ((ValaIterable*) (_tmp15_ = vbf_target_get_files (target))), _vala_collection_object_unref0 (_tmp15_), _tmp16_);
                                    while (TRUE) {
                                          VbfFile* file;
                                          if (!vala_iterator_next (_file_it)) {
                                                break;
                                          }
                                          file = (VbfFile*) vala_iterator_get (_file_it);
                                          g_print ("            FILES filename %s\n", file->filename);
                                          _g_object_unref0 (file);
                                    }
                                    _vala_collection_object_unref0 (_file_it);
                              }
                              g_print ("          REFERENCED PACKAGES\n");
                              {
                                    ValaList* _tmp17_;
                                    ValaIterator* _tmp18_;
                                    ValaIterator* _package_it;
                                    _package_it = (_tmp18_ = vala_iterable_iterator ((ValaIterable*) (_tmp17_ = vbf_target_get_packages (target))), _vala_collection_object_unref0 (_tmp17_), _tmp18_);
                                    while (TRUE) {
                                          VbfPackage* package;
                                          if (!vala_iterator_next (_package_it)) {
                                                break;
                                          }
                                          package = (VbfPackage*) vala_iterator_get (_package_it);
                                          g_print ("            name....... %s\n", package->name);
                                          _g_object_unref0 (package);
                                    }
                                    _vala_collection_object_unref0 (_package_it);
                              }
                              g_print ("          BUILT LIBRARIES\n");
                              {
                                    ValaList* _tmp19_;
                                    ValaIterator* _tmp20_;
                                    ValaIterator* _package_it;
                                    _package_it = (_tmp20_ = vala_iterable_iterator ((ValaIterable*) (_tmp19_ = vbf_target_get_built_libraries (target))), _vala_collection_object_unref0 (_tmp19_), _tmp20_);
                                    while (TRUE) {
                                          char* package;
                                          if (!vala_iterator_next (_package_it)) {
                                                break;
                                          }
                                          package = (char*) vala_iterator_get (_package_it);
                                          g_print ("            name....... %s\n", package);
                                          _g_free0 (package);
                                    }
                                    _vala_collection_object_unref0 (_package_it);
                              }
                              _g_object_unref0 (target);
                        }
                        _vala_collection_object_unref0 (_target_it);
                  }
                  g_print ("      GROUP REFERENCED PACKAGES\n");
                  {
                        ValaList* _tmp21_;
                        ValaIterator* _tmp22_;
                        ValaIterator* _package_it;
                        _package_it = (_tmp22_ = vala_iterable_iterator ((ValaIterable*) (_tmp21_ = vbf_group_get_packages (group))), _vala_collection_object_unref0 (_tmp21_), _tmp22_);
                        while (TRUE) {
                              VbfPackage* package;
                              if (!vala_iterator_next (_package_it)) {
                                    break;
                              }
                              package = (VbfPackage*) vala_iterator_get (_package_it);
                              g_print ("        PACAKGE: %s", package->name);
                              g_print ("\n");
                              _g_object_unref0 (package);
                        }
                        _vala_collection_object_unref0 (_package_it);
                  }
                  if (vbf_tests_open_test_dump_variables) {
                        g_print ("      GROUP VARIABLES\n");
                        {
                              ValaList* _tmp23_;
                              ValaIterator* _tmp24_;
                              ValaIterator* _variable_it;
                              _variable_it = (_tmp24_ = vala_iterable_iterator ((ValaIterable*) (_tmp23_ = vbf_group_get_variables (group))), _vala_collection_object_unref0 (_tmp23_), _tmp24_);
                              while (TRUE) {
                                    VbfVariable* variable;
                                    char* _tmp25_;
                                    if (!vala_iterator_next (_variable_it)) {
                                          break;
                                    }
                                    variable = (VbfVariable*) vala_iterator_get (_variable_it);
                                    g_print ("        VARIABLE: %s", _tmp25_ = vbf_config_node_to_string ((VbfConfigNode*) variable));
                                    _g_free0 (_tmp25_);
                                    g_print ("\n");
                                    _g_object_unref0 (variable);
                              }
                              _vala_collection_object_unref0 (_variable_it);
                        }
                  }
                  _g_object_unref0 (group);
            }
            _vala_collection_object_unref0 (_group_it);
      }
      if (vbf_tests_open_test_dump_variables) {
            g_print ("  GLOBAL VARIABLES\n");
            {
                  ValaList* _tmp26_;
                  ValaIterator* _tmp27_;
                  ValaIterator* _variable_it;
                  _variable_it = (_tmp27_ = vala_iterable_iterator ((ValaIterable*) (_tmp26_ = vbf_project_get_variables (project))), _vala_collection_object_unref0 (_tmp26_), _tmp27_);
                  while (TRUE) {
                        VbfVariable* variable;
                        char* _tmp28_;
                        if (!vala_iterator_next (_variable_it)) {
                              break;
                        }
                        variable = (VbfVariable*) vala_iterator_get (_variable_it);
                        g_print ("    VARIABLE: %s", _tmp28_ = vbf_config_node_to_string ((VbfConfigNode*) variable));
                        _g_free0 (_tmp28_);
                        g_print ("\n");
                        _g_object_unref0 (variable);
                  }
                  _vala_collection_object_unref0 (_variable_it);
            }
      }
}


static char* vbf_tests_open_test_get_source_type_description (VbfTestsOpenTest* self, VbfFileTypes type) {
      char* result = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      switch (type) {
            case VBF_FILE_TYPES_DATA:
            {
                  result = g_strdup ("(DATA)    ");
                  return result;
            }
            case VBF_FILE_TYPES_OTHER_SOURCE:
            {
                  result = g_strdup ("(OTHER)   ");
                  return result;
            }
            case VBF_FILE_TYPES_UNKNOWN:
            {
                  result = g_strdup ("(UNKNOWN) ");
                  return result;
            }
            case VBF_FILE_TYPES_VALA_SOURCE:
            {
                  result = g_strdup ("(VALA)    ");
                  return result;
            }
            default:
            {
                  result = g_strdup_printf ("(N/A: %d)", (gint) type);
                  return result;
            }
      }
}


static char* vbf_tests_open_test_get_target_type_description (VbfTestsOpenTest* self, VbfTargetTypes type) {
      char* result = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      switch (type) {
            case VBF_TARGET_TYPES_PROGRAM:
            {
                  result = g_strdup ("(PROGRAM)       ");
                  return result;
            }
            case VBF_TARGET_TYPES_LIBRARY:
            {
                  result = g_strdup ("(LIBRARY)       ");
                  return result;
            }
            case VBF_TARGET_TYPES_DATA:
            {
                  result = g_strdup ("(DATA)          ");
                  return result;
            }
            case VBF_TARGET_TYPES_BUILT_SOURCES:
            {
                  result = g_strdup ("(BUILT_SOURCES) ");
                  return result;
            }
            default:
            {
                  result = g_strdup_printf ("(N/A: %d)       ", (gint) type);
                  return result;
            }
      }
}


gint vbf_tests_open_test_main (char** args, int args_length1) {
      gint result = 0;
      VbfTestsOpenTest* test;
      gint _tmp0_ = 0;
      GError * _inner_error_ = NULL;
      {
            GOptionContext* opt_context;
            opt_context = g_option_context_new ("- Vala Build Framework Utility");
            g_option_context_set_help_enabled (opt_context, TRUE);
            g_option_context_add_main_entries (opt_context, VBF_TESTS_OPEN_TEST_options, NULL);
            g_option_context_parse (opt_context, &args_length1, &args, &_inner_error_);
            if (_inner_error_ != NULL) {
                  _g_option_context_free0 (opt_context);
                  if (_inner_error_->domain == G_OPTION_ERROR) {
                        goto __catch0_g_option_error;
                  }
                  _g_option_context_free0 (opt_context);
                  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 0;
            }
            _g_option_context_free0 (opt_context);
      }
      goto __finally0;
      __catch0_g_option_error:
      {
            GError * e;
            e = _inner_error_;
            _inner_error_ = NULL;
            {
                  fprintf (stdout, "%s\n", e->message);
                  fprintf (stdout, _ ("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
                  result = 1;
                  _g_error_free0 (e);
                  return result;
            }
      }
      __finally0:
      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 0;
      }
      test = vbf_tests_open_test_new ();
      if (vbf_tests_open_test_run (test, vbf_tests_open_test_projects[0])) {
            _tmp0_ = 0;
      } else {
            _tmp0_ = 1;
      }
      result = _tmp0_;
      _vbf_tests_open_test_unref0 (test);
      return result;
}


int main (int argc, char ** argv) {
      g_type_init ();
      return vbf_tests_open_test_main (argv, argc);
}


VbfTestsOpenTest* vbf_tests_open_test_construct (GType object_type) {
      VbfTestsOpenTest* self;
      self = (VbfTestsOpenTest*) g_type_create_instance (object_type);
      return self;
}


VbfTestsOpenTest* vbf_tests_open_test_new (void) {
      return vbf_tests_open_test_construct (VBF_TESTS_TYPE_OPEN_TEST);
}


static void vbf_tests_value_open_test_init (GValue* value) {
      value->data[0].v_pointer = NULL;
}


static void vbf_tests_value_open_test_free_value (GValue* value) {
      if (value->data[0].v_pointer) {
            vbf_tests_open_test_unref (value->data[0].v_pointer);
      }
}


static void vbf_tests_value_open_test_copy_value (const GValue* src_value, GValue* dest_value) {
      if (src_value->data[0].v_pointer) {
            dest_value->data[0].v_pointer = vbf_tests_open_test_ref (src_value->data[0].v_pointer);
      } else {
            dest_value->data[0].v_pointer = NULL;
      }
}


static gpointer vbf_tests_value_open_test_peek_pointer (const GValue* value) {
      return value->data[0].v_pointer;
}


static gchar* vbf_tests_value_open_test_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      if (collect_values[0].v_pointer) {
            VbfTestsOpenTest* object;
            object = collect_values[0].v_pointer;
            if (object->parent_instance.g_class == NULL) {
                  return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
                  return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            }
            value->data[0].v_pointer = vbf_tests_open_test_ref (object);
      } else {
            value->data[0].v_pointer = NULL;
      }
      return NULL;
}


static gchar* vbf_tests_value_open_test_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      VbfTestsOpenTest** object_p;
      object_p = collect_values[0].v_pointer;
      if (!object_p) {
            return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
      }
      if (!value->data[0].v_pointer) {
            *object_p = NULL;
      } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
            *object_p = value->data[0].v_pointer;
      } else {
            *object_p = vbf_tests_open_test_ref (value->data[0].v_pointer);
      }
      return NULL;
}


GParamSpec* vbf_tests_param_spec_open_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
      VbfTestsParamSpecOpenTest* spec;
      g_return_val_if_fail (g_type_is_a (object_type, VBF_TESTS_TYPE_OPEN_TEST), NULL);
      spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
      G_PARAM_SPEC (spec)->value_type = object_type;
      return G_PARAM_SPEC (spec);
}


gpointer vbf_tests_value_get_open_test (const GValue* value) {
      g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST), NULL);
      return value->data[0].v_pointer;
}


void vbf_tests_value_set_open_test (GValue* value, gpointer v_object) {
      VbfTestsOpenTest* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VBF_TESTS_TYPE_OPEN_TEST));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
            vbf_tests_open_test_ref (value->data[0].v_pointer);
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            vbf_tests_open_test_unref (old);
      }
}


void vbf_tests_value_take_open_test (GValue* value, gpointer v_object) {
      VbfTestsOpenTest* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VBF_TESTS_TYPE_OPEN_TEST));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            vbf_tests_open_test_unref (old);
      }
}


static void vbf_tests_open_test_class_init (VbfTestsOpenTestClass * klass) {
      vbf_tests_open_test_parent_class = g_type_class_peek_parent (klass);
      VBF_TESTS_OPEN_TEST_CLASS (klass)->finalize = vbf_tests_open_test_finalize;
}


static void vbf_tests_open_test_instance_init (VbfTestsOpenTest * self) {
      self->ref_count = 1;
}


static void vbf_tests_open_test_finalize (VbfTestsOpenTest* obj) {
      VbfTestsOpenTest * self;
      self = VBF_TESTS_OPEN_TEST (obj);
}


GType vbf_tests_open_test_get_type (void) {
      static volatile gsize vbf_tests_open_test_type_id__volatile = 0;
      if (g_once_init_enter (&vbf_tests_open_test_type_id__volatile)) {
            static const GTypeValueTable g_define_type_value_table = { vbf_tests_value_open_test_init, vbf_tests_value_open_test_free_value, vbf_tests_value_open_test_copy_value, vbf_tests_value_open_test_peek_pointer, "p", vbf_tests_value_open_test_collect_value, "p", vbf_tests_value_open_test_lcopy_value };
            static const GTypeInfo g_define_type_info = { sizeof (VbfTestsOpenTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vbf_tests_open_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VbfTestsOpenTest), 0, (GInstanceInitFunc) vbf_tests_open_test_instance_init, &g_define_type_value_table };
            static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
            GType vbf_tests_open_test_type_id;
            vbf_tests_open_test_type_id = g_type_register_fundamental (g_type_fundamental_next (), "VbfTestsOpenTest", &g_define_type_info, &g_define_type_fundamental_info, 0);
            g_once_init_leave (&vbf_tests_open_test_type_id__volatile, vbf_tests_open_test_type_id);
      }
      return vbf_tests_open_test_type_id__volatile;
}


gpointer vbf_tests_open_test_ref (gpointer instance) {
      VbfTestsOpenTest* self;
      self = instance;
      g_atomic_int_inc (&self->ref_count);
      return instance;
}


void vbf_tests_open_test_unref (gpointer instance) {
      VbfTestsOpenTest* self;
      self = instance;
      if (g_atomic_int_dec_and_test (&self->ref_count)) {
            VBF_TESTS_OPEN_TEST_GET_CLASS (self)->finalize (self);
            g_type_free_instance ((GTypeInstance *) self);
      }
}





Generated by  Doxygen 1.6.0   Back to index