aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-05 23:18:00 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-05 23:18:00 +0200
commit645b26ba88218c4a2f9a022968a8c03e9035082d (patch)
tree7a32403fdd32c4f1b01ddc78de920f4b01bd7d9b /src/namestore/gnunet-namestore.c
parent04a5c505163a84f8a7097dc7b32cf8051c74c214 (diff)
downloadgnunet-645b26ba88218c4a2f9a022968a8c03e9035082d.tar.gz
gnunet-645b26ba88218c4a2f9a022968a8c03e9035082d.zip
update namestore monitor API users to use new _next call where needed
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r--src/namestore/gnunet-namestore.c62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index d329dcb3b..32b1a39d0 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -374,16 +374,12 @@ zone_iteration_error_cb (void *cls)
374/** 374/**
375 * Process a record that was stored in the namestore. 375 * Process a record that was stored in the namestore.
376 * 376 *
377 * @param cls closure
378 * @param zone_key private key of the zone
379 * @param rname name that is being mapped (at most 255 characters long) 377 * @param rname name that is being mapped (at most 255 characters long)
380 * @param rd_len number of entries in @a rd array 378 * @param rd_len number of entries in @a rd array
381 * @param rd array of records with data to store 379 * @param rd array of records with data to store
382 */ 380 */
383static void 381static void
384display_record (void *cls, 382display_record (const char *rname,
385 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
386 const char *rname,
387 unsigned int rd_len, 383 unsigned int rd_len,
388 const struct GNUNET_GNSRECORD_Data *rd) 384 const struct GNUNET_GNSRECORD_Data *rd)
389{ 385{
@@ -393,8 +389,6 @@ display_record (void *cls,
393 struct GNUNET_TIME_Absolute at; 389 struct GNUNET_TIME_Absolute at;
394 struct GNUNET_TIME_Relative rt; 390 struct GNUNET_TIME_Relative rt;
395 391
396 (void) cls;
397 (void) zone_key;
398 if ( (NULL != name) && 392 if ( (NULL != name) &&
399 (0 != strcmp (name, rname)) ) 393 (0 != strcmp (name, rname)) )
400 { 394 {
@@ -442,12 +436,62 @@ display_record (void *cls,
442 GNUNET_free (s); 436 GNUNET_free (s);
443 } 437 }
444 FPRINTF (stdout, "%s", "\n"); 438 FPRINTF (stdout, "%s", "\n");
439}
440
441
442/**
443 * Process a record that was stored in the namestore.
444 *
445 * @param cls closure
446 * @param zone_key private key of the zone
447 * @param rname name that is being mapped (at most 255 characters long)
448 * @param rd_len number of entries in @a rd array
449 * @param rd array of records with data to store
450 */
451static void
452display_record_iterator (void *cls,
453 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
454 const char *rname,
455 unsigned int rd_len,
456 const struct GNUNET_GNSRECORD_Data *rd)
457{
458 (void) cls;
459 (void) zone_key;
460 display_record (rname,
461 rd_len,
462 rd);
445 GNUNET_NAMESTORE_zone_iterator_next (list_it, 463 GNUNET_NAMESTORE_zone_iterator_next (list_it,
446 1); 464 1);
447} 465}
448 466
449 467
450/** 468/**
469 * Process a record that was stored in the namestore.
470 *
471 * @param cls closure
472 * @param zone_key private key of the zone
473 * @param rname name that is being mapped (at most 255 characters long)
474 * @param rd_len number of entries in @a rd array
475 * @param rd array of records with data to store
476 */
477static void
478display_record_monitor (void *cls,
479 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
480 const char *rname,
481 unsigned int rd_len,
482 const struct GNUNET_GNSRECORD_Data *rd)
483{
484 (void) cls;
485 (void) zone_key;
486 display_record (rname,
487 rd_len,
488 rd);
489 GNUNET_NAMESTORE_zone_monitor_next (zm,
490 1);
491}
492
493
494/**
451 * Function called once we are in sync in monitor mode. 495 * Function called once we are in sync in monitor mode.
452 * 496 *
453 * @param cls NULL 497 * @param cls NULL
@@ -956,7 +1000,7 @@ identity_cb (void *cls,
956 &zone_pkey, 1000 &zone_pkey,
957 &zone_iteration_error_cb, 1001 &zone_iteration_error_cb,
958 NULL, 1002 NULL,
959 &display_record, 1003 &display_record_iterator,
960 NULL, 1004 NULL,
961 &zone_iteration_finished, 1005 &zone_iteration_finished,
962 NULL); 1006 NULL);
@@ -1054,7 +1098,7 @@ identity_cb (void *cls,
1054 GNUNET_YES, 1098 GNUNET_YES,
1055 &monitor_error_cb, 1099 &monitor_error_cb,
1056 NULL, 1100 NULL,
1057 &display_record, 1101 &display_record_monitor,
1058 NULL, 1102 NULL,
1059 &sync_cb, 1103 &sync_cb,
1060 NULL); 1104 NULL);