aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-unindex.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/fs/gnunet-unindex.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/fs/gnunet-unindex.c')
-rw-r--r--src/fs/gnunet-unindex.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index a4aad4568..d52956a75 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -86,16 +86,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
86 if (verbose) 86 if (verbose)
87 { 87 {
88 s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta); 88 s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta);
89 fprintf (stdout, 89 fprintf (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"),
90 _("Unindexing at %llu/%llu (%s remaining)\n"),
91 (unsigned long long) info->value.unindex.completed, 90 (unsigned long long) info->value.unindex.completed,
92 (unsigned long long) info->value.unindex.size, s); 91 (unsigned long long) info->value.unindex.size, s);
93 GNUNET_free (s); 92 GNUNET_free (s);
94 } 93 }
95 break; 94 break;
96 case GNUNET_FS_STATUS_UNINDEX_ERROR: 95 case GNUNET_FS_STATUS_UNINDEX_ERROR:
97 fprintf (stderr, 96 fprintf (stderr, _("Error unindexing: %s.\n"),
98 _("Error unindexing: %s.\n"),
99 info->value.unindex.specifics.error.message); 97 info->value.unindex.specifics.error.message);
100 GNUNET_SCHEDULER_shutdown (); 98 GNUNET_SCHEDULER_shutdown ();
101 break; 99 break;
@@ -104,8 +102,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
104 GNUNET_SCHEDULER_shutdown (); 102 GNUNET_SCHEDULER_shutdown ();
105 break; 103 break;
106 case GNUNET_FS_STATUS_UNINDEX_STOPPED: 104 case GNUNET_FS_STATUS_UNINDEX_STOPPED:
107 GNUNET_SCHEDULER_add_continuation (&cleanup_task, 105 GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL,
108 NULL,
109 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 106 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
110 break; 107 break;
111 default: 108 default:
@@ -125,9 +122,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
125 * @param c configuration 122 * @param c configuration
126 */ 123 */
127static void 124static void
128run (void *cls, 125run (void *cls, char *const *args, const char *cfgfile,
129 char *const *args, 126 const struct GNUNET_CONFIGURATION_Handle *c)
130 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
131{ 127{
132 /* check arguments */ 128 /* check arguments */
133 if ((args[0] == NULL) || (args[1] != NULL)) 129 if ((args[0] == NULL) || (args[1] != NULL))
@@ -137,10 +133,9 @@ run (void *cls,
137 return; 133 return;
138 } 134 }
139 cfg = c; 135 cfg = c;
140 ctx = GNUNET_FS_start (cfg, 136 ctx =
141 "gnunet-unindex", 137 GNUNET_FS_start (cfg, "gnunet-unindex", &progress_cb, NULL,
142 &progress_cb, 138 GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
143 NULL, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
144 if (NULL == ctx) 139 if (NULL == ctx)
145 { 140 {
146 fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); 141 fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
@@ -154,8 +149,8 @@ run (void *cls,
154 GNUNET_FS_stop (ctx); 149 GNUNET_FS_stop (ctx);
155 return; 150 return;
156 } 151 }
157 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 152 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
158 &shutdown_task, NULL); 153 NULL);
159} 154}
160 155
161 156
@@ -176,9 +171,7 @@ main (int argc, char *const *argv)
176 GNUNET_GETOPT_OPTION_END 171 GNUNET_GETOPT_OPTION_END
177 }; 172 };
178 return (GNUNET_OK == 173 return (GNUNET_OK ==
179 GNUNET_PROGRAM_run (argc, 174 GNUNET_PROGRAM_run (argc, argv, "gnunet-unindex [OPTIONS] FILENAME",
180 argv,
181 "gnunet-unindex [OPTIONS] FILENAME",
182 gettext_noop 175 gettext_noop
183 ("Unindex a file that was previously indexed with gnunet-publish."), 176 ("Unindex a file that was previously indexed with gnunet-publish."),
184 options, &run, NULL)) ? ret : 1; 177 options, &run, NULL)) ? ret : 1;