gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29694 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r29694 - gnunet/src/namestore
Date: Sun, 29 Sep 2013 18:31:29 +0200

Author: grothoff
Date: 2013-09-29 18:31:29 +0200 (Sun, 29 Sep 2013)
New Revision: 29694

Modified:
   gnunet/src/namestore/namestore_api.c
Log:
-minor stylistic cleanup, doxygen

Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c        2013-09-29 16:24:59 UTC (rev 
29693)
+++ gnunet/src/namestore/namestore_api.c        2013-09-29 16:31:29 UTC (rev 
29694)
@@ -78,7 +78,7 @@
   GNUNET_NAMESTORE_RecordMonitor proc;
 
   /**
-   * Closure for 'proc'.
+   * Closure for @e proc.
    */
   void *proc_cls;
 
@@ -88,7 +88,7 @@
   GNUNET_NAMESTORE_BlockProcessor block_proc;
 
   /**
-   * Closure for 'block_proc'.
+   * Closure for @e block_proc.
    */
   void *block_proc_cls;
 
@@ -127,7 +127,7 @@
   GNUNET_NAMESTORE_RecordMonitor proc;
 
   /**
-   * Closure for 'proc'.
+   * Closure for @e proc.
    */
   void* proc_cls;
 
@@ -193,32 +193,32 @@
   /**
    * Head of linked list of pending messages to send to the service
    */
-  struct PendingMessage * pending_head;
+  struct PendingMessage *pending_head;
 
   /**
    * Tail of linked list of pending messages to send to the service
    */
-  struct PendingMessage * pending_tail;
+  struct PendingMessage *pending_tail;
 
   /**
    * Head of pending namestore queue entries
    */
-  struct GNUNET_NAMESTORE_QueueEntry * op_head;
+  struct GNUNET_NAMESTORE_QueueEntry *op_head;
 
   /**
    * Tail of pending namestore queue entries
    */
-  struct GNUNET_NAMESTORE_QueueEntry * op_tail;
+  struct GNUNET_NAMESTORE_QueueEntry *op_tail;
 
   /**
    * Head of pending namestore zone iterator entries
    */
-  struct GNUNET_NAMESTORE_ZoneIterator * z_head;
+  struct GNUNET_NAMESTORE_ZoneIterator *z_head;
 
   /**
    * Tail of pending namestore zone iterator entries
    */
-  struct GNUNET_NAMESTORE_ZoneIterator * z_tail;
+  struct GNUNET_NAMESTORE_ZoneIterator *z_tail;
 
   /**
    * Reconnect task
@@ -253,7 +253,8 @@
 
 
 /**
- * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE.
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE.
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
@@ -266,7 +267,8 @@
                              size_t size)
 {
   struct GNUNET_NAMESTORE_Block *block;
-  char buf[size + sizeof (struct GNUNET_NAMESTORE_Block) - sizeof (struct 
LookupBlockResponseMessage)];
+  char buf[size + sizeof (struct GNUNET_NAMESTORE_Block) 
+          - sizeof (struct LookupBlockResponseMessage)];
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received `%s'\n", 
@@ -305,7 +307,8 @@
 
 
 /**
- * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_BLOCK_CACHE_RESPONSE
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_BLOCK_CACHE_RESPONSE
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
@@ -319,18 +322,24 @@
 {
   int res;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Received `%s'\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Received `%s'\n",
        "BLOCK_CACHE_RESPONSE");
   res = ntohl (msg->op_result);
   /* TODO: add actual error message from namestore to response... */
   if (NULL != qe->cont)    
-    qe->cont (qe->cont_cls, res, (GNUNET_OK == res) ? NULL : _("Namestore 
failed to cache block"));
+    qe->cont (qe->cont_cls, 
+             res, 
+             (GNUNET_OK == res) ? 
+             NULL 
+             : _("Namestore failed to cache block"));
   return GNUNET_OK;
 }
 
 
 /**
- * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE_RESPONSE
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE_RESPONSE
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
@@ -361,7 +370,8 @@
 
 
 /**
- * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
@@ -425,7 +435,8 @@
 
 
 /**
- * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE.
+ * Handle an incoming message of type
+ * #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE.
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
@@ -599,10 +610,12 @@
     return GNUNET_SYSERR;
   }
   if ( (0 == name_len) && 
-       (0 == (memcmp (&msg->private_key, &priv_dummy, sizeof (priv_dummy)))) )
+       (0 == (memcmp (&msg->private_key, 
+                     &priv_dummy,
+                     sizeof (priv_dummy)))) )
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-        "Zone iteration is completed!\n");
+        "Zone iteration completed!\n");
     if (NULL != ze->proc)
       ze->proc (ze->proc_cls, NULL, NULL, 0, NULL);
     return GNUNET_NO;
@@ -617,13 +630,19 @@
   {
     struct GNUNET_NAMESTORE_RecordData rd[rd_count];
 
-    if (GNUNET_OK != GNUNET_NAMESTORE_records_deserialize (rd_len, rd_ser_tmp, 
rd_count, rd))
+    if (GNUNET_OK != GNUNET_NAMESTORE_records_deserialize (rd_len, 
+                                                          rd_ser_tmp, 
+                                                          rd_count, 
+                                                          rd))
     {
       GNUNET_break (0);
       return GNUNET_SYSERR;
     }
     if (NULL != ze->proc)
-      ze->proc (ze->proc_cls, &msg->private_key, name_tmp, rd_count, rd);
+      ze->proc (ze->proc_cls, 
+               &msg->private_key, 
+               name_tmp, 
+               rd_count, rd);
     return GNUNET_YES;
   }
 }
@@ -653,7 +672,9 @@
       GNUNET_break (0);
       return GNUNET_SYSERR;
     }
-    return handle_zone_iteration_response (ze, (const struct 
RecordResultMessage *) msg, size);
+    return handle_zone_iteration_response (ze,
+                                          (const struct RecordResultMessage *) 
msg, 
+                                          size);
   default:
     GNUNET_break (0);
     return GNUNET_SYSERR;
@@ -691,7 +712,8 @@
   if (size < sizeof (struct GNUNET_NAMESTORE_Header))
   {
     GNUNET_break_op (0);
-    GNUNET_CLIENT_receive (h->client, &process_namestore_message, h,
+    GNUNET_CLIENT_receive (h->client, 
+                          &process_namestore_message, h,
                            GNUNET_TIME_UNIT_FOREVER_REL);
     return;
   }
@@ -772,10 +794,12 @@
  * @param cls the `struct GNUNET_NAMESTORE_Handle`
  * @param size number of bytes we can transmit
  * @param buf where to copy the messages
- * @return number of bytes copied into buf
+ * @return number of bytes copied into @a buf
  */
 static size_t
-transmit_message_to_namestore (void *cls, size_t size, void *buf)
+transmit_message_to_namestore (void *cls, 
+                              size_t size, 
+                              void *buf)
 {
   struct GNUNET_NAMESTORE_Handle *h = cls;
   struct PendingMessage *p;
@@ -790,12 +814,15 @@
   }
   ret = 0;
   cbuf = buf;
-  while ((NULL != (p = h->pending_head)) && (p->size <= size))
+  while ( (NULL != (p = h->pending_head)) && 
+         (p->size <= size) )
   {
     memcpy (&cbuf[ret], &p[1], p->size);
     ret += p->size;
     size -= p->size;
-    GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, p);
+    GNUNET_CONTAINER_DLL_remove (h->pending_head,
+                                h->pending_tail, 
+                                p);
     if (GNUNET_NO == h->is_receiving)
     {
       h->is_receiving = GNUNET_YES;
@@ -856,7 +883,8 @@
  * @param tc scheduler context
  */
 static void
-reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+reconnect_task (void *cls, 
+               const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_NAMESTORE_Handle *h = cls;
 
@@ -1086,8 +1114,10 @@
   name_tmp = (char *) &msg[1];
   memcpy (name_tmp, label, name_len);
   rd_ser = &name_tmp[name_len];
-  GNUNET_break (rd_ser_len == GNUNET_NAMESTORE_records_serialize (rd_count, 
rd, rd_ser_len, rd_ser));
-
+  GNUNET_break (rd_ser_len == 
+               GNUNET_NAMESTORE_records_serialize (rd_count, rd, 
+                                                   rd_ser_len, 
+                                                   rd_ser));
   LOG (GNUNET_ERROR_TYPE_DEBUG, 
        "Sending `%s' message for name `%s' with size %u and %u records\n", 
        "NAMESTORE_RECORD_STORE", label, msg_size,
@@ -1156,7 +1186,7 @@
  * @param value_zone public key of the target zone (value), never NULL
  * @param proc function to call on the matching records, or with
  *        NULL (rd_count == 0) if there are no matching records
- * @param proc_cls closure for proc
+ * @param proc_cls closure for @a proc
  * @return a handle that can be used to
  *         cancel
  */
@@ -1277,7 +1307,9 @@
   msg->gns_header.header.type = htons 
(GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT);
   msg->gns_header.header.size = htons (msg_size);
   msg->gns_header.r_id = htonl (it->op_id);
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message\n", 
"ZONE_ITERATION_NEXT");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Sending `%s' message\n", 
+       "ZONE_ITERATION_NEXT");
   GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe);
   do_transmit(h);
 }
@@ -1329,7 +1361,7 @@
   struct GNUNET_NAMESTORE_Handle *h = qe->nsh;
 
   GNUNET_assert (NULL != qe);
-  GNUNET_CONTAINER_DLL_remove(h->op_head, h->op_tail, qe);
+  GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, qe);
   GNUNET_free(qe);
 }
 




reply via email to

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