Attribute a;
LttvAttribute *new;
-
+
i = (unsigned)g_hash_table_lookup(self->names, GUINT_TO_POINTER(name));
if(i != 0) {
a = g_array_index(self->attributes, Attribute, i - 1);
for(i = 0 ; i < nb ; i++) {
a = &g_array_index(self->attributes, Attribute, i);
print_indent(fp, pos);
- fprintf(fp, "<ATTR NAME=\"%s\" ", a->name);
+ fprintf(fp, "<ATTR NAME=\"%s\" ", g_quark_to_string(a->name));
if(a->type == LTTV_GOBJECT && LTTV_IS_ATTRIBUTE(a->value.dv_gobject)) {
fprintf(fp, "TYPE=ATTRS>");
lttv_attribute_write_xml((LttvAttribute *)(a->value.dv_gobject), fp,
fscanf(fp,"</ATTRS>");
}
+static LttvAttribute *
+new_attribute (LttvAttribute *self)
+{
+ return g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+}
+
static void
attribute_interface_init (gpointer g_iface, gpointer iface_data)
{
LttvIAttributeClass *klass = (LttvIAttributeClass *)g_iface;
+ klass->new_attribute = (LttvIAttribute* (*) (LttvIAttribute *self))
+ new_attribute;
+
klass->get_number = (unsigned int (*) (LttvIAttribute *self))
lttv_attribute_get_number;
klass->find_subdir = (LttvIAttribute* (*) (LttvIAttribute *self,
LttvAttributeName name)) lttv_attribute_find_subdir;
+
}
attribute_class_init (LttvAttributeClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
+
gobject_class->finalize = (void (*)(GObject *self))attribute_finalize;
}