From ae3e850c946947cead6b9330f7c8e9764bd5f934 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 15 Mar 2017 12:01:06 +0100 Subject: update getopt config parsing style to match 'getopt' GNUnet branch API change --- src/exchange/taler-exchange-aggregator.c | 9 ++++---- src/exchange/taler-exchange-httpd.c | 37 +++++++++++++++++++------------- 2 files changed, 27 insertions(+), 19 deletions(-) (limited to 'src/exchange') diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c index cbf3fb5d3..ae4ee24fd 100644 --- a/src/exchange/taler-exchange-aggregator.c +++ b/src/exchange/taler-exchange-aggregator.c @@ -1198,10 +1198,11 @@ int main (int argc, char *const *argv) { - static const struct GNUNET_GETOPT_CommandLineOption options[] = { - {'t', "test", NULL, - "run in test mode and exit when idle", 0, - &GNUNET_GETOPT_set_one, &test_mode}, + struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_OPTION_SET_ONE ('t', + "test", + "run in test mode and exit when idle", + &test_mode), GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION), GNUNET_GETOPT_OPTION_END }; diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index fa000d06b..6b430d734 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -934,23 +934,30 @@ main (int argc, char *loglev = NULL; char *logfile = NULL; const struct GNUNET_GETOPT_CommandLineOption options[] = { - {'C', "connection-close", NULL, - "force HTTP connections to be closed after each request", 0, - &GNUNET_GETOPT_set_one, &TEH_exchange_connection_close}, + GNUNET_GETOPT_OPTION_SET_ONE ('C', + "connection-close", + "force HTTP connections to be closed after each request", + &TEH_exchange_connection_close), GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile), - {'D', "disable-admin", NULL, - "do not run the /admin-HTTP server", 0, - &GNUNET_GETOPT_set_one, &no_admin}, - {'i', "init-db", NULL, - "create database tables and indicies if necessary", 0, - &GNUNET_GETOPT_set_one, &init_db}, - {'t', "timeout", "SECONDS", - "after how long do connections timeout by default (in seconds)", 1, - &GNUNET_GETOPT_set_uint, &connection_timeout}, + GNUNET_GETOPT_OPTION_SET_ONE ('D', + "disable-admin", + "do not run the /admin-HTTP server", + &no_admin), + GNUNET_GETOPT_OPTION_SET_ONE ('i', + "init-db", + "create database tables and indicies if necessary", + &init_db), + GNUNET_GETOPT_OPTION_SET_UINT ('t', + "timeout", + "SECONDS", + "after how long do connections timeout by default (in seconds)", + &connection_timeout), #if HAVE_DEVELOPER - {'f', "file-input", "FILENAME", - "run in test-mode using FILENAME as the HTTP request to process", 1, - &GNUNET_GETOPT_set_filename, &input_filename}, + GNUNET_GETOPT_OPTION_FILENAME ('f', + "file-input", + "FILENAME", + "run in test-mode using FILENAME as the HTTP request to process", + &input_filename), #endif GNUNET_GETOPT_OPTION_HELP ("HTTP server providing a RESTful API to access a Taler exchange"), GNUNET_GETOPT_OPTION_LOGLEVEL (&loglev), -- cgit v1.2.3