aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_meta_data.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-16 20:10:55 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-16 20:10:55 +0000
commit0296fe30f002512dbde10f73ce7c57bf0085db7d (patch)
treeb2bdb1e3bc1624982393e0c2d31bcfef62e2320a /src/util/container_meta_data.c
parent4157c8256423c4cde80dcb3fbec992f683b8edf8 (diff)
downloadgnunet-0296fe30f002512dbde10f73ce7c57bf0085db7d.tar.gz
gnunet-0296fe30f002512dbde10f73ce7c57bf0085db7d.zip
need clear api
Diffstat (limited to 'src/util/container_meta_data.c')
-rw-r--r--src/util/container_meta_data.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index f39b15930..dd7165ba9 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -170,6 +170,29 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md)
170 170
171 171
172/** 172/**
173 * Remove all items in the container.
174 *
175 * @param md metadata to manipulate
176 */
177void
178GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md)
179{
180 struct MetaItem *item;
181
182 if (md == NULL)
183 return;
184 while (NULL != (item = md->items))
185 {
186 md->items = item->next;
187 meta_item_free (item);
188 }
189 GNUNET_free_non_null (md->sbuf);
190 memset (md, 0, sizeof (struct GNUNET_CONTAINER_MetaData));
191}
192
193
194
195/**
173 * Test if two MDs are equal. We consider them equal if 196 * Test if two MDs are equal. We consider them equal if
174 * the meta types, formats and content match (we do not 197 * the meta types, formats and content match (we do not
175 * include the mime types and plugins names in this 198 * include the mime types and plugins names in this