aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-10 00:57:20 +0200
committerChristian Grothoff <christian@grothoff.org>2016-04-10 00:57:20 +0200
commit0dee91e014a51a5b66cd1b0a9a7517ac75813eb6 (patch)
treed0a2dc0552b308548a069fe2c93115c33dc70b50
parentdf893df505683aef0d2f484944e417ec1bcdf4aa (diff)
changing code to meet latest change in GNUNET_SCHEDULER API
-rw-r--r--src/bank-lib/test_bank_api.c28
-rw-r--r--src/exchange-lib/test_exchange_api.c28
-rw-r--r--src/exchange/taler-exchange-aggregator.c23
-rw-r--r--src/exchange/test_taler_exchange_aggregator.c32
-rw-r--r--src/exchangedb/test_exchangedb.c4
-rw-r--r--src/wire/plugin_wire_test.c8
6 files changed, 38 insertions, 85 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index 66f3557b9..cc1086e73 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -163,11 +163,9 @@ struct InterpreterState
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+context_task (void *cls);
/**
@@ -233,11 +231,9 @@ find_command (const struct InterpreterState *is,
* Run the main interpreter loop that performs bank operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+interpreter_run (void *cls);
/**
@@ -281,17 +277,17 @@ add_incoming_cb (void *cls,
* Run the main interpreter loop that performs bank operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+interpreter_run (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
struct TALER_Amount amount;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
is->task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
fprintf (stderr,
@@ -354,11 +350,9 @@ interpreter_run (void *cls,
* Cleans up our state.
*
* @param cls the interpreter state.
- * @param tc unused
*/
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd;
@@ -415,11 +409,9 @@ do_shutdown (void *cls,
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+context_task (void *cls)
{
long timeout;
int max_fd;
@@ -471,13 +463,9 @@ context_task (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param config configuration
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct InterpreterState *is;
static struct Command commands[] =
diff --git a/src/exchange-lib/test_exchange_api.c b/src/exchange-lib/test_exchange_api.c
index bfe54d507..c7eb9e314 100644
--- a/src/exchange-lib/test_exchange_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -573,11 +573,9 @@ struct InterpreterState
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+context_task (void *cls);
/**
@@ -641,11 +639,9 @@ find_command (const struct InterpreterState *is,
* Run the main interpreter loop that performs exchange operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+interpreter_run (void *cls);
/**
@@ -1414,11 +1410,9 @@ deposit_wtid_cb (void *cls,
* Run the main interpreter loop that performs exchange operations.
*
* @param cls contains the `struct InterpreterState`
- * @param tc scheduler context
*/
static void
-interpreter_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+interpreter_run (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
@@ -1428,8 +1422,10 @@ interpreter_run (void *cls,
struct TALER_Amount amount;
struct GNUNET_TIME_Absolute execution_date;
json_t *wire;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
is->task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
fprintf (stderr,
@@ -1993,11 +1989,9 @@ interpreter_run (void *cls,
* Cleans up our state.
*
* @param cls the interpreter state.
- * @param tc unused
*/
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct InterpreterState *is = cls;
struct Command *cmd;
@@ -2218,11 +2212,9 @@ cert_cb (void *cls,
* Task that runs the context's event loop with the GNUnet scheduler.
*
* @param cls unused
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+context_task (void *cls)
{
long timeout;
int max_fd;
@@ -2274,13 +2266,9 @@ context_task (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param config configuration
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct InterpreterState *is;
static struct MeltDetails melt_coins_1[] = {
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 80d1bbb9f..2ff3c2ca8 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -198,11 +198,9 @@ static unsigned int aggregation_limit = TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT
* We're being aborted with CTRL-C (or SIGTERM). Shut down.
*
* @param cls closure
- * @param tc scheduler context
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
if (NULL != task)
{
@@ -517,17 +515,17 @@ prepare_cb (void *cls,
* into larger wire transfers.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-run_aggregation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_aggregation (void *cls)
{
struct TALER_EXCHANGEDB_Session *session;
unsigned int i;
int ret;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -713,11 +711,9 @@ run_aggregation (void *cls,
* do.
*
* @param cls pointer to an `int` which we will return from main()
- * @param tc scheduler context
*/
static void
-run_transfers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+run_transfers (void *cls);
/**
@@ -895,15 +891,16 @@ wire_prepare_cb (void *cls,
* @param tc scheduler context
*/
static void
-run_transfers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_transfers (void *cls)
{
int ret;
struct TALER_EXCHANGEDB_Session *session;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Checking for pending wire transfers\n");
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (NULL == (session = db_plugin->get_session (db_plugin->cls,
@@ -961,11 +958,9 @@ run_transfers (void *cls,
* First task.
*
* @param cls closure, NULL
- * @param tc scheduler context
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
task = GNUNET_SCHEDULER_add_now (&run_transfers,
NULL);
diff --git a/src/exchange/test_taler_exchange_aggregator.c b/src/exchange/test_taler_exchange_aggregator.c
index f34dea837..3720ce829 100644
--- a/src/exchange/test_taler_exchange_aggregator.c
+++ b/src/exchange/test_taler_exchange_aggregator.c
@@ -305,22 +305,18 @@ static struct GNUNET_CRYPTO_RsaPublicKey *coin_pub;
* Interprets the commands from the test program.
*
* @param cls the `struct State` of the interpreter
- * @param tc scheduler context
*/
static void
-interpreter (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+interpreter (void *cls);
/**
* Task triggered whenever we are to shutdown.
*
* @param cls closure, NULL if we need to self-restart
- * @param tc context
*/
static void
-shutdown_action (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_action (void *cls)
{
shutdown_task = NULL;
if (NULL != mhd_task)
@@ -355,18 +351,18 @@ shutdown_action (void *cls,
* process died).
*
* @param cls closure, NULL if we need to self-restart
- * @param tc context
*/
static void
-maint_child_death (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+maint_child_death (void *cls)
{
const struct GNUNET_DISK_FileHandle *pr;
char c[16];
struct State *state;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
child_death_task = NULL;
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
/* shutdown scheduled us, ignore! */
@@ -384,7 +380,7 @@ maint_child_death (void *cls,
aggregator_state->ioff++;
state = aggregator_state;
aggregator_state = NULL;
- interpreter (state, NULL);
+ interpreter (state);
if (NULL == shutdown_task)
return;
child_death_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -527,11 +523,9 @@ fail (struct Command *cmd)
* Interprets the commands from the test program.
*
* @param cls the `struct State` of the interpreter
- * @param tc scheduler context
*/
static void
-interpreter (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+interpreter (void *cls)
{
struct State *state = cls;
@@ -864,11 +858,9 @@ handle_mhd_request (void *cls,
* Task run whenever HTTP server operations are pending.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-run_mhd (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+run_mhd (void *cls);
/**
@@ -934,11 +926,9 @@ schedule_httpd ()
* Task run whenever HTTP server operations are pending.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-run_mhd (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_mhd (void *cls)
{
mhd_task = NULL;
MHD_run (mhd_bank);
@@ -950,11 +940,9 @@ run_mhd (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure with configuration
- * @param tc unused
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 8d06c0072..f2c473fd9 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -615,11 +615,9 @@ deposit_cb (void *cls,
* Main function that will be run by the scheduler.
*
* @param cls closure with config
- * @param tc unused
*/
static void
-run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct TALER_EXCHANGEDB_Session *session;
diff --git a/src/wire/plugin_wire_test.c b/src/wire/plugin_wire_test.c
index 9d0667680..bde3c4442 100644
--- a/src/wire/plugin_wire_test.c
+++ b/src/wire/plugin_wire_test.c
@@ -131,11 +131,9 @@ struct TALER_WIRE_ExecuteHandle
* scheduler.
*
* @param cls our `struct TestClosure`
- * @param tc scheduler context (unused)
*/
static void
-context_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *sct)
+context_task (void *cls)
{
struct TestClosure *tc = cls;
long timeout;
@@ -388,11 +386,9 @@ GNUNET_NETWORK_STRUCT_END
* callback with the serialized state.
*
* @param cls the `struct TALER_WIRE_PrepareHandle`
- * @param sct unused
*/
static void
-do_prepare (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *sct)
+do_prepare (void *cls)
{
struct TALER_WIRE_PrepareHandle *pth = cls;
char *wire_enc;