diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/fs/fs_dirmetascan.c | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/fs/fs_dirmetascan.c')
-rw-r--r-- | src/fs/fs_dirmetascan.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index d1b6d1c39..1df07a01c 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c | |||
@@ -53,13 +53,13 @@ struct GNUNET_FS_DirScanner | |||
53 | * Second argument to helper process. | 53 | * Second argument to helper process. |
54 | */ | 54 | */ |
55 | char *ex_arg; | 55 | char *ex_arg; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * The function that will be called every time there's a progress | 58 | * The function that will be called every time there's a progress |
59 | * message. | 59 | * message. |
60 | */ | 60 | */ |
61 | GNUNET_FS_DirScannerProgressCallback progress_callback; | 61 | GNUNET_FS_DirScannerProgressCallback progress_callback; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * A closure for progress_callback. | 64 | * A closure for progress_callback. |
65 | */ | 65 | */ |
@@ -68,7 +68,7 @@ struct GNUNET_FS_DirScanner | |||
68 | /** | 68 | /** |
69 | * After the scan is finished, it will contain a pointer to the | 69 | * After the scan is finished, it will contain a pointer to the |
70 | * top-level directory entry in the directory tree built by the | 70 | * top-level directory entry in the directory tree built by the |
71 | * scanner. | 71 | * scanner. |
72 | */ | 72 | */ |
73 | struct GNUNET_FS_ShareTreeItem *toplevel; | 73 | struct GNUNET_FS_ShareTreeItem *toplevel; |
74 | 74 | ||
@@ -103,7 +103,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds) | |||
103 | /* terminate helper */ | 103 | /* terminate helper */ |
104 | if (NULL != ds->helper) | 104 | if (NULL != ds->helper) |
105 | GNUNET_HELPER_stop (ds->helper, GNUNET_NO); | 105 | GNUNET_HELPER_stop (ds->helper, GNUNET_NO); |
106 | 106 | ||
107 | /* free resources */ | 107 | /* free resources */ |
108 | if (NULL != ds->toplevel) | 108 | if (NULL != ds->toplevel) |
109 | GNUNET_FS_share_tree_free (ds->toplevel); | 109 | GNUNET_FS_share_tree_free (ds->toplevel); |
@@ -132,7 +132,7 @@ GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds) | |||
132 | GNUNET_assert (NULL == ds->helper); | 132 | GNUNET_assert (NULL == ds->helper); |
133 | /* preserve result */ | 133 | /* preserve result */ |
134 | result = ds->toplevel; | 134 | result = ds->toplevel; |
135 | ds->toplevel = NULL; | 135 | ds->toplevel = NULL; |
136 | GNUNET_FS_directory_scan_abort (ds); | 136 | GNUNET_FS_directory_scan_abort (ds); |
137 | return result; | 137 | return result; |
138 | } | 138 | } |
@@ -149,7 +149,7 @@ static struct GNUNET_FS_ShareTreeItem * | |||
149 | advance (struct GNUNET_FS_ShareTreeItem *pos) | 149 | advance (struct GNUNET_FS_ShareTreeItem *pos) |
150 | { | 150 | { |
151 | int moved; | 151 | int moved; |
152 | 152 | ||
153 | GNUNET_assert (NULL != pos); | 153 | GNUNET_assert (NULL != pos); |
154 | moved = 0; /* must not terminate, even on file, otherwise "normal" */ | 154 | moved = 0; /* must not terminate, even on file, otherwise "normal" */ |
155 | while ( (pos->is_directory == GNUNET_YES) || | 155 | while ( (pos->is_directory == GNUNET_YES) || |
@@ -214,7 +214,7 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent, | |||
214 | if (NULL != parent) | 214 | if (NULL != parent) |
215 | GNUNET_CONTAINER_DLL_insert (parent->children_head, | 215 | GNUNET_CONTAINER_DLL_insert (parent->children_head, |
216 | parent->children_tail, | 216 | parent->children_tail, |
217 | chld); | 217 | chld); |
218 | return chld; | 218 | return chld; |
219 | } | 219 | } |
220 | 220 | ||
@@ -237,9 +237,9 @@ finish_scan (void *cls, | |||
237 | GNUNET_HELPER_stop (ds->helper, GNUNET_NO); | 237 | GNUNET_HELPER_stop (ds->helper, GNUNET_NO); |
238 | ds->helper = NULL; | 238 | ds->helper = NULL; |
239 | } | 239 | } |
240 | ds->progress_callback (ds->progress_callback_cls, | 240 | ds->progress_callback (ds->progress_callback_cls, |
241 | NULL, GNUNET_SYSERR, | 241 | NULL, GNUNET_SYSERR, |
242 | GNUNET_FS_DIRSCANNER_FINISHED); | 242 | GNUNET_FS_DIRSCANNER_FINISHED); |
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
@@ -252,7 +252,7 @@ finish_scan (void *cls, | |||
252 | * @param msg message from the helper process | 252 | * @param msg message from the helper process |
253 | */ | 253 | */ |
254 | static int | 254 | static int |
255 | process_helper_msgs (void *cls, | 255 | process_helper_msgs (void *cls, |
256 | void *client, | 256 | void *client, |
257 | const struct GNUNET_MessageHeader *msg) | 257 | const struct GNUNET_MessageHeader *msg) |
258 | { | 258 | { |
@@ -275,7 +275,7 @@ process_helper_msgs (void *cls, | |||
275 | GNUNET_break (0); | 275 | GNUNET_break (0); |
276 | break; | 276 | break; |
277 | } | 277 | } |
278 | ds->progress_callback (ds->progress_callback_cls, | 278 | ds->progress_callback (ds->progress_callback_cls, |
279 | filename, GNUNET_NO, | 279 | filename, GNUNET_NO, |
280 | GNUNET_FS_DIRSCANNER_FILE_START); | 280 | GNUNET_FS_DIRSCANNER_FILE_START); |
281 | if (NULL == ds->toplevel) | 281 | if (NULL == ds->toplevel) |
@@ -301,7 +301,7 @@ process_helper_msgs (void *cls, | |||
301 | ds->pos = ds->pos->parent; | 301 | ds->pos = ds->pos->parent; |
302 | return GNUNET_OK; | 302 | return GNUNET_OK; |
303 | } | 303 | } |
304 | ds->progress_callback (ds->progress_callback_cls, | 304 | ds->progress_callback (ds->progress_callback_cls, |
305 | filename, GNUNET_YES, | 305 | filename, GNUNET_YES, |
306 | GNUNET_FS_DIRSCANNER_FILE_START); | 306 | GNUNET_FS_DIRSCANNER_FILE_START); |
307 | ds->pos = expand_tree (ds->pos, | 307 | ds->pos = expand_tree (ds->pos, |
@@ -314,7 +314,7 @@ process_helper_msgs (void *cls, | |||
314 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE: | 314 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE: |
315 | if ('\0' != filename[left-1]) | 315 | if ('\0' != filename[left-1]) |
316 | break; | 316 | break; |
317 | ds->progress_callback (ds->progress_callback_cls, | 317 | ds->progress_callback (ds->progress_callback_cls, |
318 | filename, GNUNET_SYSERR, | 318 | filename, GNUNET_SYSERR, |
319 | GNUNET_FS_DIRSCANNER_FILE_IGNORED); | 319 | GNUNET_FS_DIRSCANNER_FILE_IGNORED); |
320 | return GNUNET_OK; | 320 | return GNUNET_OK; |
@@ -329,7 +329,7 @@ process_helper_msgs (void *cls, | |||
329 | GNUNET_break (0); | 329 | GNUNET_break (0); |
330 | break; | 330 | break; |
331 | } | 331 | } |
332 | ds->progress_callback (ds->progress_callback_cls, | 332 | ds->progress_callback (ds->progress_callback_cls, |
333 | NULL, GNUNET_SYSERR, | 333 | NULL, GNUNET_SYSERR, |
334 | GNUNET_FS_DIRSCANNER_ALL_COUNTED); | 334 | GNUNET_FS_DIRSCANNER_ALL_COUNTED); |
335 | ds->pos = ds->toplevel; | 335 | ds->pos = ds->toplevel; |
@@ -340,7 +340,7 @@ process_helper_msgs (void *cls, | |||
340 | { | 340 | { |
341 | size_t nlen; | 341 | size_t nlen; |
342 | const char *end; | 342 | const char *end; |
343 | 343 | ||
344 | if (NULL == ds->pos) | 344 | if (NULL == ds->pos) |
345 | { | 345 | { |
346 | GNUNET_break (0); | 346 | GNUNET_break (0); |
@@ -361,7 +361,7 @@ process_helper_msgs (void *cls, | |||
361 | GNUNET_break (0); | 361 | GNUNET_break (0); |
362 | break; | 362 | break; |
363 | } | 363 | } |
364 | ds->progress_callback (ds->progress_callback_cls, | 364 | ds->progress_callback (ds->progress_callback_cls, |
365 | filename, GNUNET_YES, | 365 | filename, GNUNET_YES, |
366 | GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); | 366 | GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED); |
367 | if (0 < left) | 367 | if (0 < left) |
@@ -373,18 +373,18 @@ process_helper_msgs (void *cls, | |||
373 | break; | 373 | break; |
374 | } | 374 | } |
375 | /* having full filenames is too dangerous; always make sure we clean them up */ | 375 | /* having full filenames is too dangerous; always make sure we clean them up */ |
376 | GNUNET_CONTAINER_meta_data_delete (ds->pos->meta, | 376 | GNUNET_CONTAINER_meta_data_delete (ds->pos->meta, |
377 | EXTRACTOR_METATYPE_FILENAME, | 377 | EXTRACTOR_METATYPE_FILENAME, |
378 | NULL, 0); | 378 | NULL, 0); |
379 | /* instead, put in our 'safer' original filename */ | 379 | /* instead, put in our 'safer' original filename */ |
380 | GNUNET_CONTAINER_meta_data_insert (ds->pos->meta, "<libgnunetfs>", | 380 | GNUNET_CONTAINER_meta_data_insert (ds->pos->meta, "<libgnunetfs>", |
381 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 381 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
382 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", | 382 | EXTRACTOR_METAFORMAT_UTF8, "text/plain", |
383 | ds->pos->short_filename, | 383 | ds->pos->short_filename, |
384 | strlen (ds->pos->short_filename) + 1); | 384 | strlen (ds->pos->short_filename) + 1); |
385 | } | 385 | } |
386 | ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta); | 386 | ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta); |
387 | ds->pos = advance (ds->pos); | 387 | ds->pos = advance (ds->pos); |
388 | return GNUNET_OK; | 388 | return GNUNET_OK; |
389 | } | 389 | } |
390 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED: | 390 | case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED: |
@@ -397,7 +397,7 @@ process_helper_msgs (void *cls, | |||
397 | { | 397 | { |
398 | GNUNET_break (0); | 398 | GNUNET_break (0); |
399 | break; | 399 | break; |
400 | } | 400 | } |
401 | if (NULL == ds->toplevel) | 401 | if (NULL == ds->toplevel) |
402 | { | 402 | { |
403 | GNUNET_break (0); | 403 | GNUNET_break (0); |
@@ -410,7 +410,7 @@ process_helper_msgs (void *cls, | |||
410 | GNUNET_break (0); | 410 | GNUNET_break (0); |
411 | break; | 411 | break; |
412 | } | 412 | } |
413 | ds->progress_callback (ds->progress_callback_cls, | 413 | ds->progress_callback (ds->progress_callback_cls, |
414 | NULL, GNUNET_SYSERR, | 414 | NULL, GNUNET_SYSERR, |
415 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); | 415 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); |
416 | return GNUNET_OK; | 416 | return GNUNET_OK; |
@@ -430,9 +430,9 @@ helper_died_cb (void *cls) | |||
430 | ds->helper = NULL; | 430 | ds->helper = NULL; |
431 | if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) | 431 | if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) |
432 | return; /* normal death, was finished */ | 432 | return; /* normal death, was finished */ |
433 | ds->progress_callback (ds->progress_callback_cls, | 433 | ds->progress_callback (ds->progress_callback_cls, |
434 | NULL, GNUNET_SYSERR, | 434 | NULL, GNUNET_SYSERR, |
435 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); | 435 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR); |
436 | } | 436 | } |
437 | 437 | ||
438 | 438 | ||
@@ -449,7 +449,7 @@ helper_died_cb (void *cls) | |||
449 | struct GNUNET_FS_DirScanner * | 449 | struct GNUNET_FS_DirScanner * |
450 | GNUNET_FS_directory_scan_start (const char *filename, | 450 | GNUNET_FS_directory_scan_start (const char *filename, |
451 | int disable_extractor, const char *ex, | 451 | int disable_extractor, const char *ex, |
452 | GNUNET_FS_DirScannerProgressCallback cb, | 452 | GNUNET_FS_DirScannerProgressCallback cb, |
453 | void *cb_cls) | 453 | void *cb_cls) |
454 | { | 454 | { |
455 | struct stat sbuf; | 455 | struct stat sbuf; |
@@ -468,9 +468,9 @@ GNUNET_FS_directory_scan_start (const char *filename, | |||
468 | ds->progress_callback = cb; | 468 | ds->progress_callback = cb; |
469 | ds->progress_callback_cls = cb_cls; | 469 | ds->progress_callback_cls = cb_cls; |
470 | ds->filename_expanded = filename_expanded; | 470 | ds->filename_expanded = filename_expanded; |
471 | if (disable_extractor) | 471 | if (disable_extractor) |
472 | ds->ex_arg = GNUNET_strdup ("-"); | 472 | ds->ex_arg = GNUNET_strdup ("-"); |
473 | else | 473 | else |
474 | ds->ex_arg = (NULL != ex) ? GNUNET_strdup (ex) : NULL; | 474 | ds->ex_arg = (NULL != ex) ? GNUNET_strdup (ex) : NULL; |
475 | ds->args[0] = "gnunet-helper-fs-publish"; | 475 | ds->args[0] = "gnunet-helper-fs-publish"; |
476 | ds->args[1] = ds->filename_expanded; | 476 | ds->args[1] = ds->filename_expanded; |