From 13a8e0fb8db860d11ae46d366924b0bfc82be21a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 1 Mar 2012 10:44:49 +0000 Subject: [PATCH] - comments --- src/include/gnunet_namestore_service.h | 24 ++++++++++++++++++++---- src/namestore/namestore_common.c | 24 ++++++++++++++++++++---- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 5616225df..9b0171970 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h @@ -363,6 +363,12 @@ GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); /** * Calculate how many bytes we will need to serialize the given * records. + * + * @param rd_count number of records in the rd array + * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements + * + * @return the required size to serialize + * */ size_t GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, @@ -370,6 +376,13 @@ GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, /** * Serialize the given records to the given destination buffer. + * + * @param rd_cound number of records in the rd array + * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements + * @param dest_size size of the destination array + * @param dest where to write the result + * + * @return the size of serialized records */ ssize_t GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, @@ -379,10 +392,13 @@ GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, /** - * @param rd_count expected number of records in 'src' - * @param dest array of 'rd_count' entries for storing record data; - * 'data' values in 'dest' will point into 'src' and will thus - * become invalid if 'src' is modified + * Deserialize the given records to the given destination. + * + * @param len size of the serialized record data + * @param src the serialized record data + * @param rd_cound number of records in the rd array + * @param dest where to put the data + * * @return GNUNET_OK on success, GNUNET_SYSERR on error */ int diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 8827183d4..355bdb52a 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c @@ -67,6 +67,12 @@ struct NetworkRecord /** * Calculate how many bytes we will need to serialize the given * records. + * + * @param rd_count number of records in the rd array + * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements + * + * @return the required size to serialize + * */ size_t GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, @@ -87,6 +93,13 @@ GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, /** * Serialize the given records to the given destination buffer. + * + * @param rd_cound number of records in the rd array + * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements + * @param dest_size size of the destination array + * @param dest where to write the result + * + * @return the size of serialized records */ ssize_t GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, @@ -119,10 +132,13 @@ GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, /** - * @param rd_count expected number of records in 'src' - * @param dest array of 'rd_count' entries for storing record data; - * 'data' values in 'dest' will point into 'src' and will thus - * become invalid if 'src' is modified + * Deserialize the given records to the given destination. + * + * @param len size of the serialized record data + * @param src the serialized record data + * @param rd_cound number of records in the rd array + * @param dest where to put the data + * * @return GNUNET_OK on success, GNUNET_SYSERR on error */ int -- 2.25.1