static struct GNUNET_GETOPT_CommandLineOption options[] =
{
- { 's', "solver", NULL,
- gettext_noop ("solver to use"),
- 1, &GNUNET_GETOPT_set_string, &opt_solver},
- { 'e', "experiment", NULL,
- gettext_noop ("experiment to use"),
- 1, &GNUNET_GETOPT_set_string, &opt_exp_file},
- { 'V', "verbose", NULL,
- gettext_noop ("be verbose"),
- 0, &GNUNET_GETOPT_set_one, &opt_verbose},
- { 'p', "print", NULL,
- gettext_noop ("print logging"),
- 0, &GNUNET_GETOPT_set_one, &opt_print},
- { 'f', "file", NULL,
- gettext_noop ("save logging to disk"),
- 0, &GNUNET_GETOPT_set_one, &opt_save},
- { 'd', "dn", NULL,
- gettext_noop ("disable normalization"),
- 0, &GNUNET_GETOPT_set_one, &opt_disable_normalization},
+ GNUNET_GETOPT_OPTION_STRING ('s',
+ "solver",
+ gettext_noop ("solver to use"),
+ &opt_solver),
+
+ GNUNET_GETOPT_OPTION_STRING ('e',
+ "experiment"
+ gettext_noop ("experiment to use"),
+ &opt_exp_file),
+
+ GNUNET_GETOPT_OPTION_VERBOSE (&opt_verbose),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('p',
+ "print",
+ gettext_noop ("print logging"),
+ &opt_print),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('f',
+ "file",
+ gettext_noop ("save logging to disk"),
+ &opt_save),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('d',
+ "dn",
+ gettext_noop ("disable normalization"),
+ &opt_disable_normalization),
+
GNUNET_GETOPT_OPTION_END
};
ph.total_iterations = 1;
static struct GNUNET_GETOPT_CommandLineOption options[] = {
- { 'a', "addresses", NULL,
- gettext_noop ("addresses to use"),
- 1, &GNUNET_GETOPT_set_uint, &ph.N_address },
- { 's', "start", NULL,
- gettext_noop ("start with peer"),
- 1, &GNUNET_GETOPT_set_uint, &ph.N_peers_start },
- { 'e', "end", NULL,
- gettext_noop ("end with peer"),
- 1, &GNUNET_GETOPT_set_uint, &ph.N_peers_end },
- { 'i', "iterations", NULL,
- gettext_noop ("number of iterations used for averaging (default: 1)"),
- 1, &GNUNET_GETOPT_set_uint, &ph.total_iterations },
- { 'p', "percentage", NULL,
- gettext_noop ("update a fix percentage of addresses"),
- 1, &GNUNET_GETOPT_set_uint, &ph.opt_update_percent },
- { 'd', "data", NULL,
- gettext_noop ("create data file"),
- 0, &GNUNET_GETOPT_set_one, &ph.create_datafile},
- { 'u', "update", NULL,
- gettext_noop ("measure updates"),
- 0, &GNUNET_GETOPT_set_one, &ph.measure_updates},
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('a',
+ "addresses",
+ gettext_noop ("addresses to use"),
+ &ph.N_address),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('s',
+ "start",
+ gettext_noop ("start with peer"),
+ &ph.N_peers_start),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('e',
+ "end",
+ gettext_noop ("end with peer"),
+ &ph.N_peers_end),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('i',
+ "iterations",
+ gettext_noop ("number of iterations used for averaging (default: 1)"),
+ &ph.total_iterations),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('p',
+ "percentage",
+ gettext_noop ("update a fix percentage of addresses"),
+ &ph.opt_update_percent),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('d',
+ "data",
+ gettext_noop ("create data file"),
+ &ph.create_datafile),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('u',
+ "update",
+ gettext_noop ("measure updates"),
+ &ph.measure_updates),
+
GNUNET_GETOPT_OPTION_END
};
char port_id[] = "test port";
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'t', "time", "short_time",
- gettext_noop ("set short timeout"),
- GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &short_time},
- {'m', "messages", "NUM_MESSAGES",
- gettext_noop ("set number of messages to send"),
- GNUNET_YES, &GNUNET_GETOPT_set_uint, &total_packets},
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
+ "time",
+ "short_time",
+ gettext_noop ("set short timeout"),
+ &short_time),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('m',
+ "messages",
+ "NUM_MESSAGES",
+ gettext_noop ("set number of messages to send"),
+ &total_packets),
GNUNET_GETOPT_OPTION_END
};
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'e', "ego", "NAME",
- gettext_noop ("sets the NAME of the ego to use for the phone (and name resolution)"),
- 1, &GNUNET_GETOPT_set_string, &ego_name},
- {'p', "phone", "LINE",
- gettext_noop ("sets the LINE to use for the phone"),
- 1, &GNUNET_GETOPT_set_string, &line},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('e',
+ "ego",
+ "NAME",
+ gettext_noop ("sets the NAME of the ego to use for the phone (and name resolution)"),
+ &ego_name),
+
+ GNUNET_GETOPT_OPTION_STRING ('p',
+ "phone",
+ "LINE",
+ gettext_noop ("sets the LINE to use for the phone"),
+ &line),
+
GNUNET_GETOPT_OPTION_END
};
int ret;
/**
* Was verbose specified?
*/
-static int verbose;
+static unsigned int verbose;
/**
{
int res;
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'V', "verbose", NULL,
- gettext_noop ("verbose output"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
+
GNUNET_GETOPT_OPTION_END
};
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'t', "table", "TABLENAME",
- gettext_noop ("name of the table to write DFAs"),
- 1, &GNUNET_GETOPT_set_string, &table_name},
- {'p', "max-path-compression", "MAX_PATH_COMPRESSION",
- gettext_noop ("maximum path compression length"),
- 1, &GNUNET_GETOPT_set_uint, &max_path_compression},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_STRING ('t',
+ "table",
+ "TABLENAME",
+ gettext_noop ("name of the table to write DFAs"),
+ &table_name),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('p',
+ "max-path-compression",
+ "MAX_PATH_COMPRESSION",
+ gettext_noop ("maximum path compression length"),
+ &max_path_compression),
+
GNUNET_GETOPT_OPTION_END
};
int ret;