aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-10 13:02:28 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-10 13:02:51 +0200
commit0cd0e3a5287af73bb81219ebc9548395a8945ce8 (patch)
treeb5bb24d78a4eed519b37e6fb8f9291a6282d06d4 /src/namestore/gnunet-namestore.c
parent3eae3e43d6f94449cb89998a676e6696438cc604 (diff)
downloadgnunet-0cd0e3a5287af73bb81219ebc9548395a8945ce8.tar.gz
gnunet-0cd0e3a5287af73bb81219ebc9548395a8945ce8.zip
more work on gnunet-zoneimport, some bugfix in flat namestore, misc. style fixes
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r--src/namestore/gnunet-namestore.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 054417ab5..2eff995e0 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -203,6 +203,7 @@ static int monitor;
203static void 203static void
204do_shutdown (void *cls) 204do_shutdown (void *cls)
205{ 205{
206 (void) cls;
206 if (NULL != get_default) 207 if (NULL != get_default)
207 { 208 {
208 GNUNET_IDENTITY_cancel (get_default); 209 GNUNET_IDENTITY_cancel (get_default);
@@ -323,6 +324,7 @@ del_continuation (void *cls,
323 int32_t success, 324 int32_t success,
324 const char *emsg) 325 const char *emsg)
325{ 326{
327 (void) cls;
326 del_qe = NULL; 328 del_qe = NULL;
327 if (GNUNET_NO == success) 329 if (GNUNET_NO == success)
328 { 330 {
@@ -348,6 +350,7 @@ del_continuation (void *cls,
348static void 350static void
349zone_iteration_finished (void *cls) 351zone_iteration_finished (void *cls)
350{ 352{
353 (void) cls;
351 list_it = NULL; 354 list_it = NULL;
352 test_finished (); 355 test_finished ();
353} 356}
@@ -359,6 +362,7 @@ zone_iteration_finished (void *cls)
359static void 362static void
360zone_iteration_error_cb (void *cls) 363zone_iteration_error_cb (void *cls)
361{ 364{
365 (void) cls;
362 list_it = NULL; 366 list_it = NULL;
363 fprintf (stderr, 367 fprintf (stderr,
364 "Error iterating over zone\n"); 368 "Error iterating over zone\n");
@@ -385,11 +389,11 @@ display_record (void *cls,
385{ 389{
386 const char *typestring; 390 const char *typestring;
387 char *s; 391 char *s;
388 unsigned int i;
389 const char *ets; 392 const char *ets;
390 struct GNUNET_TIME_Absolute at; 393 struct GNUNET_TIME_Absolute at;
391 struct GNUNET_TIME_Relative rt; 394 struct GNUNET_TIME_Relative rt;
392 395
396 (void) cls;
393 if ( (NULL != name) && 397 if ( (NULL != name) &&
394 (0 != strcmp (name, rname)) ) 398 (0 != strcmp (name, rname)) )
395 { 399 {
@@ -399,7 +403,7 @@ display_record (void *cls,
399 FPRINTF (stdout, 403 FPRINTF (stdout,
400 "%s:\n", 404 "%s:\n",
401 rname); 405 rname);
402 for (i=0;i<rd_len;i++) 406 for (unsigned int i=0;i<rd_len;i++)
403 { 407 {
404 if ( (GNUNET_GNSRECORD_TYPE_NICK == rd[i].record_type) && 408 if ( (GNUNET_GNSRECORD_TYPE_NICK == rd[i].record_type) &&
405 (0 != strcmp (rname, 409 (0 != strcmp (rname,
@@ -448,7 +452,10 @@ display_record (void *cls,
448static void 452static void
449sync_cb (void *cls) 453sync_cb (void *cls)
450{ 454{
451 FPRINTF (stdout, "%s", "Monitor is now in sync.\n"); 455 (void) cls;
456 FPRINTF (stdout,
457 "%s",
458 "Monitor is now in sync.\n");
452} 459}
453 460
454 461
@@ -460,7 +467,10 @@ sync_cb (void *cls)
460static void 467static void
461monitor_error_cb (void *cls) 468monitor_error_cb (void *cls)
462{ 469{
463 FPRINTF (stderr, "%s", "Monitor disconnected and out of sync.\n"); 470 (void) cls;
471 FPRINTF (stderr,
472 "%s",
473 "Monitor disconnected and out of sync.\n");
464} 474}
465 475
466 476
@@ -470,6 +480,7 @@ monitor_error_cb (void *cls)
470static void 480static void
471lookup_error_cb (void *cls) 481lookup_error_cb (void *cls)
472{ 482{
483 (void) cls;
473 add_qe = NULL; 484 add_qe = NULL;
474 GNUNET_break (0); 485 GNUNET_break (0);
475 ret = 1; 486 ret = 1;
@@ -496,8 +507,8 @@ get_existing_record (void *cls,
496{ 507{
497 struct GNUNET_GNSRECORD_Data rdn[rd_count + 1]; 508 struct GNUNET_GNSRECORD_Data rdn[rd_count + 1];
498 struct GNUNET_GNSRECORD_Data *rde; 509 struct GNUNET_GNSRECORD_Data *rde;
499 unsigned int i;
500 510
511 (void) cls;
501 add_qe = NULL; 512 add_qe = NULL;
502 if (0 != strcmp (rec_name, name)) 513 if (0 != strcmp (rec_name, name))
503 { 514 {
@@ -510,7 +521,7 @@ get_existing_record (void *cls,
510 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 521 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
511 "Received %u records for name `%s'\n", 522 "Received %u records for name `%s'\n",
512 rd_count, rec_name); 523 rd_count, rec_name);
513 for (i=0;i<rd_count;i++) 524 for (unsigned int i=0;i<rd_count;i++)
514 { 525 {
515 switch (rd[i].record_type) 526 switch (rd[i].record_type)
516 { 527 {
@@ -579,7 +590,9 @@ get_existing_record (void *cls,
579 } 590 }
580 break; 591 break;
581 } 592 }
582 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); 593 memset (rdn,
594 0,
595 sizeof (struct GNUNET_GNSRECORD_Data));
583 GNUNET_memcpy (&rdn[1], 596 GNUNET_memcpy (&rdn[1],
584 rd, 597 rd,
585 rd_count * sizeof (struct GNUNET_GNSRECORD_Data)); 598 rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
@@ -617,6 +630,7 @@ get_existing_record (void *cls,
617static void 630static void
618reverse_error_cb (void *cls) 631reverse_error_cb (void *cls)
619{ 632{
633 (void) cls;
620 reverse_qe = NULL; 634 reverse_qe = NULL;
621 FPRINTF (stdout, 635 FPRINTF (stdout,
622 "%s.zkey\n", 636 "%s.zkey\n",
@@ -641,6 +655,7 @@ handle_reverse_lookup (void *cls,
641 unsigned int rd_count, 655 unsigned int rd_count,
642 const struct GNUNET_GNSRECORD_Data *rd) 656 const struct GNUNET_GNSRECORD_Data *rd)
643{ 657{
658 (void) cls;
644 reverse_qe = NULL; 659 reverse_qe = NULL;
645 if (NULL == label) 660 if (NULL == label)
646 FPRINTF (stdout, 661 FPRINTF (stdout,
@@ -660,6 +675,7 @@ handle_reverse_lookup (void *cls,
660static void 675static void
661del_lookup_error_cb (void *cls) 676del_lookup_error_cb (void *cls)
662{ 677{
678 (void) cls;
663 del_qe = NULL; 679 del_qe = NULL;
664 GNUNET_break (0); 680 GNUNET_break (0);
665 ret = 1; 681 ret = 1;
@@ -687,10 +703,10 @@ del_monitor (void *cls,
687{ 703{
688 struct GNUNET_GNSRECORD_Data rdx[rd_count]; 704 struct GNUNET_GNSRECORD_Data rdx[rd_count];
689 unsigned int rd_left; 705 unsigned int rd_left;
690 unsigned int i;
691 uint32_t type; 706 uint32_t type;
692 char *vs; 707 char *vs;
693 708
709 (void) cls;
694 del_qe = NULL; 710 del_qe = NULL;
695 if (0 == rd_count) 711 if (0 == rd_count)
696 { 712 {
@@ -719,7 +735,7 @@ del_monitor (void *cls,
719 type = GNUNET_GNSRECORD_typename_to_number (typestring); 735 type = GNUNET_GNSRECORD_typename_to_number (typestring);
720 else 736 else
721 type = GNUNET_GNSRECORD_TYPE_ANY; 737 type = GNUNET_GNSRECORD_TYPE_ANY;
722 for (i=0;i<rd_count;i++) 738 for (unsigned int i=0;i<rd_count;i++)
723 { 739 {
724 vs = NULL; 740 vs = NULL;
725 if (! ( ( (GNUNET_GNSRECORD_TYPE_ANY == type) || 741 if (! ( ( (GNUNET_GNSRECORD_TYPE_ANY == type) ||
@@ -1044,6 +1060,9 @@ default_ego_cb (void *cls,
1044 void **ctx, 1060 void **ctx,
1045 const char *name) 1061 const char *name)
1046{ 1062{
1063 (void) cls;
1064 (void) ctx;
1065 (void) name;
1047 get_default = NULL; 1066 get_default = NULL;
1048 if (NULL == ego) 1067 if (NULL == ego)
1049 { 1068 {
@@ -1092,7 +1111,11 @@ run (void *cls,
1092 const char *cfgfile, 1111 const char *cfgfile,
1093 const struct GNUNET_CONFIGURATION_Handle *cfg) 1112 const struct GNUNET_CONFIGURATION_Handle *cfg)
1094{ 1113{
1095 if ( (NULL != args[0]) && (NULL == uri) ) 1114 (void) cls;
1115 (void) args;
1116 (void) cfgfile;
1117 if ( (NULL != args[0]) &&
1118 (NULL == uri) )
1096 uri = GNUNET_strdup (args[0]); 1119 uri = GNUNET_strdup (args[0]);
1097 1120
1098 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, 1121 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,