aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-18 14:09:55 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-18 14:09:55 +0000
commit200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7 (patch)
treef89388586fbf00a3b7c985b2b28bb74abda3a364 /src/fs
parent640ae593fd34d27034f994a2e945a8942f1a4d5d (diff)
downloadgnunet-200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7.tar.gz
gnunet-200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7.zip
localization
of scopes
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-directory.c11
-rw-r--r--src/fs/gnunet-download.c63
-rw-r--r--src/fs/gnunet-pseudonym.c94
-rw-r--r--src/fs/gnunet-publish.c121
-rw-r--r--src/fs/gnunet-search.c37
-rw-r--r--src/fs/gnunet-unindex.c17
6 files changed, 158 insertions, 185 deletions
diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c
index c1a7c78f3..1b17f69d2 100644
--- a/src/fs/gnunet-directory.c
+++ b/src/fs/gnunet-directory.c
@@ -167,14 +167,6 @@ run (void *cls,
167} 167}
168 168
169/** 169/**
170 * gnunet-directory command line options
171 */
172static struct GNUNET_GETOPT_CommandLineOption options[] = {
173 GNUNET_GETOPT_OPTION_END
174};
175
176
177/**
178 * The main function to inspect GNUnet directories. 170 * The main function to inspect GNUnet directories.
179 * 171 *
180 * @param argc number of arguments from the command line 172 * @param argc number of arguments from the command line
@@ -184,6 +176,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
184int 176int
185main (int argc, char *const *argv) 177main (int argc, char *const *argv)
186{ 178{
179 static struct GNUNET_GETOPT_CommandLineOption options[] = {
180 GNUNET_GETOPT_OPTION_END
181 };
187 return (GNUNET_OK == 182 return (GNUNET_OK ==
188 GNUNET_PROGRAM_run (argc, 183 GNUNET_PROGRAM_run (argc,
189 argv, 184 argv,
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index fde254d7c..a171006cb 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -253,40 +253,6 @@ run (void *cls,
253 253
254 254
255/** 255/**
256 * gnunet-download command line options
257 */
258static struct GNUNET_GETOPT_CommandLineOption options[] = {
259 {'a', "anonymity", "LEVEL",
260 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
261 1, &GNUNET_GETOPT_set_uint, &anonymity},
262 {'D', "delete-incomplete", NULL,
263 gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
264 0, &GNUNET_GETOPT_set_one, &delete_incomplete},
265 {'n', "no-network", NULL,
266 gettext_noop ("only search the local peer (no P2P network search)"),
267 1, &GNUNET_GETOPT_set_uint, &local_only},
268 {'o', "output", "FILENAME",
269 gettext_noop ("write the file to FILENAME"),
270 1, &GNUNET_GETOPT_set_string, &filename},
271 {'p', "parallelism", "DOWNLOADS",
272 gettext_noop
273 ("set the maximum number of parallel downloads that is allowed"),
274 1, &GNUNET_GETOPT_set_uint, &parallelism},
275 {'r', "request-parallelism", "REQUESTS",
276 gettext_noop
277 ("set the maximum number of parallel requests for blocks that is allowed"),
278 1, &GNUNET_GETOPT_set_uint, &request_parallelism},
279 {'R', "recursive", NULL,
280 gettext_noop ("download a GNUnet directory recursively"),
281 0, &GNUNET_GETOPT_set_one, &do_recursive},
282 {'V', "verbose", NULL,
283 gettext_noop ("be verbose (print progress information)"),
284 0, &GNUNET_GETOPT_set_one, &verbose},
285 GNUNET_GETOPT_OPTION_END
286};
287
288
289/**
290 * The main function to download GNUnet. 256 * The main function to download GNUnet.
291 * 257 *
292 * @param argc number of arguments from the command line 258 * @param argc number of arguments from the command line
@@ -296,6 +262,35 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
296int 262int
297main (int argc, char *const *argv) 263main (int argc, char *const *argv)
298{ 264{
265 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
266 {'a', "anonymity", "LEVEL",
267 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
268 1, &GNUNET_GETOPT_set_uint, &anonymity},
269 {'D', "delete-incomplete", NULL,
270 gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
271 0, &GNUNET_GETOPT_set_one, &delete_incomplete},
272 {'n', "no-network", NULL,
273 gettext_noop ("only search the local peer (no P2P network search)"),
274 1, &GNUNET_GETOPT_set_uint, &local_only},
275 {'o', "output", "FILENAME",
276 gettext_noop ("write the file to FILENAME"),
277 1, &GNUNET_GETOPT_set_string, &filename},
278 {'p', "parallelism", "DOWNLOADS",
279 gettext_noop
280 ("set the maximum number of parallel downloads that is allowed"),
281 1, &GNUNET_GETOPT_set_uint, &parallelism},
282 {'r', "request-parallelism", "REQUESTS",
283 gettext_noop
284 ("set the maximum number of parallel requests for blocks that is allowed"),
285 1, &GNUNET_GETOPT_set_uint, &request_parallelism},
286 {'R', "recursive", NULL,
287 gettext_noop ("download a GNUnet directory recursively"),
288 0, &GNUNET_GETOPT_set_one, &do_recursive},
289 {'V', "verbose", NULL,
290 gettext_noop ("be verbose (print progress information)"),
291 0, &GNUNET_GETOPT_set_one, &verbose},
292 GNUNET_GETOPT_OPTION_END
293 };
299 return (GNUNET_OK == 294 return (GNUNET_OK ==
300 GNUNET_PROGRAM_run (argc, 295 GNUNET_PROGRAM_run (argc,
301 argv, 296 argv,
diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c
index 9f85f0545..465cbdd68 100644
--- a/src/fs/gnunet-pseudonym.c
+++ b/src/fs/gnunet-pseudonym.c
@@ -326,55 +326,6 @@ run (void *cls,
326 post_advertising (NULL, NULL, NULL); 326 post_advertising (NULL, NULL, NULL);
327} 327}
328 328
329/**
330 * gnunet-pseudonym command line options
331 */
332static struct GNUNET_GETOPT_CommandLineOption options[] = {
333 {'a', "anonymity", "LEVEL",
334 gettext_noop ("set the desired LEVEL of sender-anonymity"),
335 1, &GNUNET_GETOPT_set_uint, &anonymity},
336 {'A', "automate", NULL,
337 gettext_noop ("start a collection"),
338 0, &GNUNET_GETOPT_set_one, &start_automate},
339 {'C', "create", "NAME",
340 gettext_noop
341 ("create or advertise namespace NAME"),
342 1, &GNUNET_GETOPT_set_string, &create_ns},
343 {'D', "delete", "NAME",
344 gettext_noop
345 ("delete namespace NAME "),
346 1, &GNUNET_GETOPT_set_string, &delete_ns},
347 {'e', "end", NULL,
348 gettext_noop ("end current collection"),
349 0, &GNUNET_GETOPT_set_one, &stop_automate},
350 {'k', "keyword", "VALUE",
351 gettext_noop
352 ("add an additional keyword for the advertisment"
353 " (this option can be specified multiple times)"),
354 1, &GNUNET_FS_getopt_set_keywords, &ksk_uri},
355 {'m', "meta", "TYPE:VALUE",
356 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
357 1, &GNUNET_FS_getopt_set_metadata, &adv_metadata},
358 {'o', "only-local", NULL,
359 gettext_noop ("print names of local namespaces"),
360 0, &GNUNET_GETOPT_set_one, &print_local_only},
361 {'p', "priority", "PRIORITY",
362 gettext_noop ("use the given PRIORITY for the advertisments"),
363 1, &GNUNET_GETOPT_set_uint, &priority},
364 {'q', "quiet", NULL,
365 gettext_noop ("do not print names of remote namespaces"),
366 0, &GNUNET_GETOPT_set_one, &no_remote_printing},
367 {'r', "root", "ID",
368 gettext_noop
369 ("specify ID of the root of the namespace"),
370 1, &GNUNET_GETOPT_set_string, &root_identifier},
371 {'s', "set-rating", "ID:VALUE",
372 gettext_noop
373 ("change rating of namespace ID by VALUE"),
374 1, &GNUNET_GETOPT_set_string, &rating_change},
375 GNUNET_GETOPT_OPTION_END
376};
377
378 329
379/** 330/**
380 * The main function to inspect GNUnet directories. 331 * The main function to inspect GNUnet directories.
@@ -386,6 +337,51 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
386int 337int
387main (int argc, char *const *argv) 338main (int argc, char *const *argv)
388{ 339{
340 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
341 {'a', "anonymity", "LEVEL",
342 gettext_noop ("set the desired LEVEL of sender-anonymity"),
343 1, &GNUNET_GETOPT_set_uint, &anonymity},
344 {'A', "automate", NULL,
345 gettext_noop ("start a collection"),
346 0, &GNUNET_GETOPT_set_one, &start_automate},
347 {'C', "create", "NAME",
348 gettext_noop
349 ("create or advertise namespace NAME"),
350 1, &GNUNET_GETOPT_set_string, &create_ns},
351 {'D', "delete", "NAME",
352 gettext_noop
353 ("delete namespace NAME "),
354 1, &GNUNET_GETOPT_set_string, &delete_ns},
355 {'e', "end", NULL,
356 gettext_noop ("end current collection"),
357 0, &GNUNET_GETOPT_set_one, &stop_automate},
358 {'k', "keyword", "VALUE",
359 gettext_noop
360 ("add an additional keyword for the advertisment"
361 " (this option can be specified multiple times)"),
362 1, &GNUNET_FS_getopt_set_keywords, &ksk_uri},
363 {'m', "meta", "TYPE:VALUE",
364 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
365 1, &GNUNET_FS_getopt_set_metadata, &adv_metadata},
366 {'o', "only-local", NULL,
367 gettext_noop ("print names of local namespaces"),
368 0, &GNUNET_GETOPT_set_one, &print_local_only},
369 {'p', "priority", "PRIORITY",
370 gettext_noop ("use the given PRIORITY for the advertisments"),
371 1, &GNUNET_GETOPT_set_uint, &priority},
372 {'q', "quiet", NULL,
373 gettext_noop ("do not print names of remote namespaces"),
374 0, &GNUNET_GETOPT_set_one, &no_remote_printing},
375 {'r', "root", "ID",
376 gettext_noop
377 ("specify ID of the root of the namespace"),
378 1, &GNUNET_GETOPT_set_string, &root_identifier},
379 {'s', "set-rating", "ID:VALUE",
380 gettext_noop
381 ("change rating of namespace ID by VALUE"),
382 1, &GNUNET_GETOPT_set_string, &rating_change},
383 GNUNET_GETOPT_OPTION_END
384 };
389 return (GNUNET_OK == 385 return (GNUNET_OK ==
390 GNUNET_PROGRAM_run (argc, 386 GNUNET_PROGRAM_run (argc,
391 argv, 387 argv,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 8313c2467..18c4fd78e 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -524,7 +524,7 @@ run (void *cls,
524 &ex)) 524 &ex))
525 { 525 {
526 if (strlen (ex) > 0) 526 if (strlen (ex) > 0)
527 l = EXTRACTOR_plugin_add_config (l, ex, EXTRACTOR_OPTION_DEFAULT_POLICY); 527 plugins = EXTRACTOR_plugin_add_config (plugins, ex, EXTRACTOR_OPTION_DEFAULT_POLICY);
528 GNUNET_free (ex); 528 GNUNET_free (ex);
529 } 529 }
530 } 530 }
@@ -555,7 +555,7 @@ run (void *cls,
555 meta = GNUNET_CONTAINER_meta_data_create (); 555 meta = GNUNET_CONTAINER_meta_data_create ();
556 GNUNET_FS_meta_data_extract_from_file (meta, 556 GNUNET_FS_meta_data_extract_from_file (meta,
557 args[0], 557 args[0],
558 l); 558 plugins);
559 fi = GNUNET_FS_file_information_create_from_file (ctx, 559 fi = GNUNET_FS_file_information_create_from_file (ctx,
560 NULL, 560 NULL,
561 args[0], 561 args[0],
@@ -615,66 +615,6 @@ run (void *cls,
615} 615}
616 616
617 617
618/**
619 * gnunet-publish command line options
620 */
621static struct GNUNET_GETOPT_CommandLineOption options[] = {
622 {'a', "anonymity", "LEVEL",
623 gettext_noop ("set the desired LEVEL of sender-anonymity"),
624 1, &GNUNET_GETOPT_set_uint, &anonymity},
625 {'d', "disable-creation-time", NULL,
626 gettext_noop
627 ("disable adding the creation time to the metadata of the uploaded file"),
628 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time},
629 {'D', "disable-extractor", NULL,
630 gettext_noop
631 ("do not use libextractor to add keywords or metadata"),
632 0, &GNUNET_GETOPT_set_one, &disable_extractor},
633 {'e', "extract", NULL,
634 gettext_noop
635 ("print list of extracted keywords that would be used, but do not perform upload"),
636 0, &GNUNET_GETOPT_set_one, &extract_only},
637 {'k', "key", "KEYWORD",
638 gettext_noop
639 ("add an additional keyword for the top-level file or directory"
640 " (this option can be specified multiple times)"),
641 1, &GNUNET_FS_getopt_set_keywords, &topKeywords},
642 {'m', "meta", "TYPE:VALUE",
643 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
644 1, &GNUNET_FS_getopt_set_metadata, &meta},
645 {'n', "noindex", NULL,
646 gettext_noop ("do not index, perform full insertion (stores entire "
647 "file in encrypted form in GNUnet database)"),
648 0, &GNUNET_GETOPT_set_one, &do_insert},
649 {'N', "next", "ID",
650 gettext_noop
651 ("specify ID of an updated version to be published in the future"
652 " (for namespace insertions only)"),
653 1, &GNUNET_GETOPT_set_string, &next_id},
654 {'p', "priority", "PRIORITY",
655 gettext_noop ("specify the priority of the content"),
656 1, &GNUNET_GETOPT_set_uint, &priority},
657 {'P', "pseudonym", "NAME",
658 gettext_noop
659 ("publish the files under the pseudonym NAME (place file into namespace)"),
660 1, &GNUNET_GETOPT_set_string, &pseudonym},
661 {'s', "simulate-only", NULL,
662 gettext_noop ("only simulate the process but do not do any "
663 "actual publishing (useful to compute URIs)"),
664 0, &GNUNET_GETOPT_set_one, &do_simulate},
665 {'t', "this", "ID",
666 gettext_noop ("set the ID of this version of the publication"
667 " (for namespace insertions only)"),
668 1, &GNUNET_GETOPT_set_string, &this_id},
669 {'u', "uri", "URI",
670 gettext_noop ("URI to be published (can be used instead of passing a "
671 "file to add keywords to the file with the respective URI)"),
672 1, &GNUNET_GETOPT_set_string, &uri_string},
673 {'V', "verbose", NULL,
674 gettext_noop ("be verbose (print progress information)"),
675 0, &GNUNET_GETOPT_set_one, &verbose},
676 GNUNET_GETOPT_OPTION_END
677};
678 618
679 619
680/** 620/**
@@ -687,6 +627,63 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
687int 627int
688main (int argc, char *const *argv) 628main (int argc, char *const *argv)
689{ 629{
630 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
631 {'a', "anonymity", "LEVEL",
632 gettext_noop ("set the desired LEVEL of sender-anonymity"),
633 1, &GNUNET_GETOPT_set_uint, &anonymity},
634 {'d', "disable-creation-time", NULL,
635 gettext_noop
636 ("disable adding the creation time to the metadata of the uploaded file"),
637 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time},
638 {'D', "disable-extractor", NULL,
639 gettext_noop
640 ("do not use libextractor to add keywords or metadata"),
641 0, &GNUNET_GETOPT_set_one, &disable_extractor},
642 {'e', "extract", NULL,
643 gettext_noop
644 ("print list of extracted keywords that would be used, but do not perform upload"),
645 0, &GNUNET_GETOPT_set_one, &extract_only},
646 {'k', "key", "KEYWORD",
647 gettext_noop
648 ("add an additional keyword for the top-level file or directory"
649 " (this option can be specified multiple times)"),
650 1, &GNUNET_FS_getopt_set_keywords, &topKeywords},
651 {'m', "meta", "TYPE:VALUE",
652 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
653 1, &GNUNET_FS_getopt_set_metadata, &meta},
654 {'n', "noindex", NULL,
655 gettext_noop ("do not index, perform full insertion (stores entire "
656 "file in encrypted form in GNUnet database)"),
657 0, &GNUNET_GETOPT_set_one, &do_insert},
658 {'N', "next", "ID",
659 gettext_noop
660 ("specify ID of an updated version to be published in the future"
661 " (for namespace insertions only)"),
662 1, &GNUNET_GETOPT_set_string, &next_id},
663 {'p', "priority", "PRIORITY",
664 gettext_noop ("specify the priority of the content"),
665 1, &GNUNET_GETOPT_set_uint, &priority},
666 {'P', "pseudonym", "NAME",
667 gettext_noop
668 ("publish the files under the pseudonym NAME (place file into namespace)"),
669 1, &GNUNET_GETOPT_set_string, &pseudonym},
670 {'s', "simulate-only", NULL,
671 gettext_noop ("only simulate the process but do not do any "
672 "actual publishing (useful to compute URIs)"),
673 0, &GNUNET_GETOPT_set_one, &do_simulate},
674 {'t', "this", "ID",
675 gettext_noop ("set the ID of this version of the publication"
676 " (for namespace insertions only)"),
677 1, &GNUNET_GETOPT_set_string, &this_id},
678 {'u', "uri", "URI",
679 gettext_noop ("URI to be published (can be used instead of passing a "
680 "file to add keywords to the file with the respective URI)"),
681 1, &GNUNET_GETOPT_set_string, &uri_string},
682 {'V', "verbose", NULL,
683 gettext_noop ("be verbose (print progress information)"),
684 0, &GNUNET_GETOPT_set_one, &verbose},
685 GNUNET_GETOPT_OPTION_END
686 };
690 return (GNUNET_OK == 687 return (GNUNET_OK ==
691 GNUNET_PROGRAM_run (argc, 688 GNUNET_PROGRAM_run (argc,
692 argv, 689 argv,
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index 6123ecfef..3fbe2a27e 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -293,27 +293,6 @@ run (void *cls,
293 293
294 294
295/** 295/**
296 * gnunet-search command line options
297 */
298static struct GNUNET_GETOPT_CommandLineOption options[] = {
299 {'a', "anonymity", "LEVEL",
300 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
301 1, &GNUNET_GETOPT_set_uint, &anonymity},
302 {'n', "no-network", NULL,
303 gettext_noop ("only search the local peer (no P2P network search)"),
304 1, &GNUNET_GETOPT_set_uint, &local_only},
305 {'o', "output", "PREFIX",
306 gettext_noop
307 ("write search results to file starting with PREFIX"),
308 1, &GNUNET_GETOPT_set_string, &output_filename},
309 {'V', "verbose", NULL,
310 gettext_noop ("be verbose (print progress information)"),
311 0, &GNUNET_GETOPT_set_one, &verbose},
312 GNUNET_GETOPT_OPTION_END
313};
314
315
316/**
317 * The main function to search GNUnet. 296 * The main function to search GNUnet.
318 * 297 *
319 * @param argc number of arguments from the command line 298 * @param argc number of arguments from the command line
@@ -323,6 +302,22 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
323int 302int
324main (int argc, char *const *argv) 303main (int argc, char *const *argv)
325{ 304{
305 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
306 {'a', "anonymity", "LEVEL",
307 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
308 1, &GNUNET_GETOPT_set_uint, &anonymity},
309 {'n', "no-network", NULL,
310 gettext_noop ("only search the local peer (no P2P network search)"),
311 1, &GNUNET_GETOPT_set_uint, &local_only},
312 {'o', "output", "PREFIX",
313 gettext_noop
314 ("write search results to file starting with PREFIX"),
315 1, &GNUNET_GETOPT_set_string, &output_filename},
316 {'V', "verbose", NULL,
317 gettext_noop ("be verbose (print progress information)"),
318 0, &GNUNET_GETOPT_set_one, &verbose},
319 GNUNET_GETOPT_OPTION_END
320 };
326 return (GNUNET_OK == 321 return (GNUNET_OK ==
327 GNUNET_PROGRAM_run (argc, 322 GNUNET_PROGRAM_run (argc,
328 argv, 323 argv,
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index e934bf521..bc7a2434b 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -185,17 +185,6 @@ run (void *cls,
185 185
186 186
187/** 187/**
188 * gnunet-unindex command line options
189 */
190static struct GNUNET_GETOPT_CommandLineOption options[] = {
191 {'V', "verbose", NULL,
192 gettext_noop ("be verbose (print progress information)"),
193 0, &GNUNET_GETOPT_set_one, &verbose},
194 GNUNET_GETOPT_OPTION_END
195};
196
197
198/**
199 * The main function to unindex content. 188 * The main function to unindex content.
200 * 189 *
201 * @param argc number of arguments from the command line 190 * @param argc number of arguments from the command line
@@ -205,6 +194,12 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
205int 194int
206main (int argc, char *const *argv) 195main (int argc, char *const *argv)
207{ 196{
197 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
198 {'V', "verbose", NULL,
199 gettext_noop ("be verbose (print progress information)"),
200 0, &GNUNET_GETOPT_set_one, &verbose},
201 GNUNET_GETOPT_OPTION_END
202 };
208 return (GNUNET_OK == 203 return (GNUNET_OK ==
209 GNUNET_PROGRAM_run (argc, 204 GNUNET_PROGRAM_run (argc,
210 argv, 205 argv,