diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-01 10:08:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-01 10:08:51 +0000 |
commit | 5d0de68e3f7785eba7693f5d4dd3c83a7a94a684 (patch) | |
tree | 0517aacf476aa70c5135decd7be2c97bd00de9e7 /src/include/gnunet_namestore_service.h | |
parent | ca95b135b939f6585a0093cc5b7329fa4303ecce (diff) | |
download | gnunet-5d0de68e3f7785eba7693f5d4dd3c83a7a94a684.tar.gz gnunet-5d0de68e3f7785eba7693f5d4dd3c83a7a94a684.zip |
-new api
Diffstat (limited to 'src/include/gnunet_namestore_service.h')
-rw-r--r-- | src/include/gnunet_namestore_service.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 130264418..5616225df 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -357,6 +357,41 @@ void | |||
357 | GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); | 357 | GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); |
358 | 358 | ||
359 | 359 | ||
360 | |||
361 | /* convenience APIs for serializing / deserializing GNS records */ | ||
362 | |||
363 | /** | ||
364 | * Calculate how many bytes we will need to serialize the given | ||
365 | * records. | ||
366 | */ | ||
367 | size_t | ||
368 | GNUNET_NAMESTORE_records_get_size (unsigned int rd_count, | ||
369 | const struct GNUNET_NAMESTORE_RecordData *rd); | ||
370 | |||
371 | /** | ||
372 | * Serialize the given records to the given destination buffer. | ||
373 | */ | ||
374 | ssize_t | ||
375 | GNUNET_NAMESTORE_records_serialize (unsigned int rd_count, | ||
376 | const struct GNUNET_NAMESTORE_RecordData *rd, | ||
377 | size_t dest_size, | ||
378 | char *dest); | ||
379 | |||
380 | |||
381 | /** | ||
382 | * @param rd_count expected number of records in 'src' | ||
383 | * @param dest array of 'rd_count' entries for storing record data; | ||
384 | * 'data' values in 'dest' will point into 'src' and will thus | ||
385 | * become invalid if 'src' is modified | ||
386 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
387 | */ | ||
388 | int | ||
389 | GNUNET_NAMESTORE_records_deserialize (size_t len, | ||
390 | const char *src, | ||
391 | unsigned int rd_count, | ||
392 | struct GNUNET_NAMESTORE_RecordData *dest); | ||
393 | |||
394 | |||
360 | #if 0 /* keep Emacsens' auto-indent happy */ | 395 | #if 0 /* keep Emacsens' auto-indent happy */ |
361 | { | 396 | { |
362 | #endif | 397 | #endif |