X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fattribute.h;h=ef2ccfdd0792b47068288d0c87ccd02f4764d206;hb=b9ce0bad7daf7c0a2333c91fdb1e35d602afe17f;hp=498d567c8db6e2d1990820cb08e055d25855692a;hpb=f61f4dca50e13aa52b1ca3941c8f420848f4353f;p=lttv.git diff --git a/lttv/lttv/attribute.h b/lttv/lttv/attribute.h index 498d567c..ef2ccfdd 100644 --- a/lttv/lttv/attribute.h +++ b/lttv/lttv/attribute.h @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. */ #ifndef ATTRIBUTE_H @@ -37,19 +37,20 @@ typedef struct _LttvAttribute LttvAttribute; typedef struct _LttvAttributeClass LttvAttributeClass; struct _LttvAttribute { - GObject parent; + GObject parent; - /* private members */ - GHashTable *names; - GArray *attributes; + /* private members */ + GHashTable *names; + GArray *attributes; }; struct _LttvAttributeClass { - GObjectClass parent; + GObjectClass parent; }; -GType lttv_attribute_get_type (void); +GType +lttv_attribute_get_type (void); /* The functions exported in the IAttribute interface are also available @@ -58,43 +59,50 @@ GType lttv_attribute_get_type (void); /* Total number of attributes */ -unsigned int lttv_attribute_get_number(LttvAttribute *self); +unsigned int +lttv_attribute_get_number(LttvAttribute *self); /* Container type. Named (fields in struct or elements in a hash table) or unnamed (elements in an array) attributes, homogeneous type or not. */ -gboolean lttv_attribute_named(LttvAttribute *self, gboolean *homogeneous); +gboolean +lttv_attribute_named(LttvAttribute *self, gboolean *homogeneous); /* Get the i th attribute along with its type and a pointer to its value. */ -LttvAttributeType lttv_attribute_get(LttvAttribute *self, unsigned i, - LttvAttributeName *name, LttvAttributeValue *v, gboolean *is_named); +LttvAttributeType +lttv_attribute_get(LttvAttribute *self, unsigned i, LttvAttributeName *name, + LttvAttributeValue *v, gboolean *is_named); /* Get the named attribute in the table along with its type and a pointer to its value. If the named attribute does not exist, the type is LTTV_NONE. */ -LttvAttributeType lttv_attribute_get_by_name(LttvAttribute *self, - LttvAttributeName name, LttvAttributeValue *v); +LttvAttributeType +lttv_attribute_get_by_name(LttvAttribute *self, LttvAttributeName name, + LttvAttributeValue *v); /* Add an attribute, which must not exist. The name is an empty string for containers with unnamed attributes. */ -LttvAttributeValue lttv_attribute_add(LttvAttribute *self, - LttvAttributeName name, LttvAttributeType t); +LttvAttributeValue +lttv_attribute_add(LttvAttribute *self, LttvAttributeName name, + LttvAttributeType t); -LttvAttributeValue lttv_attribute_add_unnamed(LttvAttribute *self, - LttvAttributeName name, LttvAttributeType t); +LttvAttributeValue +lttv_attribute_add_unnamed(LttvAttribute *self, LttvAttributeName name, + LttvAttributeType t); /* Remove an attribute */ -void lttv_attribute_remove(LttvAttribute *self, unsigned i); +void +lttv_attribute_remove(LttvAttribute *self, unsigned i); -void lttv_attribute_remove_by_name(LttvAttribute *self, - LttvAttributeName name); +void +lttv_attribute_remove_by_name(LttvAttribute *self, LttvAttributeName name); /* Create an empty iattribute object and add it as an attribute under the @@ -102,15 +110,16 @@ void lttv_attribute_remove_by_name(LttvAttribute *self, attribute of that name already exists but is not a GObject supporting the iattribute interface, return NULL. */ -LttvAttribute* lttv_attribute_find_subdir(LttvAttribute *self, - LttvAttributeName name); +LttvAttribute* +lttv_attribute_find_subdir(LttvAttribute *self, LttvAttributeName name); -LttvAttribute* lttv_attribute_find_subdir_unnamed(LttvAttribute *self, - LttvAttributeName name); +LttvAttribute* +lttv_attribute_find_subdir_unnamed(LttvAttribute *self, LttvAttributeName name); -gboolean lttv_attribute_find(LttvAttribute *self, LttvAttributeName name, - LttvAttributeType t, LttvAttributeValue *v); +gboolean +lttv_attribute_find(LttvAttribute *self, LttvAttributeName name, + LttvAttributeType t, LttvAttributeValue *v); /* Free recursively a tree of attributes. All contained gobject of type @@ -121,11 +130,13 @@ gboolean lttv_attribute_find(LttvAttribute *self, LttvAttributeName name, /* Add items from a tree of attributes to another tree. */ -void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src); +void +lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src); void lttv_attribute_write_xml(LttvAttribute *self, FILE *fp, int pos, int indent); -void lttv_attribute_read_xml(LttvAttribute *self, FILE *fp); +void +lttv_attribute_read_xml(LttvAttribute *self, FILE *fp); #endif // ATTRIBUTE_H