diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-15 17:14:29 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-15 17:14:29 +0000 |
commit | b47edd442e936ccda8ee172249209165fa6b427d (patch) | |
tree | 9c90657ab967ecfd5211bfdc583b44d6c2fe3793 | |
parent | af6d9589d9c17d4a7054f67929fea6bf402ef2c0 (diff) | |
download | gnunet-gtk-b47edd442e936ccda8ee172249209165fa6b427d.tar.gz gnunet-gtk-b47edd442e936ccda8ee172249209165fa6b427d.zip |
- clean up
-rw-r--r-- | src/gns/gnunet-gns-gtk.c | 46 | ||||
-rw-r--r-- | src/gns/gnunet-gns-gtk.h | 5 | ||||
-rw-r--r-- | src/gns/gnunet-gns-gtk_zone.c | 32 |
3 files changed, 34 insertions, 49 deletions
diff --git a/src/gns/gnunet-gns-gtk.c b/src/gns/gnunet-gns-gtk.c index 99c5cae2..5af0a0b4 100644 --- a/src/gns/gnunet-gns-gtk.c +++ b/src/gns/gnunet-gns-gtk.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "gnunet_gtk.h" | 26 | #include "gnunet_gtk.h" |
27 | #include "gnunet-gns-gtk.h" | ||
27 | #include <gnunet/gnunet_namestore_service.h> | 28 | #include <gnunet/gnunet_namestore_service.h> |
28 | 29 | ||
29 | /** | 30 | /** |
@@ -49,25 +50,6 @@ static char *zonekey_directory; | |||
49 | 50 | ||
50 | static GtkWidget *main_window; | 51 | static GtkWidget *main_window; |
51 | 52 | ||
52 | struct GNUNET_GNS_Context | ||
53 | { | ||
54 | /** | ||
55 | * Handle to the namestore. | ||
56 | */ | ||
57 | struct GNUNET_NAMESTORE_Handle *ns; | ||
58 | |||
59 | GtkBuilder *builder; | ||
60 | |||
61 | struct GNUNET_CRYPTO_RsaPrivateKey *pkey; | ||
62 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | ||
63 | |||
64 | GNUNET_HashCode zone; | ||
65 | |||
66 | |||
67 | |||
68 | }; | ||
69 | |||
70 | |||
71 | /** | 53 | /** |
72 | * Get cfg. | 54 | * Get cfg. |
73 | */ | 55 | */ |
@@ -295,32 +277,6 @@ GNUNET_GNS_GTK_main_window_delete_event_cb (GtkWidget *widget, | |||
295 | GNUNET_SCHEDULER_add_now (&shutdown_task, user_data); | 277 | GNUNET_SCHEDULER_add_now (&shutdown_task, user_data); |
296 | } | 278 | } |
297 | 279 | ||
298 | struct ZoneIteration_Context | ||
299 | { | ||
300 | GNUNET_HashCode zone; | ||
301 | struct GNUNET_NAMESTORE_ZoneIterator * it; | ||
302 | }; | ||
303 | |||
304 | void zone_iteration_proc (void *cls, | ||
305 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | ||
306 | struct GNUNET_TIME_Absolute expire, | ||
307 | const char *name, | ||
308 | unsigned int rd_len, | ||
309 | const struct GNUNET_NAMESTORE_RecordData *rd, | ||
310 | const struct GNUNET_CRYPTO_RsaSignature *signature) | ||
311 | { | ||
312 | struct ZoneIteration_Context * zc_ctx = cls; | ||
313 | GNUNET_assert (zc_ctx != NULL); | ||
314 | if ((NULL == zone_key) && (NULL == name)) | ||
315 | { | ||
316 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Zone iteration done\n"); | ||
317 | return; | ||
318 | } | ||
319 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Zone iteration dummy\n"); | ||
320 | } | ||
321 | |||
322 | |||
323 | |||
324 | /** | 280 | /** |
325 | * Actual main function run right after GNUnet's scheduler | 281 | * Actual main function run right after GNUnet's scheduler |
326 | * is initialized. Initializes up GTK and Glade. | 282 | * is initialized. Initializes up GTK and Glade. |
diff --git a/src/gns/gnunet-gns-gtk.h b/src/gns/gnunet-gns-gtk.h index 282f3039..b7165e49 100644 --- a/src/gns/gnunet-gns-gtk.h +++ b/src/gns/gnunet-gns-gtk.h | |||
@@ -36,10 +36,15 @@ struct GNUNET_GNS_Context | |||
36 | 36 | ||
37 | GtkBuilder *builder; | 37 | GtkBuilder *builder; |
38 | 38 | ||
39 | struct GNUNET_CRYPTO_RsaPrivateKey *pkey; | ||
40 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | ||
39 | 41 | ||
42 | GNUNET_HashCode zone; | ||
40 | }; | 43 | }; |
41 | 44 | ||
42 | 45 | ||
43 | 46 | ||
44 | 47 | ||
48 | |||
49 | |||
45 | /* end of gnunet-gns-gtk.h */ | 50 | /* end of gnunet-gns-gtk.h */ |
diff --git a/src/gns/gnunet-gns-gtk_zone.c b/src/gns/gnunet-gns-gtk_zone.c index dd88df89..181665ab 100644 --- a/src/gns/gnunet-gns-gtk_zone.c +++ b/src/gns/gnunet-gns-gtk_zone.c | |||
@@ -140,6 +140,32 @@ GNUNET_GNS_GTK_main_treeview_popup_menu_cb (GtkWidget *widget, | |||
140 | return FALSE; | 140 | return FALSE; |
141 | } | 141 | } |
142 | 142 | ||
143 | |||
144 | |||
145 | struct ZoneIteration_Context | ||
146 | { | ||
147 | GNUNET_HashCode zone; | ||
148 | struct GNUNET_NAMESTORE_ZoneIterator * it; | ||
149 | }; | ||
150 | |||
151 | void zone_iteration_proc (void *cls, | ||
152 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | ||
153 | struct GNUNET_TIME_Absolute expire, | ||
154 | const char *name, | ||
155 | unsigned int rd_len, | ||
156 | const struct GNUNET_NAMESTORE_RecordData *rd, | ||
157 | const struct GNUNET_CRYPTO_RsaSignature *signature) | ||
158 | { | ||
159 | struct ZoneIteration_Context * zc_ctx = cls; | ||
160 | GNUNET_assert (zc_ctx != NULL); | ||
161 | if ((NULL == zone_key) && (NULL == name)) | ||
162 | { | ||
163 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Zone iteration done\n"); | ||
164 | return; | ||
165 | } | ||
166 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Zone iteration dummy\n"); | ||
167 | } | ||
168 | |||
143 | /** | 169 | /** |
144 | * The zone treeview was realized. Setup the model. | 170 | * The zone treeview was realized. Setup the model. |
145 | * | 171 | * |
@@ -165,15 +191,13 @@ GNUNET_GNS_GTK_main_treeview_realize_cb (GtkWidget *widget, | |||
165 | /* Append a top level row and leave it empty */ | 191 | /* Append a top level row and leave it empty */ |
166 | gtk_tree_store_append(ts, &toplevel, NULL); | 192 | gtk_tree_store_append(ts, &toplevel, NULL); |
167 | 193 | ||
168 | /* | ||
169 | struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); | 194 | struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); |
170 | zc_ctx->zone = zone; | 195 | zc_ctx->zone = gns->zone; |
171 | GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone, | 196 | GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &gns->zone, |
172 | GNUNET_NAMESTORE_RF_NONE, | 197 | GNUNET_NAMESTORE_RF_NONE, |
173 | GNUNET_NAMESTORE_RF_NONE, | 198 | GNUNET_NAMESTORE_RF_NONE, |
174 | &zone_iteration_proc, | 199 | &zone_iteration_proc, |
175 | zc_ctx); | 200 | zc_ctx); |
176 | */ | ||
177 | 201 | ||
178 | 202 | ||
179 | GNUNET_break (0); | 203 | GNUNET_break (0); |