/*
This file is part of GNUnet.
- Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 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
static int local_only;
+static struct GNUNET_SCHEDULER_Task *tt;
+
+
/**
* Type of a function that libextractor calls for each
* meta data item found.
* @param data_mime_type mime-type of data (not of the original file);
* can be NULL (if mime-type is not known)
* @param data actual meta-data found
- * @param data_size number of bytes in data
+ * @param data_size number of bytes in @a data
* @return 0 to continue extracting, 1 to abort
*/
static int
-item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
- enum EXTRACTOR_MetaFormat format, const char *data_mime_type,
- const char *data, size_t data_size)
+item_printer (void *cls,
+ const char *plugin_name,
+ enum EXTRACTOR_MetaType type,
+ enum EXTRACTOR_MetaFormat format,
+ const char *data_mime_type,
+ const char *data,
+ size_t data_size)
{
if ((format != EXTRACTOR_METAFORMAT_UTF8) &&
(format != EXTRACTOR_METAFORMAT_C_STRING))
static void
-clean_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+clean_task (void *cls)
{
size_t dsize;
void *ddata;
static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
if (sc != NULL)
{
}
+static void
+timeout_task (void *cls)
+{
+ tt = NULL;
+ GNUNET_SCHEDULER_shutdown ();
+}
+
+
/**
* Main function that will be run by the scheduler.
*
return;
}
if (0 != timeout.rel_value_us)
- GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL);
- else
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
- NULL);
+ tt = GNUNET_SCHEDULER_add_delayed (timeout,
+ &timeout_task,
+ NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
}