aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-28 14:38:41 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-28 14:38:41 +0000
commit0f5c5a8d55e8f3df8dcb8ddff61da621b6a482af (patch)
tree37dc963217ce7df2e8207e517289cee47ce0bc73 /src/fs
parentaf1de477ca46a08fd42de32c251dc1aa2c1ab18b (diff)
downloadgnunet-0f5c5a8d55e8f3df8dcb8ddff61da621b6a482af.tar.gz
gnunet-0f5c5a8d55e8f3df8dcb8ddff61da621b6a482af.zip
-renaming symbols to match naming conventions
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_dirmetascan.c35
-rw-r--r--src/fs/gnunet-publish.c18
2 files changed, 30 insertions, 23 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index acd5246d8..11313d750 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -357,8 +357,8 @@ write_progress (struct AddDirContext *adc, const char *filename,
357 size_t filename_len; 357 size_t filename_len;
358 ssize_t wr; 358 ssize_t wr;
359 size_t total_write; 359 size_t total_write;
360 if ((adc->do_stop || should_stop (adc)) && reason != GNUNET_DIR_SCANNER_ASKED_TO_STOP 360 if ((adc->do_stop || should_stop (adc)) && reason != GNUNET_FS_DIRSCANNER_ASKED_TO_STOP
361 && reason != GNUNET_DIR_SCANNER_FINISHED) 361 && reason != GNUNET_FS_DIRSCANNER_FINISHED)
362 return 1; 362 return 1;
363 total_write = 0; 363 total_write = 0;
364 wr = 1; 364 wr = 1;
@@ -764,18 +764,18 @@ scan_directory (void *cls, const char *filename)
764 if (0 != STAT (filename, &sbuf)) 764 if (0 != STAT (filename, &sbuf))
765 { 765 {
766 (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode), 766 (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
767 GNUNET_DIR_SCANNER_DOES_NOT_EXIST); 767 GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST);
768 return GNUNET_OK; 768 return GNUNET_OK;
769 } 769 }
770 770
771 /* Report the progress */ 771 /* Report the progress */
772 do_stop = write_progress (adc, filename, S_ISDIR (sbuf.st_mode), 772 do_stop = write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
773 GNUNET_DIR_SCANNER_NEW_FILE); 773 GNUNET_FS_DIRSCANNER_NEW_FILE);
774 if (do_stop) 774 if (do_stop)
775 { 775 {
776 /* We were asked to stop, acknowledge that and return */ 776 /* We were asked to stop, acknowledge that and return */
777 (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode), 777 (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
778 GNUNET_DIR_SCANNER_ASKED_TO_STOP); 778 GNUNET_FS_DIRSCANNER_ASKED_TO_STOP);
779 return GNUNET_SYSERR; 779 return GNUNET_SYSERR;
780 } 780 }
781 781
@@ -891,7 +891,7 @@ run_directory_scan_thread (void *cls)
891 if (adc->plugins != NULL) 891 if (adc->plugins != NULL)
892 EXTRACTOR_plugin_remove_all (adc->plugins); 892 EXTRACTOR_plugin_remove_all (adc->plugins);
893 /* Tell the initiator that we're finished, it can now join the thread */ 893 /* Tell the initiator that we're finished, it can now join the thread */
894 write_progress (adc, NULL, 0, GNUNET_DIR_SCANNER_FINISHED); 894 write_progress (adc, NULL, 0, GNUNET_FS_DIRSCANNER_FINISHED);
895 return 0; 895 return 0;
896} 896}
897 897
@@ -921,7 +921,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
921 921
922 if (!(tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 922 if (!(tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
923 { 923 {
924 ds->progress_callback (ds->cls, ds, NULL, 0, GNUNET_DIR_SCANNER_SHUTDOWN); 924 ds->progress_callback (ds->cls, ds, NULL, 0, GNUNET_FS_DIRSCANNER_SHUTDOWN);
925 return; 925 return;
926 } 926 }
927 927
@@ -936,11 +936,11 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
936 total_read += rd; 936 total_read += rd;
937 } 937 }
938 if (total_read != sizeof (reason) 938 if (total_read != sizeof (reason)
939 || reason <= GNUNET_DIR_SCANNER_FIRST 939 || reason <= GNUNET_FS_DIRSCANNER_FIRST
940 || reason >= GNUNET_DIR_SCANNER_LAST) 940 || reason >= GNUNET_FS_DIRSCANNER_LAST)
941 { 941 {
942 end_it = 1; 942 end_it = 1;
943 reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR; 943 reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
944 } 944 }
945 945
946 if (!end_it) 946 if (!end_it)
@@ -958,7 +958,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
958 if (rd != sizeof (size_t)) 958 if (rd != sizeof (size_t))
959 { 959 {
960 end_it = 1; 960 end_it = 1;
961 reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR; 961 reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
962 } 962 }
963 } 963 }
964 if (!end_it) 964 if (!end_it)
@@ -968,7 +968,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
968 else if (filename_len > PATH_MAX) 968 else if (filename_len > PATH_MAX)
969 { 969 {
970 end_it = 1; 970 end_it = 1;
971 reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR; 971 reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
972 } 972 }
973 } 973 }
974 if (!end_it) 974 if (!end_it)
@@ -986,7 +986,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
986 if (rd != filename_len) 986 if (rd != filename_len)
987 { 987 {
988 GNUNET_free (filename); 988 GNUNET_free (filename);
989 reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR; 989 reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
990 end_it = 1; 990 end_it = 1;
991 } 991 }
992 } 992 }
@@ -1004,7 +1004,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1004 if (rd != sizeof (char)) 1004 if (rd != sizeof (char))
1005 { 1005 {
1006 GNUNET_free (filename); 1006 GNUNET_free (filename);
1007 reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR; 1007 reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
1008 end_it = 1; 1008 end_it = 1;
1009 } 1009 }
1010 } 1010 }
@@ -1048,6 +1048,9 @@ GNUNET_FS_directory_scan_start (const char *filename,
1048 struct GNUNET_DISK_PipeHandle *progress_pipe; 1048 struct GNUNET_DISK_PipeHandle *progress_pipe;
1049 int ok; 1049 int ok;
1050 1050
1051 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1052 "Starting to scan directory `%s'\n",
1053 filename);
1051 if (0 != STAT (filename, &sbuf)) 1054 if (0 != STAT (filename, &sbuf))
1052 return NULL; 1055 return NULL;
1053 1056
@@ -1103,6 +1106,10 @@ GNUNET_FS_directory_scan_start (const char *filename,
1103 ds->progress_read = GNUNET_DISK_pipe_handle (progress_pipe, 1106 ds->progress_read = GNUNET_DISK_pipe_handle (progress_pipe,
1104 GNUNET_DISK_PIPE_END_READ); 1107 GNUNET_DISK_PIPE_END_READ);
1105 1108
1109 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1110 "Creating thread to scan directory `%s'\n",
1111 filename);
1112
1106#if WINDOWS 1113#if WINDOWS
1107 ds->thread = CreateThread (NULL, 0, 1114 ds->thread = CreateThread (NULL, 0,
1108 (LPTHREAD_START_ROUTINE) &run_directory_scan_thread, (LPVOID) adc, 1115 (LPTHREAD_START_ROUTINE) &run_directory_scan_thread, (LPVOID) adc,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index ae5424bed..1c02004dc 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -432,7 +432,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
432{ 432{
433 switch (reason) 433 switch (reason)
434 { 434 {
435 case GNUNET_DIR_SCANNER_NEW_FILE: 435 case GNUNET_FS_DIRSCANNER_NEW_FILE:
436 if (filename != NULL) 436 if (filename != NULL)
437 { 437 {
438 if (is_directory) 438 if (is_directory)
@@ -441,7 +441,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
441 FPRINTF (stdout, _("Scanning file `%s'.\n"), filename); 441 FPRINTF (stdout, _("Scanning file `%s'.\n"), filename);
442 } 442 }
443 break; 443 break;
444 case GNUNET_DIR_SCANNER_DOES_NOT_EXIST: 444 case GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST:
445 if (filename != NULL) 445 if (filename != NULL)
446 { 446 {
447 FPRINTF (stdout, 447 FPRINTF (stdout,
@@ -449,7 +449,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
449 filename); 449 filename);
450 } 450 }
451 break; 451 break;
452 case GNUNET_DIR_SCANNER_ASKED_TO_STOP: 452 case GNUNET_FS_DIRSCANNER_ASKED_TO_STOP:
453 if (filename != NULL) 453 if (filename != NULL)
454 { 454 {
455 FPRINTF (stdout, 455 FPRINTF (stdout,
@@ -459,13 +459,13 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
459 else 459 else
460 FPRINTF (stdout, "%s", _("Scanner is stopping.\n")); 460 FPRINTF (stdout, "%s", _("Scanner is stopping.\n"));
461 break; 461 break;
462 case GNUNET_DIR_SCANNER_SHUTDOWN: 462 case GNUNET_FS_DIRSCANNER_SHUTDOWN:
463 FPRINTF (stdout, "%s", _("Client is shutting down.\n")); 463 FPRINTF (stdout, "%s", _("Client is shutting down.\n"));
464 break; 464 break;
465 case GNUNET_DIR_SCANNER_FINISHED: 465 case GNUNET_FS_DIRSCANNER_FINISHED:
466 FPRINTF (stdout, "%s", _("Scanner has finished.\n")); 466 FPRINTF (stdout, "%s", _("Scanner has finished.\n"));
467 break; 467 break;
468 case GNUNET_DIR_SCANNER_PROTOCOL_ERROR: 468 case GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR:
469 FPRINTF (stdout, "%s", 469 FPRINTF (stdout, "%s",
470 _("There was a failure communicating with the scanner.\n")); 470 _("There was a failure communicating with the scanner.\n"));
471 break; 471 break;
@@ -474,9 +474,9 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
474 filename); 474 filename);
475 break; 475 break;
476 } 476 }
477 if ((filename == NULL && GNUNET_DIR_SCANNER_FINISHED) 477 if ((filename == NULL && GNUNET_FS_DIRSCANNER_FINISHED)
478 || reason == GNUNET_DIR_SCANNER_PROTOCOL_ERROR 478 || reason == GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR
479 || reason == GNUNET_DIR_SCANNER_SHUTDOWN) 479 || reason == GNUNET_FS_DIRSCANNER_SHUTDOWN)
480 { 480 {
481 /* Any of this causes us to try to clean up the scanner */ 481 /* Any of this causes us to try to clean up the scanner */
482 directory_scan_intermediary_result = GNUNET_FS_directory_scan_cleanup (ds); 482 directory_scan_intermediary_result = GNUNET_FS_directory_scan_cleanup (ds);