diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-05 15:05:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-05 15:05:10 +0000 |
commit | c4bd622082ef1bcba14cc81bed6860132342c17a (patch) | |
tree | 2c08fab24bd0b50aea662e09f3a1724994637044 | |
parent | 7c72e77dd6a12b1ceb458a8570bbcdc3337256ee (diff) | |
download | gnunet-gtk-c4bd622082ef1bcba14cc81bed6860132342c17a.tar.gz gnunet-gtk-c4bd622082ef1bcba14cc81bed6860132342c17a.zip |
-remove dead GNUNET_GTK_find_largest_namespace_rating and GNUNET_GTK_set_largest_namespace_rating
-rw-r--r-- | src/fs/gnunet-fs-gtk_common.c | 65 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk_common.h | 25 |
2 files changed, 0 insertions, 90 deletions
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c index b7d0c6d1..1d4262e9 100644 --- a/src/fs/gnunet-fs-gtk_common.c +++ b/src/fs/gnunet-fs-gtk_common.c | |||
@@ -433,71 +433,6 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
433 | } | 433 | } |
434 | 434 | ||
435 | 435 | ||
436 | /* Largest rating value among all namespaces. INT_MIN means "undefined" */ | ||
437 | static int largest_namespace_rating = INT_MIN; | ||
438 | |||
439 | |||
440 | /** | ||
441 | * Helper function for finding the largest namespace rating. | ||
442 | * | ||
443 | * @param cls closure | ||
444 | * @param pseudonym pseudonym hash | ||
445 | * @param md metadata container | ||
446 | * @param rating rating | ||
447 | * @return GNUNET_OK to keep iterating | ||
448 | */ | ||
449 | static int | ||
450 | find_largest_namespace_rating_iterator (void *cls, | ||
451 | const struct GNUNET_CRYPTO_EccPublicKey *pseudonym, | ||
452 | const char *name, | ||
453 | const char *unique_name, | ||
454 | const struct GNUNET_CONTAINER_MetaData *md, | ||
455 | int32_t rating) | ||
456 | { | ||
457 | int *largest = cls; | ||
458 | |||
459 | if (*largest < rating) | ||
460 | *largest = rating; | ||
461 | return GNUNET_OK; | ||
462 | } | ||
463 | |||
464 | |||
465 | /** | ||
466 | * Finds largest namespace rating. | ||
467 | * Used to calculate a rating for newly discovered namespaces. | ||
468 | * Returns from cache, if possible. | ||
469 | * | ||
470 | * @return largest namespace rating. Might be negative and even. INT_MIN means | ||
471 | * that no namespaces are known. | ||
472 | */ | ||
473 | int | ||
474 | GNUNET_GTK_find_largest_namespace_rating () | ||
475 | { | ||
476 | if (largest_namespace_rating != INT_MIN) | ||
477 | return largest_namespace_rating; | ||
478 | (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (), | ||
479 | &find_largest_namespace_rating_iterator, | ||
480 | &largest_namespace_rating); | ||
481 | return largest_namespace_rating; | ||
482 | } | ||
483 | |||
484 | |||
485 | /** | ||
486 | * Sets largest namespace rating. | ||
487 | * Used to change cached largest namespace rating, when namespace list | ||
488 | * was changed in a way that is easy to track. | ||
489 | * If namespace list was changed in a way that makes it difficult to | ||
490 | * decide upon the new value, set new value to INT_MIN. | ||
491 | * | ||
492 | * @param new_value new value for the rating. | ||
493 | */ | ||
494 | void | ||
495 | GNUNET_GTK_set_largest_namespace_rating (int new_value) | ||
496 | { | ||
497 | largest_namespace_rating = new_value; | ||
498 | } | ||
499 | |||
500 | |||
501 | /** | 436 | /** |
502 | * Converts a GtkTreeRowReference to a GtkTreeIter. | 437 | * Converts a GtkTreeRowReference to a GtkTreeIter. |
503 | * | 438 | * |
diff --git a/src/fs/gnunet-fs-gtk_common.h b/src/fs/gnunet-fs-gtk_common.h index 9d8ba188..cab261b2 100644 --- a/src/fs/gnunet-fs-gtk_common.h +++ b/src/fs/gnunet-fs-gtk_common.h | |||
@@ -151,31 +151,6 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
151 | 151 | ||
152 | 152 | ||
153 | /** | 153 | /** |
154 | * Finds largest namespace rating. | ||
155 | * Used to calculate a rating for newly discovered namespaces. | ||
156 | * Returns from cache, if possible. | ||
157 | * | ||
158 | * @return largest namespace rating. Might be negative and even. INT_MIN means | ||
159 | * that no namespaces are known. | ||
160 | */ | ||
161 | int | ||
162 | GNUNET_GTK_find_largest_namespace_rating (void); | ||
163 | |||
164 | |||
165 | /** | ||
166 | * Sets largest namespace rating. | ||
167 | * Used to change cached largest namespace rating, when namespace list | ||
168 | * was changed in a way that is easy to track. | ||
169 | * If namespace list was changed in a way that makes it difficult to | ||
170 | * decide upon the new value, set new value to INT_MIN. | ||
171 | * | ||
172 | * @param new_value new value for the rating. | ||
173 | */ | ||
174 | void | ||
175 | GNUNET_GTK_set_largest_namespace_rating (int new_value); | ||
176 | |||
177 | |||
178 | /** | ||
179 | * Converts a GtkTreeRowReference to a GtkTreeIter. | 154 | * Converts a GtkTreeRowReference to a GtkTreeIter. |
180 | * | 155 | * |
181 | * @param rr row reference | 156 | * @param rr row reference |