X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fattribute.c;h=a862cdf78ec094a9fe015b539d41c0221fdae09c;hb=5e2c04a21b4282bbd5318d53956d556c0946d8dd;hp=a3f8ab9aecbdde8cd477428724cd971490d7719f;hpb=d8f124de0295aea546b6debf5945bfeea2bbeb2a;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/attribute.c b/ltt/branches/poly/lttv/lttv/attribute.c index a3f8ab9a..a862cdf7 100644 --- a/ltt/branches/poly/lttv/lttv/attribute.c +++ b/ltt/branches/poly/lttv/lttv/attribute.c @@ -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, "name); + fprintf(fp, "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,""); } +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; }