-bringing copyright tags up to FSF standard
[oweals/gnunet.git] / src / transport / gnunet-service-transport_hello.c
index 626be54c1b37ffc9e8936b385a246c45a374df5a..d59b0f1b4c54dc3497013cbddc1b34accf11a139 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010,2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010,2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -107,7 +107,7 @@ struct OwnAddressList *oal_tail;
 /**
  * Identifier of 'refresh_hello' task.
  */
-static GNUNET_SCHEDULER_TaskIdentifier hello_task;
+static struct GNUNET_SCHEDULER_Task * hello_task;
 
 
 /**
@@ -133,17 +133,18 @@ struct GeneratorContext
  * @param cls the 'struct GeneratorContext'
  * @param max maximum number of bytes left
  * @param buf where to write the address
+ * @return bytes written or GNUNET_SYSERR to signal the
+ *         end of the iteration.
  */
-static size_t
+static ssize_t
 address_generator (void *cls, size_t max, void *buf)
 {
   struct GeneratorContext *gc = cls;
-  size_t ret;
+  ssize_t ret;
 
   if (NULL == gc->addr_pos)
-    return 0;
-  ret =
-      GNUNET_HELLO_add_address (gc->addr_pos->address, gc->expiration, buf,
+    return GNUNET_SYSERR; /* Done */
+  ret = GNUNET_HELLO_add_address (gc->addr_pos->address, gc->expiration, buf,
                                 max);
   gc->addr_pos = gc->addr_pos->next;
   return ret;
@@ -163,7 +164,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GeneratorContext gc;
   int friend_only;
 
-  hello_task = GNUNET_SCHEDULER_NO_TASK;
+  hello_task = NULL;
   gc.addr_pos = oal_head;
   gc.expiration = GNUNET_TIME_relative_to_absolute (hello_expiration);
 
@@ -197,7 +198,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static void
 refresh_hello ()
 {
-  if (hello_task != GNUNET_SCHEDULER_NO_TASK)
+  if (hello_task != NULL)
     GNUNET_SCHEDULER_cancel (hello_task);
   hello_task = GNUNET_SCHEDULER_add_now (&refresh_hello_task, NULL);
 }
@@ -230,10 +231,10 @@ GST_hello_stop ()
 {
   hello_cb = NULL;
   hello_cb_cls = NULL;
-  if (GNUNET_SCHEDULER_NO_TASK != hello_task)
+  if (NULL != hello_task)
   {
     GNUNET_SCHEDULER_cancel (hello_task);
-    hello_task = GNUNET_SCHEDULER_NO_TASK;
+    hello_task = NULL;
   }
   if (NULL != our_hello)
   {