diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-16 15:41:10 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-16 15:41:10 +0100 |
commit | e724ea478e4efe6e2531f81908ce0f9334357d81 (patch) | |
tree | ad114d0882c246bb0a314cdb2ca1c025cecef034 /src/fs | |
parent | 1c4f90e7c538f1489ea17be3d2f655c2390d7ccf (diff) | |
download | gnunet-e724ea478e4efe6e2531f81908ce0f9334357d81.tar.gz gnunet-e724ea478e4efe6e2531f81908ce0f9334357d81.zip |
porting fs finished.
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-fs-profiler.c | 30 | ||||
-rw-r--r-- | src/fs/gnunet-fs.c | 13 | ||||
-rw-r--r-- | src/fs/gnunet-search.c | 58 | ||||
-rw-r--r-- | src/fs/gnunet-unindex.c | 10 |
4 files changed, 70 insertions, 41 deletions
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c index cfbe57bbd..fb99d8f90 100644 --- a/src/fs/gnunet-fs-profiler.c +++ b/src/fs/gnunet-fs-profiler.c | |||
@@ -203,16 +203,26 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
203 | int | 203 | int |
204 | main (int argc, char *const *argv) | 204 | main (int argc, char *const *argv) |
205 | { | 205 | { |
206 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 206 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
207 | {'n', "num-peers", "COUNT", | 207 | |
208 | gettext_noop ("run the experiment with COUNT peers"), | 208 | GNUNET_GETOPT_OPTION_SET_UINT ('n', |
209 | 1, &GNUNET_GETOPT_set_uint, &num_peers}, | 209 | "num-peers", |
210 | {'H', "hosts", "HOSTFILE", | 210 | "COUNT", |
211 | gettext_noop ("specifies name of a file with the HOSTS the testbed should use"), | 211 | gettext_noop ("run the experiment with COUNT peers"), |
212 | 1, &GNUNET_GETOPT_set_string, &host_filename}, | 212 | &num_peers), |
213 | {'t', "timeout", "DELAY", | 213 | |
214 | gettext_noop ("automatically terminate experiment after DELAY"), | 214 | GNUNET_GETOPT_OPTION_STRING ('H', |
215 | 1, &GNUNET_GETOPT_set_relative_time, &timeout}, | 215 | "hosts", |
216 | "HOSTFILE", | ||
217 | gettext_noop ("specifies name of a file with the HOSTS the testbed should use"), | ||
218 | &host_filename), | ||
219 | |||
220 | GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t', | ||
221 | "timeout", | ||
222 | "DELAY", | ||
223 | gettext_noop ("automatically terminate experiment after DELAY"), | ||
224 | &timeout), | ||
225 | |||
216 | GNUNET_GETOPT_OPTION_END | 226 | GNUNET_GETOPT_OPTION_END |
217 | }; | 227 | }; |
218 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 228 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c index 7c20e025f..2b24b7124 100644 --- a/src/fs/gnunet-fs.c +++ b/src/fs/gnunet-fs.c | |||
@@ -43,7 +43,7 @@ static int list_indexed_files; | |||
43 | /** | 43 | /** |
44 | * Option -v given? | 44 | * Option -v given? |
45 | */ | 45 | */ |
46 | static int verbose; | 46 | static unsigned int verbose; |
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
@@ -112,10 +112,13 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
112 | int | 112 | int |
113 | main (int argc, char *const *argv) | 113 | main (int argc, char *const *argv) |
114 | { | 114 | { |
115 | static struct GNUNET_GETOPT_CommandLineOption options[] = { | 115 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
116 | {'i', "list-indexed", NULL, | 116 | |
117 | gettext_noop ("print a list of all indexed files"), 0, | 117 | GNUNET_GETOPT_OPTION_SET_ONE ('i', |
118 | &GNUNET_GETOPT_set_one, &list_indexed_files}, | 118 | "list-indexed", |
119 | gettext_noop ("print a list of all indexed files"), | ||
120 | &list_indexed_files), | ||
121 | |||
119 | GNUNET_GETOPT_OPTION_VERBOSE (&verbose), | 122 | GNUNET_GETOPT_OPTION_VERBOSE (&verbose), |
120 | GNUNET_GETOPT_OPTION_END | 123 | GNUNET_GETOPT_OPTION_END |
121 | }; | 124 | }; |
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index dfe6d0e75..22e790cf3 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -51,7 +51,7 @@ static unsigned int results_limit; | |||
51 | 51 | ||
52 | static unsigned int results; | 52 | static unsigned int results; |
53 | 53 | ||
54 | static int verbose; | 54 | static unsigned int verbose; |
55 | 55 | ||
56 | static int local_only; | 56 | static int local_only; |
57 | 57 | ||
@@ -305,26 +305,42 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
305 | int | 305 | int |
306 | main (int argc, char *const *argv) | 306 | main (int argc, char *const *argv) |
307 | { | 307 | { |
308 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 308 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
309 | {'a', "anonymity", "LEVEL", | 309 | |
310 | gettext_noop ("set the desired LEVEL of receiver-anonymity"), | 310 | GNUNET_GETOPT_OPTION_SET_UINT ('a', |
311 | 1, &GNUNET_GETOPT_set_uint, &anonymity}, | 311 | "anonymity", |
312 | {'n', "no-network", NULL, | 312 | "LEVEL", |
313 | gettext_noop ("only search the local peer (no P2P network search)"), | 313 | gettext_noop ("set the desired LEVEL of receiver-anonymity"), |
314 | 0, &GNUNET_GETOPT_set_one, &local_only}, | 314 | &anonymity), |
315 | {'o', "output", "PREFIX", | 315 | |
316 | gettext_noop ("write search results to file starting with PREFIX"), | 316 | |
317 | 1, &GNUNET_GETOPT_set_string, &output_filename}, | 317 | GNUNET_GETOPT_OPTION_SET_ONE ('n', |
318 | {'t', "timeout", "DELAY", | 318 | "no-network", |
319 | gettext_noop ("automatically terminate search after DELAY"), | 319 | gettext_noop ("only search the local peer (no P2P network search)"), |
320 | 1, &GNUNET_GETOPT_set_relative_time, &timeout}, | 320 | &local_only), |
321 | {'V', "verbose", NULL, | 321 | |
322 | gettext_noop ("be verbose (print progress information)"), | 322 | GNUNET_GETOPT_OPTION_STRING ('o', |
323 | 0, &GNUNET_GETOPT_set_one, &verbose}, | 323 | "output", |
324 | {'N', "results", "VALUE", | 324 | "PREFIX", |
325 | gettext_noop | 325 | gettext_noop ("write search results to file starting with PREFIX"), |
326 | ("automatically terminate search after VALUE results are found"), | 326 | &output_filename), |
327 | 1, &GNUNET_GETOPT_set_uint, &results_limit}, | 327 | |
328 | GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t', | ||
329 | "timeout", | ||
330 | "DELAY", | ||
331 | gettext_noop ("automatically terminate search after DELAY"), | ||
332 | &timeout), | ||
333 | |||
334 | |||
335 | GNUNET_GETOPT_OPTION_VERBOSE (&verbose), | ||
336 | |||
337 | GNUNET_GETOPT_OPTION_SET_UINT ('N', | ||
338 | "results", | ||
339 | "VALUE", | ||
340 | gettext_noop ("automatically terminate search " | ||
341 | "after VALUE results are found"), | ||
342 | &results_limit), | ||
343 | |||
328 | GNUNET_GETOPT_OPTION_END | 344 | GNUNET_GETOPT_OPTION_END |
329 | }; | 345 | }; |
330 | 346 | ||
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index 40fa13b62..c53a85fb4 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | static int ret; | 31 | static int ret; |
32 | 32 | ||
33 | static int verbose; | 33 | static unsigned int verbose; |
34 | 34 | ||
35 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 35 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
36 | 36 | ||
@@ -162,10 +162,10 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
162 | int | 162 | int |
163 | main (int argc, char *const *argv) | 163 | main (int argc, char *const *argv) |
164 | { | 164 | { |
165 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 165 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
166 | {'V', "verbose", NULL, | 166 | |
167 | gettext_noop ("be verbose (print progress information)"), | 167 | GNUNET_GETOPT_OPTION_VERBOSE (&verbose), |
168 | 0, &GNUNET_GETOPT_set_one, &verbose}, | 168 | |
169 | GNUNET_GETOPT_OPTION_END | 169 | GNUNET_GETOPT_OPTION_END |
170 | }; | 170 | }; |
171 | 171 | ||