aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_dirmetascan.c
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/fs_dirmetascan.c
parentaf1de477ca46a08fd42de32c251dc1aa2c1ab18b (diff)
downloadgnunet-0f5c5a8d55e8f3df8dcb8ddff61da621b6a482af.tar.gz
gnunet-0f5c5a8d55e8f3df8dcb8ddff61da621b6a482af.zip
-renaming symbols to match naming conventions
Diffstat (limited to 'src/fs/fs_dirmetascan.c')
-rw-r--r--src/fs/fs_dirmetascan.c35
1 files changed, 21 insertions, 14 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,