/*
This file is part of GNUnet.
- (C) 2010, 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010, 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.
*/
/**
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
if (NULL != qe)
GNUNET_DATASTORE_cancel (qe);
/**
* Perform next GET operation.
*/
-static void
+static void
do_get (void);
* space for 0-priority content
* @param msg NULL on success, otherwise an error message
*/
-static void
+static void
do_finish (void *cls,
int32_t success,
struct GNUNET_TIME_Absolute min_expiration,
* @param uid unique identifier for the datum;
* maybe 0 if no unique identifier is available
*/
-static void
+static void
do_put (void *cls,
const struct GNUNET_HashCode *key,
size_t size, const void *data,
first_uid = uid;
qe = GNUNET_DATASTORE_put (db_dst, 0,
key, size, data, type,
- priority, anonymity,
- 0 /* FIXME: replication is lost... */,
+ priority, anonymity,
+ 0 /* FIXME: replication is lost... */,
expiration,
0, 1, GNUNET_TIME_UNIT_FOREVER_REL,
&do_finish, NULL);
/**
* Perform next GET operation.
*/
-static void
+static void
do_get ()
{
qe = GNUNET_DATASTORE_get_key (db_src,
*
* @param cls closure
* @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used
+ * @param cfgfile name of the configuration file used
* @param cfg configuration -- for destination datastore
*/
static void
return; /* nothing to be done */
if (0 == strcmp (cfgfile, alternative_cfg))
{
- fprintf (stderr,
+ fprintf (stderr,
_("Cannot use the same configuration for source and destination\n"));
ret = 1;
return;
ret = 1;
return;
}
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &do_shutdown, NULL);
+ GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
do_get ();
}
if (GNUNET_OK !=
GNUNET_PROGRAM_run (argc, argv, "gnunet-datastore",
gettext_noop ("Manipulate GNUnet datastore"),
- options, &run, NULL))
+ options, &run, NULL))
ret = 1;
GNUNET_free ((void*) argv);
return ret;