-add reverse autoadd; with test
[oweals/gnunet.git] / src / conversation / gnunet-conversation-test.c
index 1c8fe74e6ecbd50892c33545bf340eef0e940d0f..804df4c8881484a11b8649ceda68bf21e5c66410 100644 (file)
@@ -96,11 +96,9 @@ static struct Recording *rec_tail;
  * Terminate test.
  *
  * @param cls NULL
- * @param tc unused
  */
 static void
-do_shutdown (void *cls,
-            const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
 {
   struct Recording *rec;
 
@@ -126,11 +124,9 @@ do_shutdown (void *cls,
  * Terminate recording process and switch to playback.
  *
  * @param cls NULL
- * @param tc unused
  */
 static void
-switch_to_speaker (void *cls,
-                  const struct GNUNET_SCHEDULER_TaskContext *tc)
+switch_to_speaker (void *cls)
 {
   struct Recording *rec;
 
@@ -182,7 +178,7 @@ record (void *cls,
              (unsigned int) data_size);
   rec = GNUNET_malloc (sizeof (struct Recording) + data_size);
   rec->size = data_size;
-  memcpy (&rec[1], data, data_size);
+  GNUNET_memcpy (&rec[1], data, data_size);
   GNUNET_CONTAINER_DLL_insert_tail (rec_head,
                                    rec_tail,
                                    rec);
@@ -208,9 +204,8 @@ run (void *cls, char *const *args, const char *cfgfile,
   switch_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
                                              &switch_to_speaker,
                                              NULL);
-  st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                    &do_shutdown,
-                                    NULL);
+  st = GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
+                                     NULL);
   fprintf (stderr,
           _("We will now be recording you for %s. After that time, the recording will be played back to you..."),
           GNUNET_STRINGS_relative_time_to_string (TIMEOUT, GNUNET_YES));