aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_meta_data.c
diff options
context:
space:
mode:
authorWillow Liquorice <willow@howhill.com>2022-08-27 20:07:26 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-08-30 09:42:09 +0200
commit8c6a68c258061f68466905393b76106436d3dccf (patch)
tree7ecd4b101fd76859c630a93e54ce6e8e7aecbbb1 /src/util/container_meta_data.c
parent08a0ef9dff9d401bfaae332a076716c49f85d7ca (diff)
downloadgnunet-8c6a68c258061f68466905393b76106436d3dccf.tar.gz
gnunet-8c6a68c258061f68466905393b76106436d3dccf.zip
-DOC first pass through UTIL container library
Diffstat (limited to 'src/util/container_meta_data.c')
-rw-r--r--src/util/container_meta_data.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index 2c477db40..52882c5f3 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -241,11 +241,6 @@ invalidate_sbuf (struct GNUNET_CONTAINER_MetaData *md)
241} 241}
242 242
243 243
244/**
245 * Free meta data.
246 *
247 * @param md what to free
248 */
249void 244void
250GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md) 245GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md)
251{ 246{
@@ -263,11 +258,6 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md)
263} 258}
264 259
265 260
266/**
267 * Remove all items in the container.
268 *
269 * @param md metadata to manipulate
270 */
271void 261void
272GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md) 262GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md)
273{ 263{
@@ -285,16 +275,6 @@ GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md)
285} 275}
286 276
287 277
288/**
289 * Test if two MDs are equal. We consider them equal if
290 * the meta types, formats and content match (we do not
291 * include the mime types and plugins names in this
292 * consideration).
293 *
294 * @param md1 first value to check
295 * @param md2 other value to check
296 * @return #GNUNET_YES if they are equal
297 */
298int 278int
299GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData 279GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData
300 *md1, 280 *md1,
@@ -451,13 +431,6 @@ merge_helper (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
451} 431}
452 432
453 433
454/**
455 * Extend metadata. Merges the meta data from the second argument
456 * into the first, discarding duplicate key-value pairs.
457 *
458 * @param md metadata to extend
459 * @param in metadata to merge
460 */
461void 434void
462GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, 435GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
463 const struct GNUNET_CONTAINER_MetaData *in) 436 const struct GNUNET_CONTAINER_MetaData *in)
@@ -466,16 +439,6 @@ GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
466} 439}
467 440
468 441
469/**
470 * Remove an item.
471 *
472 * @param md metadata to manipulate
473 * @param type type of the item to remove
474 * @param data specific value to remove, NULL to remove all
475 * entries of the given type
476 * @param data_size number of bytes in @a data
477 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the item does not exist in md
478 */
479int 442int
480GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, 443GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
481 enum EXTRACTOR_MetaType type, 444 enum EXTRACTOR_MetaType type,
@@ -503,12 +466,6 @@ GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
503} 466}
504 467
505 468
506/**
507 * Add the current time as the publication date
508 * to the meta-data.
509 *
510 * @param md metadata to modify
511 */
512void 469void
513GNUNET_CONTAINER_meta_data_add_publication_date (struct 470GNUNET_CONTAINER_meta_data_add_publication_date (struct
514 GNUNET_CONTAINER_MetaData *md) 471 GNUNET_CONTAINER_MetaData *md)
@@ -556,16 +513,6 @@ GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md,
556} 513}
557 514
558 515
559/**
560 * Get the first MD entry of the given type. Caller
561 * is responsible for freeing the return value.
562 * Also, only meta data items that are strings (0-terminated)
563 * are returned by this function.
564 *
565 * @param md metadata to inspect
566 * @param type type to look for
567 * @return NULL if no entry was found
568 */
569char * 516char *
570GNUNET_CONTAINER_meta_data_get_by_type (const struct 517GNUNET_CONTAINER_meta_data_get_by_type (const struct
571 GNUNET_CONTAINER_MetaData *md, 518 GNUNET_CONTAINER_MetaData *md,
@@ -584,17 +531,6 @@ GNUNET_CONTAINER_meta_data_get_by_type (const struct
584} 531}
585 532
586 533
587/**
588 * Get the first matching MD entry of the given types. Caller is
589 * responsible for freeing the return value. Also, only meta data
590 * items that are strings (0-terminated) are returned by this
591 * function.
592 *
593 * @param md metadata to inspect
594 * @param ... -1-terminated list of types
595 * @return NULL if we do not have any such entry,
596 * otherwise client is responsible for freeing the value!
597 */
598char * 534char *
599GNUNET_CONTAINER_meta_data_get_first_by_types (const struct 535GNUNET_CONTAINER_meta_data_get_first_by_types (const struct
600 GNUNET_CONTAINER_MetaData *md, 536 GNUNET_CONTAINER_MetaData *md,
@@ -997,12 +933,6 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
997} 933}
998 934
999 935
1000/**
1001 * Get the size of the full meta-data in serialized form.
1002 *
1003 * @param md metadata to inspect
1004 * @return number of bytes needed for serialization, -1 on error
1005 */
1006ssize_t 936ssize_t
1007GNUNET_CONTAINER_meta_data_get_serialized_size (const struct 937GNUNET_CONTAINER_meta_data_get_serialized_size (const struct
1008 GNUNET_CONTAINER_MetaData *md) 938 GNUNET_CONTAINER_MetaData *md)