/*
This file is part of GNUnet.
- (C) 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
/**
* Task scheduled to switch from recording to playback.
*/
-static GNUNET_SCHEDULER_TaskIdentifier switch_task;
+static struct GNUNET_SCHEDULER_Task * switch_task;
/**
* The shutdown task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier st;
+static struct GNUNET_SCHEDULER_Task * st;
/**
* Head of DLL with recorded frames.
* 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;
- if (GNUNET_SCHEDULER_NO_TASK != switch_task)
+ if (NULL != switch_task)
GNUNET_SCHEDULER_cancel (switch_task);
if (NULL != microphone)
GNUNET_MICROPHONE_destroy (microphone);
* 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;
- switch_task = GNUNET_SCHEDULER_NO_TASK;
+ switch_task = NULL;
microphone->disable_microphone (microphone->cls);
if (GNUNET_OK !=
speaker->enable_speaker (speaker->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);
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));