gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6804 - in GNUnet/src: applications/fs/ecrs applications/fs


From: gnunet
Subject: [GNUnet-SVN] r6804 - in GNUnet/src: applications/fs/ecrs applications/fs/fsui applications/fs/gap applications/fs/lib applications/stats applications/testing include util/os
Date: Mon, 12 May 2008 05:49:24 -0600 (MDT)

Author: grothoff
Date: 2008-05-12 05:48:55 -0600 (Mon, 12 May 2008)
New Revision: 6804

Modified:
   GNUnet/src/applications/fs/ecrs/download.c
   GNUnet/src/applications/fs/ecrs/helper.c
   GNUnet/src/applications/fs/ecrs/metatest.c
   GNUnet/src/applications/fs/ecrs/search.c
   GNUnet/src/applications/fs/fsui/basic_fsui_test.c
   GNUnet/src/applications/fs/fsui/deserialize.c
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/download_persistence_test.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsui_start_stop_test.c
   GNUnet/src/applications/fs/fsui/recursive_download_persistence_test.c
   GNUnet/src/applications/fs/fsui/recursive_download_test.c
   GNUnet/src/applications/fs/fsui/search.c
   GNUnet/src/applications/fs/fsui/search_linked_download_persistence_test.c
   GNUnet/src/applications/fs/fsui/search_pause_resume_persistence_test.c
   GNUnet/src/applications/fs/fsui/search_ranking_test.c
   GNUnet/src/applications/fs/fsui/serialize.c
   GNUnet/src/applications/fs/fsui/upload_unindex_persistence_test.c
   GNUnet/src/applications/fs/gap/gap.c
   GNUnet/src/applications/fs/lib/fslib.c
   GNUnet/src/applications/stats/statistics.c
   GNUnet/src/applications/testing/remote.c
   GNUnet/src/applications/testing/remote.h
   GNUnet/src/applications/testing/remotetopologies.c
   GNUnet/src/include/gnunet_ecrs_lib.h
   GNUnet/src/include/gnunet_fsui_lib.h
   GNUnet/src/util/os/osconfig.c
Log:
formatting

Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c  2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/ecrs/download.c  2008-05-12 11:48:55 UTC (rev 
6804)
@@ -573,7 +573,7 @@
   char *data;
 
   if (rm->abortFlag != GNUNET_NO)
-    return GNUNET_SYSERR;    
+    return GNUNET_SYSERR;
   GNUNET_GE_ASSERT (ectx,
                     0 == memcmp (query, &node->chk.query,
                                  sizeof (GNUNET_HashCode)));

Modified: GNUnet/src/applications/fs/ecrs/helper.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/helper.c    2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/ecrs/helper.c    2008-05-12 11:48:55 UTC (rev 
6804)
@@ -40,9 +40,9 @@
  * double quotes can not be used in the actual keywords (for
  * example, the string '""foo bar""' will be turned into two
  * "OR"ed keywords 'foo' and 'bar', not into '"foo bar"'.
- * 
+ *
  * @return an ECRS URI for the given keywords, NULL
- *  if keywords is not legal (i.e. empty). 
+ *  if keywords is not legal (i.e. empty).
  */
 struct GNUNET_ECRS_URI *
 GNUNET_ECRS_keyword_string_to_uri (struct GNUNET_GE_Context *ectx,
@@ -130,7 +130,7 @@
 /**
  * Create an ECRS URI from a user-supplied command line of keywords.
  * Arguments should start with "+" to indicate mandatory
- * keywords.  
+ * keywords.
  *
  * @param argc number of keywords
  * @param argv keywords (double quotes are not required for

Modified: GNUnet/src/applications/fs/ecrs/metatest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/metatest.c  2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/ecrs/metatest.c  2008-05-12 11:48:55 UTC (rev 
6804)
@@ -164,10 +164,10 @@
   m = GNUNET_ECRS_meta_data_create ();
   if (GNUNET_OK !=
       GNUNET_ECRS_meta_data_insert (m, EXTRACTOR_UNKNOWN, "link"))
-    ABORT (m);    
+    ABORT (m);
   if (GNUNET_OK !=
       GNUNET_ECRS_meta_data_insert (m, EXTRACTOR_FILENAME, "lib-link.m4"))
-    ABORT (m);    
+    ABORT (m);
   size =
     GNUNET_ECRS_meta_data_get_serialized_size (m, GNUNET_ECRS_SERIALIZE_FULL);
   val = GNUNET_malloc (size);

Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c    2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/ecrs/search.c    2008-05-12 11:48:55 UTC (rev 
6804)
@@ -179,7 +179,7 @@
         for (i = 0; i < uri->data.ksk.keywordCount; i++)
           {
             keyword = uri->data.ksk.keywords[i];
-            /* first character of the keyword is 
+            /* first character of the keyword is
                "+" or " " to indicate mandatory or
                not -- ignore for hashing! */
             GNUNET_hash (&keyword[1], strlen (&keyword[1]), &hc);

Modified: GNUnet/src/applications/fs/fsui/basic_fsui_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/basic_fsui_test.c   2008-05-12 11:48:11 UTC 
(rev 6803)
+++ GNUnet/src/applications/fs/fsui/basic_fsui_test.c   2008-05-12 11:48:55 UTC 
(rev 6804)
@@ -38,9 +38,11 @@
   char *fn;
 
   fn =
-    GNUNET_malloc (strlen ("/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST") + 
14);
-  GNUNET_snprintf (fn, strlen ("/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST") 
+ 14,
-                   "/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST%u", i);
+    GNUNET_malloc (strlen ("/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST") +
+                   14);
+  GNUNET_snprintf (fn,
+                   strlen ("/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST") +
+                   14, "/tmp/gnunet-basic_fsui_test/BASIC_FSUI_TEST%u", i);
   GNUNET_disk_directory_create_for_file (NULL, fn);
   return fn;
 }
@@ -69,8 +71,10 @@
 #if DEBUG_VERBOSE
       printf ("Received search result\n");
 #endif
-      search_uri = GNUNET_ECRS_uri_duplicate(event->data.SearchResult.fi.uri);
-      search_meta = 
GNUNET_ECRS_meta_data_duplicate(event->data.SearchResult.fi.meta);
+      search_uri =
+        GNUNET_ECRS_uri_duplicate (event->data.SearchResult.fi.uri);
+      search_meta =
+        GNUNET_ECRS_meta_data_duplicate (event->data.SearchResult.fi.meta);
       break;
     case GNUNET_FSUI_upload_completed:
 #if DEBUG_VERBOSE
@@ -137,7 +141,7 @@
   ok = GNUNET_YES;
 
   /* ACTUAL TEST CODE */
-  ctx = GNUNET_FSUI_start (NULL, cfg, "basic_fsui_test", 32,   /* thread pool 
size */
+  ctx = GNUNET_FSUI_start (NULL, cfg, "basic_fsui_test", 32,    /* thread pool 
size */
                            GNUNET_NO,   /* no resume */
                            &eventCallback, NULL);
   CHECK (ctx != NULL);
@@ -150,9 +154,7 @@
     GNUNET_ECRS_keyword_command_line_to_uri (NULL, 2,
                                              (const char **) keywords);
   /* upload */
-  upload = GNUNET_FSUI_upload_start (ctx, filename, 
-                                    (GNUNET_FSUI_DirectoryScanCallback) & 
GNUNET_disk_directory_scan, NULL, 
-                                    0,  /* anonymity */
+  upload = GNUNET_FSUI_upload_start (ctx, filename, 
(GNUNET_FSUI_DirectoryScanCallback) & GNUNET_disk_directory_scan, NULL, 0,  /* 
anonymity */
                                      0, /* priority */
                                      GNUNET_YES,
                                      GNUNET_NO,
@@ -193,11 +195,10 @@
   /* download */
   fn = makeName (43);
   download = GNUNET_FSUI_download_start (ctx,
-                                        0,
-                                        GNUNET_NO,
-                                        search_uri,
-                                        search_meta,
-                                        fn, NULL, NULL);
+                                         0,
+                                         GNUNET_NO,
+                                         search_uri,
+                                         search_meta, fn, NULL, NULL);
   GNUNET_free (fn);
   prog = 0;
   while (lastEvent != GNUNET_FSUI_download_completed)
@@ -208,7 +209,7 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  GNUNET_FSUI_download_stop(download);
+  GNUNET_FSUI_download_stop (download);
   download = NULL;
   GNUNET_ECRS_uri_destroy (search_uri);
   GNUNET_ECRS_meta_data_destroy (search_meta);
@@ -239,8 +240,8 @@
     }
   if (download != NULL)
     {
-      GNUNET_FSUI_download_abort(download);
-      GNUNET_FSUI_download_stop(download);
+      GNUNET_FSUI_download_abort (download);
+      GNUNET_FSUI_download_stop (download);
     }
   filename = makeName (43);
   /* TODO: verify file 'filename(42)' == file 'filename(43)' */

Modified: GNUnet/src/applications/fs/fsui/deserialize.c
===================================================================
--- GNUnet/src/applications/fs/fsui/deserialize.c       2008-05-12 11:48:11 UTC 
(rev 6803)
+++ GNUnet/src/applications/fs/fsui/deserialize.c       2008-05-12 11:48:55 UTC 
(rev 6804)
@@ -488,7 +488,7 @@
  * for this search.
  *
  * @param search_count length of search_list
- * @param search_list list of ECRS search requests 
+ * @param search_list list of ECRS search requests
  */
 struct SearchResultList *
 read_result_list (struct GNUNET_GE_Context *ectx,

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/fsui/download.c  2008-05-12 11:48:55 UTC (rev 
6804)
@@ -506,19 +506,19 @@
       ret = GNUNET_YES;
     }
   /* Trigger any recursive sub-downloads */
-  if ( ( (list->state == GNUNET_FSUI_COMPLETED) ||
-        (list->state == GNUNET_FSUI_COMPLETED_JOINED) ) &&
-       (list->is_directory == GNUNET_YES) )
+  if (((list->state == GNUNET_FSUI_COMPLETED) ||
+       (list->state == GNUNET_FSUI_COMPLETED_JOINED)) &&
+      (list->is_directory == GNUNET_YES))
     {
       /* in case there is no sub-download, still
-        create the (possibly empty) directory! */
+         create the (possibly empty) directory! */
       GNUNET_disk_directory_create (list->ctx->ectx, list->filename);
-      if ( (list->is_recursive == GNUNET_YES) &&
-          (GNUNET_ECRS_uri_get_file_size (list->fi.uri) > 0) )
-       {
-         download_recursive (list);
-         list->is_recursive = GNUNET_NO;
-       }
+      if ((list->is_recursive == GNUNET_YES) &&
+          (GNUNET_ECRS_uri_get_file_size (list->fi.uri) > 0))
+        {
+          download_recursive (list);
+          list->is_recursive = GNUNET_NO;
+        }
     }
   dpos = list->child;
   while (dpos != NULL)

Modified: GNUnet/src/applications/fs/fsui/download_persistence_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download_persistence_test.c 2008-05-12 
11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/download_persistence_test.c 2008-05-12 
11:48:55 UTC (rev 6804)
@@ -41,10 +41,16 @@
 {
   char *fn;
 
-  fn = GNUNET_malloc (strlen 
("/tmp/gnunet-fsui-download_persistence_test/FSUITEST") + 14);
+  fn =
+    GNUNET_malloc (strlen
+                   ("/tmp/gnunet-fsui-download_persistence_test/FSUITEST") +
+                   14);
   GNUNET_snprintf (fn,
-                   strlen 
("/tmp/gnunet-fsui-download_persistence_test/FSUITEST") + 14,
-                   "/tmp/gnunet-fsui-download_persistence_test/FSUITEST%u", i);
+                   strlen
+                   ("/tmp/gnunet-fsui-download_persistence_test/FSUITEST") +
+                   14,
+                   "/tmp/gnunet-fsui-download_persistence_test/FSUITEST%u",
+                   i);
   GNUNET_disk_directory_create_for_file (NULL, fn);
   return fn;
 }
@@ -175,7 +181,8 @@
       return -1;
     }
 #if START_DAEMON
-  GNUNET_disk_directory_remove (NULL, 
"/tmp/gnunet-fsui-download_persistence_test/");
+  GNUNET_disk_directory_remove (NULL,
+                                "/tmp/gnunet-fsui-download_persistence_test/");
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
   GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
@@ -185,8 +192,8 @@
   /* ACTUAL TEST CODE */
 #endif
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "fsuidownload_persistence_test", 32, 
GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "fsuidownload_persistence_test", 32,
+                           GNUNET_YES, &eventCallback, NULL);
   CHECK (ctx != NULL);
 
   /* upload */
@@ -228,11 +235,10 @@
   fn = makeName (43);
   download_done = 0;
   download = GNUNET_FSUI_download_start (ctx,
-                                        0,
-                                        GNUNET_NO,
-                                        upURI,
-                                        meta, fn, NULL, NULL);
-  CHECK(download != NULL);
+                                         0,
+                                         GNUNET_NO,
+                                         upURI, meta, fn, NULL, NULL);
+  CHECK (download != NULL);
   GNUNET_free (fn);
   suspendRestart = 4;
   prog = 0;
@@ -265,7 +271,7 @@
     }
   GNUNET_FSUI_download_stop (download);
   download = NULL;
-  
+
   /* unindex */
   waitForEvent = GNUNET_FSUI_unindex_completed;
   fn = makeName (42);

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2008-05-12 11:48:55 UTC (rev 
6804)
@@ -694,7 +694,7 @@
                 {
                   GNUNET_ECRS_file_download_partial_stop (res->test_download);
                   res->test_download = NULL;
-                 ctx->active_probes--;
+                  ctx->active_probes--;
                 }
               res = res->next;
             }

Modified: GNUnet/src/applications/fs/fsui/fsui_start_stop_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui_start_stop_test.c      2008-05-12 
11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/fsui_start_stop_test.c      2008-05-12 
11:48:55 UTC (rev 6804)
@@ -67,13 +67,13 @@
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
 
   /* ACTUAL TEST CODE */
-  ctx = GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES,  
    /* do resume! */
+  ctx = GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES,  
 /* do resume! */
                            &eventCallback, NULL);
   CHECK (ctx != NULL);
   GNUNET_FSUI_stop (ctx);
   ctx =
-    GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES, 
&eventCallback,
-                       NULL);
+    GNUNET_FSUI_start (NULL, cfg, "fsui_start_stop_test", 32, GNUNET_YES,
+                       &eventCallback, NULL);
   CHECK (ctx != NULL);
 FAILURE:
   if (ctx != NULL)

Modified: GNUnet/src/applications/fs/fsui/recursive_download_persistence_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/recursive_download_persistence_test.c       
2008-05-12 11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/recursive_download_persistence_test.c       
2008-05-12 11:48:55 UTC (rev 6804)
@@ -325,8 +325,8 @@
   /* ACTUAL TEST CODE */
 #endif
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "recursive_download_persistence_test", 32, 
GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "recursive_download_persistence_test", 32,
+                           GNUNET_YES, &eventCallback, NULL);
   CHECK (ctx != NULL);
   for (j = 4; j < 16; j += 4)
     {
@@ -383,8 +383,8 @@
           CHECK (download == NULL);
           ctx = GNUNET_FSUI_start (NULL,
                                    cfg,
-                                   "recursive_download_persistence_test", 32, 
GNUNET_YES,
-                                   &eventCallback, NULL);
+                                   "recursive_download_persistence_test", 32,
+                                   GNUNET_YES, &eventCallback, NULL);
 #if DEBUG_VERBOSE
           printf ("Resumed...\n");
 #endif

Modified: GNUnet/src/applications/fs/fsui/recursive_download_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/recursive_download_test.c   2008-05-12 
11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/recursive_download_test.c   2008-05-12 
11:48:55 UTC (rev 6804)
@@ -47,9 +47,12 @@
   char *fn;
 
   fn =
-    GNUNET_malloc (strlen 
("/tmp/gnunet-fsui-recursive_download_test/FSUITEST") + 15);
+    GNUNET_malloc (strlen
+                   ("/tmp/gnunet-fsui-recursive_download_test/FSUITEST") +
+                   15);
   GNUNET_snprintf (fn,
-                   strlen 
("/tmp/gnunet-fsui-recursive_download_test/FSUITEST") + 15,
+                   strlen
+                   ("/tmp/gnunet-fsui-recursive_download_test/FSUITEST") + 15,
                    "/tmp/gnunet-fsui-recursive_download_test/FSUITEST%u/", i);
   return fn;
 }
@@ -185,7 +188,7 @@
         download_done = 1;
 #if DEBUG_VERBOSE
       else
-       printf ("Hierarchy check not successful yet...\n");
+        printf ("Hierarchy check not successful yet...\n");
 #endif
       break;
     case GNUNET_FSUI_download_progress:
@@ -276,7 +279,8 @@
       return -1;
     }
 #if START_DAEMON
-  GNUNET_disk_directory_remove (NULL, 
"/tmp/gnunet-fsui-recursive_download_test/");
+  GNUNET_disk_directory_remove (NULL,
+                                "/tmp/gnunet-fsui-recursive_download_test/");
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
   GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
@@ -322,11 +326,10 @@
 
   fn43 = makeName (43);
   download = GNUNET_FSUI_download_start (ctx,
-                                        0,
-                                        GNUNET_YES,
-                                        upURI,
-                                        meta, fn43, NULL, NULL);
-  CHECK(download != NULL);
+                                         0,
+                                         GNUNET_YES,
+                                         upURI, meta, fn43, NULL, NULL);
+  CHECK (download != NULL);
   GNUNET_free (fn43);
   fn43 = NULL;
   prog = 0;

Modified: GNUnet/src/applications/fs/fsui/search.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search.c    2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/fsui/search.c    2008-05-12 11:48:55 UTC (rev 
6804)
@@ -44,8 +44,7 @@
  */
 static void
 processResult (struct GNUNET_FSUI_SearchList *ctx,
-               struct SearchResultList *pos,
-              int update)
+               struct SearchResultList *pos, int update)
 {
   GNUNET_FSUI_Event event;
 
@@ -56,7 +55,8 @@
       event.data.SearchUpdate.sc.cctx = ctx->cctx;
       event.data.SearchUpdate.fi = pos->fi;
       event.data.SearchUpdate.searchURI = ctx->uri;
-      event.data.SearchUpdate.availability_rank = pos->probeSuccess - 
pos->probeFailure;
+      event.data.SearchUpdate.availability_rank =
+        pos->probeSuccess - pos->probeFailure;
       event.data.SearchUpdate.applicability_rank = pos->matchingSearchCount;
     }
   else
@@ -67,13 +67,17 @@
       event.data.SearchResult.fi = pos->fi;
       event.data.SearchResult.searchURI = ctx->uri;
       GNUNET_URITRACK_add_state (ctx->ctx->ectx,
-                                ctx->ctx->cfg, pos->fi.uri,
-                                GNUNET_URITRACK_SEARCH_RESULT);
+                                 ctx->ctx->cfg, pos->fi.uri,
+                                 GNUNET_URITRACK_SEARCH_RESULT);
     }
   ctx->ctx->ecb (ctx->ctx->ecbClosure, &event);
 }
 
-void bug() { abort(); }
+void
+bug ()
+{
+  abort ();
+}
 
 /**
  * Process results found by ECRS.
@@ -113,8 +117,8 @@
                                 sizeof (GNUNET_HashCode))))
                 {
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                         "Received search result that I have seen before.\n");
+                  fprintf (stderr,
+                           "Received search result that I have seen 
before.\n");
 #endif
                   GNUNET_mutex_unlock (pos->lock);
                   return GNUNET_OK;     /* seen before */
@@ -129,7 +133,7 @@
             {
               GNUNET_GE_BREAK (NULL, 0);
               GNUNET_mutex_unlock (pos->lock);
-             bug();
+              bug ();
               return GNUNET_OK; /* should have matching search */
             }
           GNUNET_array_append (srl->matchingSearches,
@@ -139,29 +143,26 @@
               if (srl->mandatoryMatchesRemaining > 0)
                 srl->mandatoryMatchesRemaining--;
               else
-               GNUNET_GE_BREAK (NULL, 0);
-             update = 0;
+                GNUNET_GE_BREAK (NULL, 0);
+              update = 0;
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                            "Received mandatory search result\n");
+              fprintf (stderr, "Received mandatory search result\n");
 #endif
             }
-         else
-           {
-             update = 1;
+          else
+            {
+              update = 1;
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                            "Received optional search result\n");
+              fprintf (stderr, "Received optional search result\n");
 #endif
-           }
+            }
           if (srl->mandatoryMatchesRemaining == 0)
-           {
+            {
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                            "Passing result to client\n");
+              fprintf (stderr, "Passing result to client\n");
 #endif
-             processResult (pos, srl, update);
-           }
+              processResult (pos, srl, update);
+            }
           GNUNET_mutex_unlock (pos->lock);
           return GNUNET_OK;
         }
@@ -177,7 +178,7 @@
     {
       GNUNET_GE_BREAK (NULL, 0);
       GNUNET_mutex_unlock (pos->lock);
-      bug();
+      bug ();
       return GNUNET_OK;         /* should have matching search */
     }
   srl = GNUNET_malloc (sizeof (struct SearchResultList));
@@ -191,17 +192,15 @@
       if (srl->mandatoryMatchesRemaining > 0)
         srl->mandatoryMatchesRemaining--;
       else
-       GNUNET_GE_BREAK (NULL, 0);        
+        GNUNET_GE_BREAK (NULL, 0);
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                            "Received new mandatory result\n");
+      fprintf (stderr, "Received new mandatory result\n");
 #endif
     }
   else
     {
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                            "Received new optional result\n");
+      fprintf (stderr, "Received new optional result\n");
 #endif
     }
   srl->next = pos->resultsReceived;
@@ -209,8 +208,7 @@
   if (srl->mandatoryMatchesRemaining == 0)
     {
 #if DEBUG_SEARCH
-                  fprintf(stderr,
-                    "Passing new result to client\n");
+      fprintf (stderr, "Passing new result to client\n");
 #endif
       processResult (pos, srl, 0);
     }
@@ -221,7 +219,7 @@
 /**
  * This function is called on each keyword in the
  * search list.  Start the corresponding ECRS search.
- * 
+ *
  * @param closure our GNUNET_FSUI_SearchList.
  */
 static int
@@ -231,10 +229,7 @@
   struct SearchRecordList *srl;
 
 #if DEBUG_SEARCH
-  fprintf(stderr,
-         "Starting search for `%s' (%d)\n",
-         keyword,
-         is_mandatory);
+  fprintf (stderr, "Starting search for `%s' (%d)\n", keyword, is_mandatory);
 #endif
   srl = GNUNET_malloc (sizeof (struct SearchRecordList));
   memset (srl, 0, sizeof (struct SearchRecordList));

Modified: 
GNUnet/src/applications/fs/fsui/search_linked_download_persistence_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search_linked_download_persistence_test.c   
2008-05-12 11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/search_linked_download_persistence_test.c   
2008-05-12 11:48:55 UTC (rev 6804)
@@ -111,7 +111,7 @@
         {
           fprintf (stderr,
                    "Download resuming but search reference not set 
correctly.\n");
-         abort();
+          abort ();
           have_error = 1;
         }
       if ((event->data.DownloadResumed.dc.pos == download) &&
@@ -354,8 +354,8 @@
   /* ACTUAL TEST CODE */
 #endif
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "search_linked_download_persistence_test", 32, 
GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "search_linked_download_persistence_test", 32,
+                           GNUNET_YES, &eventCallback, NULL);
   CHECK (ctx != NULL);
   for (j = 4; j < 256; j += 4)
     {
@@ -416,8 +416,8 @@
           CHECK (download == NULL);
           ctx = GNUNET_FSUI_start (NULL,
                                    cfg,
-                                   "search_linked_download_persistence_test", 
32, GNUNET_YES,
-                                   &eventCallback, NULL);
+                                   "search_linked_download_persistence_test",
+                                   32, GNUNET_YES, &eventCallback, NULL);
 #if DEBUG_VERBOSE
           printf ("Resumed...\n");
 #endif

Modified: GNUnet/src/applications/fs/fsui/search_pause_resume_persistence_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search_pause_resume_persistence_test.c      
2008-05-12 11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/search_pause_resume_persistence_test.c      
2008-05-12 11:48:55 UTC (rev 6804)
@@ -37,10 +37,16 @@
 {
   char *fn;
 
-  fn = GNUNET_malloc (strlen 
("/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST") + 14);
+  fn =
+    GNUNET_malloc (strlen
+                   
("/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST")
+                   + 14);
   GNUNET_snprintf (fn,
-                   strlen 
("/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST") + 14,
-                   
"/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST%u", i);
+                   strlen
+                   
("/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST")
+                   + 14,
+                   
"/tmp/gnunet-fsui-search_pause_resume_persistence_test/FSUITEST%u",
+                   i);
   GNUNET_disk_directory_create_for_file (NULL, fn);
   return fn;
 }
@@ -150,7 +156,8 @@
       return -1;
     }
 #if START_DAEMON
-  GNUNET_disk_directory_remove (NULL, 
"/tmp/gnunet-fsui-search_pause_resume_persistence_test/");
+  GNUNET_disk_directory_remove (NULL,
+                                
"/tmp/gnunet-fsui-search_pause_resume_persistence_test/");
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
   GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
@@ -161,8 +168,8 @@
 #endif
   lock = GNUNET_mutex_create (GNUNET_NO);
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "fsuisearch_pause_resume_persistence_test", 
32, GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "fsuisearch_pause_resume_persistence_test",
+                           32, GNUNET_YES, &eventCallback, NULL);
   CHECK (ctx != NULL);
   GNUNET_snprintf (keyword, 40, "+%s +%s", keywords[0], keywords[1]);
   luri = GNUNET_ECRS_keyword_string_to_uri (NULL, keyword);
@@ -173,14 +180,14 @@
   GNUNET_FSUI_stop (ctx);
   /* resume search! */
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "fsuisearch_pause_resume_persistence_test", 
32, GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "fsuisearch_pause_resume_persistence_test",
+                           32, GNUNET_YES, &eventCallback, NULL);
   GNUNET_FSUI_search_pause (search);
   GNUNET_FSUI_stop (ctx);
   /* resume search! */
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "fsuisearch_pause_resume_persistence_test", 
32, GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "fsuisearch_pause_resume_persistence_test",
+                           32, GNUNET_YES, &eventCallback, NULL);
   GNUNET_FSUI_search_restart (search);
 
   fn = makeName (42);

Modified: GNUnet/src/applications/fs/fsui/search_ranking_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search_ranking_test.c       2008-05-12 
11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/search_ranking_test.c       2008-05-12 
11:48:55 UTC (rev 6804)
@@ -37,7 +37,8 @@
 {
   char *fn;
 
-  fn = GNUNET_malloc (strlen ("/tmp/gnunet-fsui-searchranktest/FSUITEST") + 
14);
+  fn =
+    GNUNET_malloc (strlen ("/tmp/gnunet-fsui-searchranktest/FSUITEST") + 14);
   GNUNET_snprintf (fn,
                    strlen ("/tmp/gnunet-fsui-searchranktest/FSUITEST") + 14,
                    "/tmp/gnunet-fsui-searchranktest/FSUITEST%u", i);
@@ -51,7 +52,7 @@
 
 static volatile struct GNUNET_ECRS_URI *uri;
 
-static volatile int availability; 
+static volatile int availability;
 
 static volatile unsigned int rank;
 
@@ -203,7 +204,7 @@
         break;
     }
   GNUNET_FSUI_upload_stop (upload);
-  
+
   /* search */
   GNUNET_snprintf (keyword, 40, "%s %s", keywords[0], keywords[1]);
   luri = GNUNET_ECRS_keyword_string_to_uri (NULL, keyword);
@@ -214,10 +215,9 @@
   CHECK (NULL != search);
   GNUNET_FSUI_search_pause (search);
   GNUNET_FSUI_search_restart (search);
-  while ( (uri == NULL) &&
-         (availability < 3) &&
-         (rank != 2) &&
-         (GNUNET_shutdown_test () != GNUNET_YES))
+  while ((uri == NULL) &&
+         (availability < 3) &&
+         (rank != 2) && (GNUNET_shutdown_test () != GNUNET_YES))
     {
       prog++;
       CHECK (prog < 10000);

Modified: GNUnet/src/applications/fs/fsui/serialize.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serialize.c 2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/fsui/serialize.c 2008-05-12 11:48:55 UTC (rev 
6804)
@@ -249,7 +249,7 @@
  * for this search.
  *
  * @param search_count length of search_list
- * @param search_list list of ECRS search requests 
+ * @param search_list list of ECRS search requests
  * @param pos results to write
  */
 void

Modified: GNUnet/src/applications/fs/fsui/upload_unindex_persistence_test.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload_unindex_persistence_test.c   
2008-05-12 11:48:11 UTC (rev 6803)
+++ GNUnet/src/applications/fs/fsui/upload_unindex_persistence_test.c   
2008-05-12 11:48:55 UTC (rev 6804)
@@ -42,10 +42,15 @@
   char *fn;
 
   fn =
-    GNUNET_malloc (strlen 
("/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST") + 14);
+    GNUNET_malloc (strlen
+                   
("/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST")
+                   + 14);
   GNUNET_snprintf (fn,
-                   strlen 
("/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST") + 14,
-                   
"/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST%u", i);
+                   strlen
+                   
("/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST")
+                   + 14,
+                   
"/tmp/gnunet-fsui-upload-unindex-persistence-test/FSUITEST%u",
+                   i);
   GNUNET_disk_directory_create_for_file (NULL, fn);
   return fn;
 }
@@ -179,8 +184,8 @@
   /* ACTUAL TEST CODE */
 #endif
   ctx = GNUNET_FSUI_start (NULL,
-                           cfg, "fsuiupload-unindex-persistence-test", 32, 
GNUNET_YES,
-                           &eventCallback, NULL);
+                           cfg, "fsuiupload-unindex-persistence-test", 32,
+                           GNUNET_YES, &eventCallback, NULL);
   CHECK (ctx != NULL);
   fn = makeName (42);
   buf = GNUNET_malloc (FILESIZE);

Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c        2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/gap/gap.c        2008-05-12 11:48:55 UTC (rev 
6804)
@@ -467,8 +467,8 @@
           GNUNET_FS_PT_resolve (rl->response_target, &target);
           GNUNET_GE_ASSERT (NULL, block_count <= MAX_ENTRIES_PER_SLOT);
           blocked[block_count++] = rl->response_target;
-         GNUNET_FS_PT_change_rc (rl->response_target, 1);
-         /* queue response */
+          GNUNET_FS_PT_change_rc (rl->response_target, 1);
+          /* queue response */
           msg = GNUNET_malloc (sizeof (P2P_gap_reply_MESSAGE) + size);
           msg->header.type = htons (GNUNET_P2P_PROTO_GAP_RESULT);
           msg->header.size = htons (sizeof (P2P_gap_reply_MESSAGE) + size);
@@ -513,7 +513,7 @@
     GNUNET_FS_MIGRATION_inject (primary_query,
                                 size, data, expiration, block_count, blocked);
   GNUNET_mutex_unlock (GNUNET_FS_lock);
-  GNUNET_FS_PT_decrement_rcs(blocked, block_count); /* includes rid */
+  GNUNET_FS_PT_decrement_rcs (blocked, block_count);    /* includes rid */
   return value;
 }
 

Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c      2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/fs/lib/fslib.c      2008-05-12 11:48:55 UTC (rev 
6804)
@@ -271,7 +271,7 @@
 
 struct GNUNET_FS_SearchContext *
 GNUNET_FS_create_search_context (struct GNUNET_GE_Context *ectx,
-                                 struct GNUNET_GC_Configuration *cfg) 
+                                 struct GNUNET_GC_Configuration *cfg)
 {
   struct GNUNET_FS_SearchContext *ret;
 
@@ -279,11 +279,11 @@
   memset (ret, 0, sizeof (struct GNUNET_FS_SearchContext));
   ret->ectx = ectx;
   ret->cfg = cfg;
-  ret->lock = GNUNET_mutex_create(GNUNET_YES);
+  ret->lock = GNUNET_mutex_create (GNUNET_YES);
   ret->sock = GNUNET_client_connection_create (ectx, cfg);
   if (ret->sock == NULL)
     {
-      GNUNET_mutex_destroy(ret->lock);
+      GNUNET_mutex_destroy (ret->lock);
       GNUNET_free (ret);
       return NULL;
     }
@@ -314,7 +314,7 @@
       ctx->handles = pos->next;
       GNUNET_free (pos);
     }
-  GNUNET_mutex_destroy(ctx->lock);
+  GNUNET_mutex_destroy (ctx->lock);
   GNUNET_free (ctx);
 }
 

Modified: GNUnet/src/applications/stats/statistics.c
===================================================================
--- GNUnet/src/applications/stats/statistics.c  2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/stats/statistics.c  2008-05-12 11:48:55 UTC (rev 
6804)
@@ -224,15 +224,10 @@
 static void
 initializeStats ()
 {
-  stat_handle_network_load_up
-    =
-    statHandle (gettext_noop
-                ( /* xgettext:no-c-format */
-                 "% of allowed network load (up)"));
-  stat_handle_network_load_down =
-    statHandle (gettext_noop
-                ( /* xgettext:no-c-format */
-                 "% of allowed network load (down)"));
+  stat_handle_network_load_up = statHandle (gettext_noop (      /* 
xgettext:no-c-format */
+                                                           "% of allowed 
network load (up)"));
+  stat_handle_network_load_down = statHandle (gettext_noop (    /* 
xgettext:no-c-format */
+                                                             "% of allowed 
network load (down)"));
   stat_handle_cpu_load =
     statHandle (gettext_noop
                 ( /* xgettext:no-c-format */ "% of allowed cpu load"));

Modified: GNUnet/src/applications/testing/remote.c
===================================================================
--- GNUnet/src/applications/testing/remote.c    2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/testing/remote.c    2008-05-12 11:48:55 UTC (rev 
6804)
@@ -29,7 +29,7 @@
 
 #define VERBOSE GNUNET_NO
 
-/* Yes this is ugly, but for now it is nice to 
+/* Yes this is ugly, but for now it is nice to
  * have a linked list and an array
  */
 static struct GNUNET_REMOTE_host_list *head;

Modified: GNUnet/src/applications/testing/remote.h
===================================================================
--- GNUnet/src/applications/testing/remote.h    2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/applications/testing/remote.h    2008-05-12 11:48:55 UTC (rev 
6804)
@@ -47,7 +47,7 @@
   unsigned short port;
 };
 
-/* Simple linked list to store friends lists for each node, 
+/* Simple linked list to store friends lists for each node,
  * for writing to the friends file
  */
 struct GNUNET_REMOTE_friends_list
@@ -72,9 +72,9 @@
 
 /**
  * Because we need to copy over the friends file before actually connecting,
- * we call this function to get the information for the peers and store it 
+ * we call this function to get the information for the peers and store it
  * in a linked list, which is iterated over later to actually connect.
- * 
+ *
  * @param port1 client port of the first daemon
  * @param port2 client port of the second daemon
  * @param ip1 client ip or hostname for the first daemon

Modified: GNUnet/src/applications/testing/remotetopologies.c
===================================================================
--- GNUnet/src/applications/testing/remotetopologies.c  2008-05-12 11:48:11 UTC 
(rev 6803)
+++ GNUnet/src/applications/testing/remotetopologies.c  2008-05-12 11:48:55 UTC 
(rev 6804)
@@ -210,7 +210,7 @@
   fprintf (stderr,
            _("Connecting nodes in 2d torus topology: %u rows %u columns\n"),
            rows, cols);
-  /* Rows and columns are all sorted out, now iterate over all nodes and 
connect each 
+  /* Rows and columns are all sorted out, now iterate over all nodes and 
connect each
    * to the node to its right and above.  Once this is over, we'll have our 
torus!
    * Special case for the last node (if the rows and columns are not equal), 
connect
    * to the first in the row to maintain topology.

Modified: GNUnet/src/include/gnunet_ecrs_lib.h
===================================================================
--- GNUnet/src/include/gnunet_ecrs_lib.h        2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/include/gnunet_ecrs_lib.h        2008-05-12 11:48:55 UTC (rev 
6804)
@@ -381,9 +381,9 @@
  * double quotes can not be used in the actual keywords (for
  * example, the string '""foo bar""' will be turned into two
  * "OR"ed keywords 'foo' and 'bar', not into '"foo bar"'.
- * 
+ *
  * @return an ECRS URI for the given keywords, NULL
- *  if keywords is not legal (i.e. empty). 
+ *  if keywords is not legal (i.e. empty).
  */
 struct GNUNET_ECRS_URI *GNUNET_ECRS_keyword_string_to_uri (struct
                                                            GNUNET_GE_Context
@@ -395,7 +395,7 @@
 /**
  * Create an ECRS URI from a user-supplied command line of keywords.
  * Arguments should start with "+" to indicate mandatory
- * keywords.  
+ * keywords.
  *
  * @param argc number of keywords
  * @param argv keywords (double quotes are not required for

Modified: GNUnet/src/include/gnunet_fsui_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fsui_lib.h        2008-05-12 11:48:11 UTC (rev 
6803)
+++ GNUnet/src/include/gnunet_fsui_lib.h        2008-05-12 11:48:55 UTC (rev 
6804)
@@ -64,7 +64,7 @@
  * client may call "abort" which will result in an "aborted"
  * event.  In either case, the event itself will NOT result in
  * the memory being released by FSUI -- the client must still
- * call "stop" explicitly.  Clients that call "stop" before an 
+ * call "stop" explicitly.  Clients that call "stop" before an
  * aborted, error or completed event will be blocked until
  * an error or completion event happens (it is illegal for a
  * client to call "abort" after calling "stop").<p>
@@ -411,7 +411,7 @@
       const struct GNUNET_ECRS_URI *searchURI;
 
       /**
-       * Updated availability rank (negative: 
+       * Updated availability rank (negative:
        * unavailable, positive: available)
        */
       int availability_rank;

Modified: GNUnet/src/util/os/osconfig.c
===================================================================
--- GNUnet/src/util/os/osconfig.c       2008-05-12 11:48:11 UTC (rev 6803)
+++ GNUnet/src/util/os/osconfig.c       2008-05-12 11:48:55 UTC (rev 6804)
@@ -145,7 +145,7 @@
       if (ACCESS ("/etc/init.d/", W_OK) == 0)
         return GNUNET_YES;
     }
-      /* Gentoo */
+  /* Gentoo */
   else if (ACCESS ("/sbin/rc-update", X_OK) == 0)
     {
       if (ACCESS ("/etc/init.d/", W_OK) == 0)
@@ -403,7 +403,8 @@
                                                    GNUNET_GE_WARNING |
                                                    GNUNET_GE_USER |
                                                    GNUNET_GE_ADMIN |
-                                                   GNUNET_GE_IMMEDIATE, 
"system",
+                                                   GNUNET_GE_IMMEDIATE,
+                                                   "system",
                                                    "/usr/sbin/update-rc.d");
                     }
                   else
@@ -430,7 +431,8 @@
                                                    GNUNET_GE_WARNING |
                                                    GNUNET_GE_USER |
                                                    GNUNET_GE_ADMIN |
-                                                   GNUNET_GE_IMMEDIATE, 
"system",
+                                                   GNUNET_GE_IMMEDIATE,
+                                                   "system",
                                                    "/sbin/rc-update");
                     }
                   else
@@ -465,20 +467,22 @@
           if (-1 != system ("/usr/sbin/update-rc.d gnunetd remove"))
             {
               GNUNET_GE_LOG_STRERROR_FILE (ectx,
-                                           GNUNET_GE_WARNING | GNUNET_GE_USER |
-                                           GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE,
-                                           "system", "/usr/sbin/update-rc.d");
+                                           GNUNET_GE_WARNING | GNUNET_GE_USER
+                                           | GNUNET_GE_ADMIN |
+                                           GNUNET_GE_IMMEDIATE, "system",
+                                           "/usr/sbin/update-rc.d");
               return GNUNET_SYSERR;
             }
-        } 
+        }
       else if (ACCESS ("/sbin/rc-update", W_OK) == 0)
         {
           if (-1 != system ("/sbin/rc-update del gnunetd"))
             {
               GNUNET_GE_LOG_STRERROR_FILE (ectx,
-                                           GNUNET_GE_WARNING | GNUNET_GE_USER |
-                                           GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE,
-                                           "system", "/sbin/rc-update");
+                                           GNUNET_GE_WARNING | GNUNET_GE_USER
+                                           | GNUNET_GE_ADMIN |
+                                           GNUNET_GE_IMMEDIATE, "system",
+                                           "/sbin/rc-update");
               return GNUNET_SYSERR;
             }
         }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]