* MA 02111-1307, USA.
*/
-/* FIXME : unnamed attributed not implemented */
+/* FIXME : unnamed attributes not implemented */
#ifndef IATTRIBUTE_H
#define IATTRIBUTE_H
and access functions over a wide range of structures. The names are
represented by unique integer identifiers, GQuarks. */
+/* Please note that adding a value of type gobject that is non null does not
+ * increment the reference count of this object : the actual reference to
+ * the object is "given" to the attribute tree. When the gobject value
+ * is removed, the object is unreferenced. A value copy through
+ * lttv_iattribute_copy_value does increase the reference count of the
+ * gobject. */
+
typedef GQuark LttvAttributeName;
typedef enum _LttvAttributeType {
gboolean (*named) (LttvIAttribute *self, gboolean *homogeneous);
LttvAttributeType (*get) (LttvIAttribute *self, unsigned i,
- LttvAttributeName *name, LttvAttributeValue *v);
+ LttvAttributeName *name, LttvAttributeValue *v, gboolean *is_named);
LttvAttributeType (*get_by_name) (LttvIAttribute *self,
LttvAttributeName name, LttvAttributeValue *v);
LttvAttributeValue (*add) (LttvIAttribute *self, LttvAttributeName name,
LttvAttributeType t);
+ LttvAttributeValue (*add_unnamed) (LttvIAttribute *self,
+ LttvAttributeName name,
+ LttvAttributeType t);
+
void (*remove) (LttvIAttribute *self, unsigned i);
void (*remove_by_name) (LttvIAttribute *self,
LttvIAttribute* (*find_subdir) (LttvIAttribute *self,
LttvAttributeName name);
+
+ LttvIAttribute* (*find_subdir_unnamed) (LttvIAttribute *self,
+ LttvAttributeName name);
+
};
/* Get the i th attribute along with its type and a pointer to its value. */
LttvAttributeType lttv_iattribute_get(LttvIAttribute *self, unsigned i,
- LttvAttributeName *name, LttvAttributeValue *v);
+ LttvAttributeName *name, LttvAttributeValue *v, gboolean *is_named);
/* Get the named attribute in the table along with its type and a pointer to
LttvAttributeValue lttv_iattribute_add(LttvIAttribute *self,
LttvAttributeName name, LttvAttributeType t);
-
+LttvAttributeValue lttv_iattribute_add_unnamed(LttvIAttribute *self,
+ LttvAttributeName name, LttvAttributeType t);
/* Remove an attribute */
void lttv_iattribute_remove(LttvIAttribute *self, unsigned i);
LttvIAttribute* lttv_iattribute_find_subdir(LttvIAttribute *self,
LttvAttributeName name);
+LttvIAttribute* lttv_iattribute_find_subdir_unnamed(LttvIAttribute *self,
+ LttvAttributeName name);
/* The remaining utility functions are not part of the LttvIAttribute
interface but operate on objects implementing it. */