some fixes for global traces
[lttv.git] / ltt / branches / poly / lttv / lttv / attribute.c
index a3f8ab9aecbdde8cd477428724cd971490d7719f..a862cdf78ec094a9fe015b539d41c0221fdae09c 100644 (file)
@@ -199,7 +199,7 @@ lttv_attribute_find_subdir(LttvAttribute *self, LttvAttributeName name)
   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);
@@ -329,7 +329,7 @@ lttv_attribute_write_xml(LttvAttribute *self, FILE *fp, int pos, int indent)
   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,
@@ -467,12 +467,21 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE *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;
 
@@ -497,6 +506,7 @@ attribute_interface_init (gpointer g_iface, gpointer iface_data)
 
   klass->find_subdir = (LttvIAttribute* (*) (LttvIAttribute *self, 
       LttvAttributeName name)) lttv_attribute_find_subdir;
+
 }
 
 
@@ -524,7 +534,7 @@ static void
 attribute_class_init (LttvAttributeClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
+  
   gobject_class->finalize = (void (*)(GObject *self))attribute_finalize;
 }
 
This page took 0.022903 seconds and 4 git commands to generate.