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

vbfstringliteral.c

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

/*
 *  vbfstringliteral.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>


#define VBF_TYPE_CONFIG_NODE (vbf_config_node_get_type ())
#define VBF_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNode))
#define VBF_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))
#define VBF_IS_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_CONFIG_NODE))
#define VBF_IS_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_CONFIG_NODE))
#define VBF_CONFIG_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))

typedef struct _VbfConfigNode VbfConfigNode;
typedef struct _VbfConfigNodeClass VbfConfigNodeClass;
typedef struct _VbfConfigNodePrivate VbfConfigNodePrivate;

#define VBF_TYPE_STRING_LITERAL (vbf_string_literal_get_type ())
#define VBF_STRING_LITERAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_STRING_LITERAL, VbfStringLiteral))
#define VBF_STRING_LITERAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_STRING_LITERAL, VbfStringLiteralClass))
#define VBF_IS_STRING_LITERAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_STRING_LITERAL))
#define VBF_IS_STRING_LITERAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_STRING_LITERAL))
#define VBF_STRING_LITERAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_STRING_LITERAL, VbfStringLiteralClass))

typedef struct _VbfStringLiteral VbfStringLiteral;
typedef struct _VbfStringLiteralClass VbfStringLiteralClass;
typedef struct _VbfStringLiteralPrivate VbfStringLiteralPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _VbfConfigNode {
      GObject parent_instance;
      VbfConfigNodePrivate * priv;
      VbfConfigNode* parent;
};

struct _VbfConfigNodeClass {
      GObjectClass parent_class;
      char* (*to_string) (VbfConfigNode* self);
};

struct _VbfStringLiteral {
      VbfConfigNode parent_instance;
      VbfStringLiteralPrivate * priv;
      char* data;
};

struct _VbfStringLiteralClass {
      VbfConfigNodeClass parent_class;
};


static gpointer vbf_string_literal_parent_class = NULL;

GType vbf_config_node_get_type (void) G_GNUC_CONST;
GType vbf_string_literal_get_type (void) G_GNUC_CONST;
enum  {
      VBF_STRING_LITERAL_DUMMY_PROPERTY
};
VbfStringLiteral* vbf_string_literal_new (const char* data);
VbfStringLiteral* vbf_string_literal_construct (GType object_type, const char* data);
VbfConfigNode* vbf_config_node_construct (GType object_type);
static char* vbf_string_literal_real_to_string (VbfConfigNode* base);
static void vbf_string_literal_finalize (GObject* obj);
static int _vala_strcmp0 (const char * str1, const char * str2);



VbfStringLiteral* vbf_string_literal_construct (GType object_type, const char* data) {
      VbfStringLiteral * self;
      char* _tmp0_;
      g_return_val_if_fail (data != NULL, NULL);
      self = (VbfStringLiteral*) vbf_config_node_construct (object_type);
      self->data = (_tmp0_ = g_strdup (data), _g_free0 (self->data), _tmp0_);
      return self;
}


VbfStringLiteral* vbf_string_literal_new (const char* data) {
      return vbf_string_literal_construct (VBF_TYPE_STRING_LITERAL, data);
}


static char* vbf_string_literal_real_to_string (VbfConfigNode* base) {
      VbfStringLiteral * self;
      char* result = NULL;
      self = (VbfStringLiteral*) base;
      if (self->data == NULL) {
            result = g_strdup ("(null)");
            return result;
      } else {
            if (_vala_strcmp0 (self->data, "") == 0) {
                  result = g_strdup ("(empty)");
                  return result;
            } else {
                  result = g_strdup (self->data);
                  return result;
            }
      }
}


static void vbf_string_literal_class_init (VbfStringLiteralClass * klass) {
      vbf_string_literal_parent_class = g_type_class_peek_parent (klass);
      VBF_CONFIG_NODE_CLASS (klass)->to_string = vbf_string_literal_real_to_string;
      G_OBJECT_CLASS (klass)->finalize = vbf_string_literal_finalize;
}


static void vbf_string_literal_instance_init (VbfStringLiteral * self) {
}


static void vbf_string_literal_finalize (GObject* obj) {
      VbfStringLiteral * self;
      self = VBF_STRING_LITERAL (obj);
      _g_free0 (self->data);
      G_OBJECT_CLASS (vbf_string_literal_parent_class)->finalize (obj);
}


GType vbf_string_literal_get_type (void) {
      static volatile gsize vbf_string_literal_type_id__volatile = 0;
      if (g_once_init_enter (&vbf_string_literal_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (VbfStringLiteralClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vbf_string_literal_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VbfStringLiteral), 0, (GInstanceInitFunc) vbf_string_literal_instance_init, NULL };
            GType vbf_string_literal_type_id;
            vbf_string_literal_type_id = g_type_register_static (VBF_TYPE_CONFIG_NODE, "VbfStringLiteral", &g_define_type_info, 0);
            g_once_init_leave (&vbf_string_literal_type_id__volatile, vbf_string_literal_type_id);
      }
      return vbf_string_literal_type_id__volatile;
}


static int _vala_strcmp0 (const char * str1, const char * str2) {
      if (str1 == NULL) {
            return -(str1 != str2);
      }
      if (str2 == NULL) {
            return str1 != str2;
      }
      return strcmp (str1, str2);
}





Generated by  Doxygen 1.6.0   Back to index