gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31098 - in gnunet/src: arm include


From: gnunet
Subject: [GNUnet-SVN] r31098 - in gnunet/src: arm include
Date: Thu, 5 Dec 2013 22:03:00 +0100

Author: grothoff
Date: 2013-12-05 22:03:00 +0100 (Thu, 05 Dec 2013)
New Revision: 31098

Modified:
   gnunet/src/arm/gnunet-service-arm.c
   gnunet/src/include/gnunet_scalarproduct_service.h
Log:
-indentations, comments on API

Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2013-12-05 21:00:43 UTC (rev 31097)
+++ gnunet/src/arm/gnunet-service-arm.c 2013-12-05 21:03:00 UTC (rev 31098)
@@ -488,7 +488,7 @@
   GNUNET_asprintf (&quotedbinary,
                   "\"%s\"",
                   binary);
-  
+
   GNUNET_assert (NULL == sl->proc);
   if (GNUNET_YES == use_debug)
   {
@@ -747,7 +747,7 @@
   }
   if (GNUNET_YES == in_shutdown)
   {
-    signal_result (client, servicename, request_id, 
+    signal_result (client, servicename, request_id,
                   GNUNET_ARM_RESULT_IN_SHUTDOWN);
     GNUNET_SERVER_receive_done (client, GNUNET_OK);
     return;
@@ -755,7 +755,7 @@
   sl = find_service (servicename);
   if (NULL == sl)
   {
-    signal_result (client, servicename, request_id, 
+    signal_result (client, servicename, request_id,
                   GNUNET_ARM_RESULT_IS_NOT_KNOWN);
     GNUNET_SERVER_receive_done (client, GNUNET_OK);
     return;
@@ -818,7 +818,7 @@
       return;
     }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-             _("Preparing to stop `%s'\n"), 
+             _("Preparing to stop `%s'\n"),
              servicename);
   if (0 == strcasecmp (servicename, "arm"))
   {
@@ -1299,22 +1299,28 @@
     return;
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg, section, "BINARY", &binary))
-    {
-      /* not a service section */
-      return;
-    }
+  {
+    /* not a service section */
+    return;
+  }
   if ((GNUNET_YES ==
        GNUNET_CONFIGURATION_have_value (cfg, section, "USER_SERVICE")) &&
       (GNUNET_YES ==
        GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "USER_SERVICE")))
   {
     if (GNUNET_NO == start_user)
+    {
+      GNUNET_free (binary);
       return; /* user service, and we don't deal with those */
+    }
   }
   else
   {
     if (GNUNET_NO == start_system)
+    {
+      GNUNET_free (binary);
       return; /* system service, and we don't deal with those */
+    }
   }
   sl = find_service (section);
   if (NULL != sl)

Modified: gnunet/src/include/gnunet_scalarproduct_service.h
===================================================================
--- gnunet/src/include/gnunet_scalarproduct_service.h   2013-12-05 21:00:43 UTC 
(rev 31097)
+++ gnunet/src/include/gnunet_scalarproduct_service.h   2013-12-05 21:03:00 UTC 
(rev 31098)
@@ -49,11 +49,13 @@
   GNUNET_SCALARPRODUCT_Status_ServiceDisconnected
 };
 
+
 /**
  * Opaque declaration of the SP-Handle
  */
 struct GNUNET_SCALARPRODUCT_Handle;
 
+
 /**
  * Continuation called to notify client about result of the
  * operation.
@@ -63,6 +65,8 @@
  */
 typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls,
                                                              enum 
GNUNET_SCALARPRODUCT_ResponseStatus status);
+
+
 /**
  * Process a datum that was stored in the scalarproduct.
  *
@@ -74,6 +78,7 @@
                                                      enum 
GNUNET_SCALARPRODUCT_ResponseStatus status,
                                                      gcry_mpi_t result);
 
+
 /**
  * Request by Alice's client for computing a scalar product
  *
@@ -85,17 +90,16 @@
  * @param mask Array of the mask
  * @param mask_bytes number of bytes in the mask
  * @param cont Callback function
- * @param cont_cls Closure for the callback function
- * 
+ * @param cont_cls Closure for @a cont
  * @return a new handle for this computation
  */
 struct GNUNET_SCALARPRODUCT_ComputationHandle *
-GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle * cfg,
-                              const struct GNUNET_HashCode * key,
+GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                              const struct GNUNET_HashCode *key,
                               const struct GNUNET_PeerIdentity *peer,
-                              const int32_t * elements,
+                              const int32_t *elements,
                               uint32_t element_count,
-                              const unsigned char * mask,
+                              const unsigned char *mask,
                               uint32_t mask_bytes,
                               GNUNET_SCALARPRODUCT_DatumProcessor cont,
                               void * cont_cls);
@@ -108,17 +112,18 @@
  * @param elements Array of elements of the vector
  * @param element_count Number of elements in the vector
  * @param cont Callback function
- * @param cont_cls Closure for the callback function
- * 
+ * @param cont_cls Closure for @a cont
  * @return a new handle for this computation
  */
 struct GNUNET_SCALARPRODUCT_ComputationHandle *
-GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle * cfg,
-                               const struct GNUNET_HashCode * key,
-                               const int32_t * elements,
+GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               const struct GNUNET_HashCode *key,
+                               const int32_t *elements,
                                uint32_t element_count,
                                GNUNET_SCALARPRODUCT_ContinuationWithStatus 
cont,
-                               void * cont_cls);
+                               void *cont_cls);
+
+
 /**
  * Cancel an ongoing computation or revoke our collaboration offer.
  * Closes the connection to the service
@@ -126,15 +131,22 @@
  * @param h computation handle to terminate
  */
 void
-GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle * 
h);
+GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle *h);
 
+
 /**
  * Cancel ALL ongoing computation or revoke our collaboration offer.
  * Closes ALL connections to the service
+ *
+ * FIXME: this should take an argument, and we should
+ * have an explicit 'connect' API which returns an opaque
+ * connection handle.  Avoid (globals) in the library!
+ * @deprecated in this form
  */
 void
 GNUNET_SCALARPRODUCT_disconnect ();
 
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif




reply via email to

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