summaryrefslogtreecommitdiff
path: root/gck/gck-attributes.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2010-09-18 17:13:02 +0000
committerStef Walter <stef@memberwebs.com>2010-09-18 17:24:05 +0000
commitbf3a54ae2ff4d62cbed08e2d0e1b83143b6d476e (patch)
tree1da70e9985051dc06860fff22550e2be09c0d17a /gck/gck-attributes.c
parentcf62709ec638cfc144e3832f080defa39d99fc06 (diff)
downloadgcr-bf3a54ae2ff4d62cbed08e2d0e1b83143b6d476e.tar.gz
[gck] Add gck_attributes_add_all() for copying GckAttributes
New function allows deep copying of a GckAttributes array.
Diffstat (limited to 'gck/gck-attributes.c')
-rw-r--r--gck/gck-attributes.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index eb5b3aa..0c33fc1 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -1003,6 +1003,22 @@ gck_attributes_add_ulong (GckAttributes *attrs, gulong attr_type, gulong value)
return added;
}
+void
+gck_attributes_add_all (GckAttributes *attrs, GckAttributes *from)
+{
+ GckAttribute *attr;
+ guint i;
+
+ g_return_if_fail (attrs && attrs->array);
+ g_return_if_fail (from && from->array);
+ g_return_if_fail (!attrs->locked);
+
+ for (i = 0; i < from->array->len; ++i) {
+ attr = &g_array_index (from->array, GckAttribute, i);
+ gck_attributes_add (attrs, attr);
+ }
+}
+
/**
* gck_attributes_count:
* @attrs: The attributes array to count.