-renaming symbols to match naming conventions
authorChristian Grothoff <christian@grothoff.org>
Sat, 28 Jan 2012 14:38:41 +0000 (14:38 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 28 Jan 2012 14:38:41 +0000 (14:38 +0000)
src/fs/fs_dirmetascan.c
src/fs/gnunet-publish.c
src/include/gnunet_fs_service.h

index acd5246d8e3dcd34b18eb7014848d52a6fdfff79..11313d7503f09d04ba7f91691b377572aac24799 100644 (file)
@@ -357,8 +357,8 @@ write_progress (struct AddDirContext *adc, const char *filename,
   size_t filename_len;
   ssize_t wr;
   size_t total_write;
-  if ((adc->do_stop || should_stop (adc)) && reason != GNUNET_DIR_SCANNER_ASKED_TO_STOP
-      && reason != GNUNET_DIR_SCANNER_FINISHED)
+  if ((adc->do_stop || should_stop (adc)) && reason != GNUNET_FS_DIRSCANNER_ASKED_TO_STOP
+      && reason != GNUNET_FS_DIRSCANNER_FINISHED)
     return 1;
   total_write = 0;
   wr = 1;
@@ -764,18 +764,18 @@ scan_directory (void *cls, const char *filename)
   if (0 != STAT (filename, &sbuf))
   {
     (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
-                          GNUNET_DIR_SCANNER_DOES_NOT_EXIST);
+                          GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST);
     return GNUNET_OK;
   }
 
   /* Report the progress */
   do_stop = write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
-    GNUNET_DIR_SCANNER_NEW_FILE);
+    GNUNET_FS_DIRSCANNER_NEW_FILE);
   if (do_stop)
   {
     /* We were asked to stop, acknowledge that and return */
     (void) write_progress (adc, filename, S_ISDIR (sbuf.st_mode),
-      GNUNET_DIR_SCANNER_ASKED_TO_STOP);
+      GNUNET_FS_DIRSCANNER_ASKED_TO_STOP);
     return GNUNET_SYSERR;
   }
 
@@ -891,7 +891,7 @@ run_directory_scan_thread (void *cls)
   if (adc->plugins != NULL)
     EXTRACTOR_plugin_remove_all (adc->plugins);
   /* Tell the initiator that we're finished, it can now join the thread */
-  write_progress (adc, NULL, 0, GNUNET_DIR_SCANNER_FINISHED);
+  write_progress (adc, NULL, 0, GNUNET_FS_DIRSCANNER_FINISHED);
   return 0;
 }
 
@@ -921,7 +921,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
   if (!(tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
   {
-    ds->progress_callback (ds->cls, ds, NULL, 0, GNUNET_DIR_SCANNER_SHUTDOWN);
+    ds->progress_callback (ds->cls, ds, NULL, 0, GNUNET_FS_DIRSCANNER_SHUTDOWN);
     return;
   }
 
@@ -936,11 +936,11 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       total_read += rd;
   }
   if (total_read != sizeof (reason)
-      || reason <= GNUNET_DIR_SCANNER_FIRST
-      || reason >= GNUNET_DIR_SCANNER_LAST)
+      || reason <= GNUNET_FS_DIRSCANNER_FIRST
+      || reason >= GNUNET_FS_DIRSCANNER_LAST)
   {
     end_it = 1;
-    reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR;
+    reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
   }
 
   if (!end_it)
@@ -958,7 +958,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     if (rd != sizeof (size_t))
     {
       end_it = 1;
-      reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR;
+      reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
     }
   }
   if (!end_it)
@@ -968,7 +968,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     else if (filename_len > PATH_MAX)
     {
       end_it = 1;
-      reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR;
+      reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
     }
   }
   if (!end_it)
@@ -986,7 +986,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     if (rd != filename_len)
     {
       GNUNET_free (filename);
-      reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR;
+      reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
       end_it = 1;
     }
   }
@@ -1004,7 +1004,7 @@ read_progress_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     if (rd != sizeof (char))
     {
       GNUNET_free (filename);
-      reason = GNUNET_DIR_SCANNER_PROTOCOL_ERROR;
+      reason = GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR;
       end_it = 1;
     }
   }
@@ -1048,6 +1048,9 @@ GNUNET_FS_directory_scan_start (const char *filename,
   struct GNUNET_DISK_PipeHandle *progress_pipe;
   int ok;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Starting to scan directory `%s'\n",
+             filename);
   if (0 != STAT (filename, &sbuf))
     return NULL;
 
@@ -1103,6 +1106,10 @@ GNUNET_FS_directory_scan_start (const char *filename,
   ds->progress_read = GNUNET_DISK_pipe_handle (progress_pipe,
       GNUNET_DISK_PIPE_END_READ);
 
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Creating thread to scan directory `%s'\n",
+             filename);
+
 #if WINDOWS
   ds->thread = CreateThread (NULL, 0,
       (LPTHREAD_START_ROUTINE) &run_directory_scan_thread, (LPVOID) adc,
index ae5424bed5bf233ad6fb19cb0b86abf3d816a29d..1c02004dc421337864e703afccb093ddab437d5c 100644 (file)
@@ -432,7 +432,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
 {
   switch (reason)
   {
-    case GNUNET_DIR_SCANNER_NEW_FILE:
+    case GNUNET_FS_DIRSCANNER_NEW_FILE:
       if (filename != NULL)
       {
         if (is_directory)
@@ -441,7 +441,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
           FPRINTF (stdout, _("Scanning file `%s'.\n"), filename);
       }
       break;
-    case GNUNET_DIR_SCANNER_DOES_NOT_EXIST:
+    case GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST:
       if (filename != NULL)
       {
         FPRINTF (stdout, 
@@ -449,7 +449,7 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
             filename);
       }
       break;
-    case GNUNET_DIR_SCANNER_ASKED_TO_STOP:
+    case GNUNET_FS_DIRSCANNER_ASKED_TO_STOP:
       if (filename != NULL)
       {
         FPRINTF (stdout, 
@@ -459,13 +459,13 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
       else
         FPRINTF (stdout, "%s", _("Scanner is stopping.\n"));
       break;
-    case GNUNET_DIR_SCANNER_SHUTDOWN:
+    case GNUNET_FS_DIRSCANNER_SHUTDOWN:
       FPRINTF (stdout, "%s", _("Client is shutting down.\n"));
       break;
-    case GNUNET_DIR_SCANNER_FINISHED:
+    case GNUNET_FS_DIRSCANNER_FINISHED:
       FPRINTF (stdout, "%s", _("Scanner has finished.\n"));
       break;
-    case GNUNET_DIR_SCANNER_PROTOCOL_ERROR:
+    case GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR:
       FPRINTF (stdout, "%s", 
           _("There was a failure communicating with the scanner.\n"));
       break;
@@ -474,9 +474,9 @@ directory_scan_cb (void *cls, struct GNUNET_FS_DirScanner *ds,
           filename);
       break;
   }
-  if ((filename == NULL && GNUNET_DIR_SCANNER_FINISHED)
-      || reason == GNUNET_DIR_SCANNER_PROTOCOL_ERROR
-      || reason == GNUNET_DIR_SCANNER_SHUTDOWN)
+  if ((filename == NULL && GNUNET_FS_DIRSCANNER_FINISHED)
+      || reason == GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR
+      || reason == GNUNET_FS_DIRSCANNER_SHUTDOWN)
   {
     /* Any of this causes us to try to clean up the scanner */
     directory_scan_intermediary_result = GNUNET_FS_directory_scan_cleanup (ds);
index 48fef170b1841824e7cf9b7bffd5de2bbd3b10a1..1584f283cf271c34701fb395ce4e955f1a9a8a46 100644 (file)
@@ -2694,14 +2694,14 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
 
 enum GNUNET_FS_DirScannerProgressUpdateReason
 {
-  GNUNET_DIR_SCANNER_FIRST = 0,
-  GNUNET_DIR_SCANNER_NEW_FILE = 1,
-  GNUNET_DIR_SCANNER_DOES_NOT_EXIST = 2,
-  GNUNET_DIR_SCANNER_ASKED_TO_STOP = 3,
-  GNUNET_DIR_SCANNER_FINISHED = 4,
-  GNUNET_DIR_SCANNER_PROTOCOL_ERROR = 5,
-  GNUNET_DIR_SCANNER_SHUTDOWN = 6,
-  GNUNET_DIR_SCANNER_LAST = 7
+  GNUNET_FS_DIRSCANNER_FIRST = 0,
+  GNUNET_FS_DIRSCANNER_NEW_FILE = 1,
+  GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST = 2,
+  GNUNET_FS_DIRSCANNER_ASKED_TO_STOP = 3,
+  GNUNET_FS_DIRSCANNER_FINISHED = 4,
+  GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR = 5,
+  GNUNET_FS_DIRSCANNER_SHUTDOWN = 6,
+  GNUNET_FS_DIRSCANNER_LAST = 7
 };