diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/dht/gnunet-dht-get.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r-- | src/dht/gnunet-dht-get.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index b807a798f..161f0f41b 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c | |||
@@ -117,15 +117,14 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
117 | * @param data pointer to the result data | 117 | * @param data pointer to the result data |
118 | */ | 118 | */ |
119 | void | 119 | void |
120 | get_result_iterator (void *cls, | 120 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
121 | struct GNUNET_TIME_Absolute exp, | ||
122 | const GNUNET_HashCode * key, | 121 | const GNUNET_HashCode * key, |
123 | const struct GNUNET_PeerIdentity *const *get_path, | 122 | const struct GNUNET_PeerIdentity *const *get_path, |
124 | const struct GNUNET_PeerIdentity *const *put_path, | 123 | const struct GNUNET_PeerIdentity *const *put_path, |
125 | enum GNUNET_BLOCK_Type type, size_t size, const void *data) | 124 | enum GNUNET_BLOCK_Type type, size_t size, const void *data) |
126 | { | 125 | { |
127 | fprintf (stdout, "Result %d, type %d:\n%.*s\n", | 126 | fprintf (stdout, "Result %d, type %d:\n%.*s\n", result_count, type, |
128 | result_count, type, (unsigned int) size, (char *) data); | 127 | (unsigned int) size, (char *) data); |
129 | result_count++; | 128 | result_count++; |
130 | } | 129 | } |
131 | 130 | ||
@@ -139,9 +138,8 @@ get_result_iterator (void *cls, | |||
139 | * @param c configuration | 138 | * @param c configuration |
140 | */ | 139 | */ |
141 | static void | 140 | static void |
142 | run (void *cls, | 141 | run (void *cls, char *const *args, const char *cfgfile, |
143 | char *const *args, | 142 | const struct GNUNET_CONFIGURATION_Handle *c) |
144 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) | ||
145 | { | 143 | { |
146 | struct GNUNET_TIME_Relative timeout; | 144 | struct GNUNET_TIME_Relative timeout; |
147 | GNUNET_HashCode key; | 145 | GNUNET_HashCode key; |
@@ -181,14 +179,10 @@ run (void *cls, | |||
181 | fprintf (stderr, "Issuing GET request for %s!\n", query_key); | 179 | fprintf (stderr, "Issuing GET request for %s!\n", query_key); |
182 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 180 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
183 | (absolute_timeout), &cleanup_task, NULL); | 181 | (absolute_timeout), &cleanup_task, NULL); |
184 | get_handle = GNUNET_DHT_get_start (dht_handle, | 182 | get_handle = |
185 | timeout, | 183 | GNUNET_DHT_get_start (dht_handle, timeout, query_type, &key, |
186 | query_type, | 184 | DEFAULT_GET_REPLICATION, GNUNET_DHT_RO_NONE, NULL, |
187 | &key, | 185 | 0, NULL, 0, &get_result_iterator, NULL); |
188 | DEFAULT_GET_REPLICATION, | ||
189 | GNUNET_DHT_RO_NONE, | ||
190 | NULL, 0, | ||
191 | NULL, 0, &get_result_iterator, NULL); | ||
192 | 186 | ||
193 | } | 187 | } |
194 | 188 | ||
@@ -224,9 +218,7 @@ int | |||
224 | main (int argc, char *const *argv) | 218 | main (int argc, char *const *argv) |
225 | { | 219 | { |
226 | return (GNUNET_OK == | 220 | return (GNUNET_OK == |
227 | GNUNET_PROGRAM_run (argc, | 221 | GNUNET_PROGRAM_run (argc, argv, "gnunet-dht-get", |
228 | argv, | ||
229 | "gnunet-dht-get", | ||
230 | gettext_noop | 222 | gettext_noop |
231 | ("Issue a GET request to the GNUnet DHT, prints results."), | 223 | ("Issue a GET request to the GNUnet DHT, prints results."), |
232 | options, &run, NULL)) ? ret : 1; | 224 | options, &run, NULL)) ? ret : 1; |