aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-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