This file is part of GNUnet.
Copyright (C) 2001-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
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
* @param about string with brief description of the application
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_HELP (const char *about);
+GNUNET_GETOPT_option_help (const char *about);
/**
* @param version string with the version number
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_VERSION (const char *version);
+GNUNET_GETOPT_option_version (const char *version);
* @param[out] logfn set to the name of the logfile
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_LOGFILE (char **logfn);
+GNUNET_GETOPT_option_logfile (char **logfn);
/**
* @param[out] str set to the string
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_STRING (char shortName,
+GNUNET_GETOPT_option_string (char shortName,
const char *name,
const char *argumentHelp,
const char *description,
* @param[out] str set to the string
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_FILENAME (char shortName,
+GNUNET_GETOPT_option_filename (char shortName,
const char *name,
const char *argumentHelp,
const char *description,
* @param val_size size of @a val in bytes
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_BASE32_FIXED_SIZE (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- void *val,
- size_t val_size);
+GNUNET_GETOPT_option_base32_fixed_size (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ void *val,
+ size_t val_size);
/**
* @param[out] val binary value decoded from Crockford Base32-encoded argument;
* size is determined by type (sizeof (*val)).
*/
-#define GNUNET_GETOPT_OPTION_SET_BASE32_AUTO(shortName,name,argumentHelp,description,val) \
- GNUNET_GETOPT_OPTION_SET_BASE32_FIXED_SIZE(shortName,name,argumentHelp,description,val,sizeof(*val))
+#define GNUNET_GETOPT_option_base32_auto(shortName,name,argumentHelp,description,val) \
+ GNUNET_GETOPT_option_base32_fixed_size(shortName,name,argumentHelp,description,val,sizeof(*val))
/**
* @param[out] val set to 1 if the option is present
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_ONE (char shortName,
- const char *name,
- const char *description,
- int *val);
+GNUNET_GETOPT_option_flag (char shortName,
+ const char *name,
+ const char *description,
+ int *val);
/**
* @param[out] val set to the value specified at the command line
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_UINT (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- unsigned int *val);
+GNUNET_GETOPT_option_uint (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ unsigned int *val);
+
+
+/**
+ * Allow user to specify an uint16_t.
+ *
+ * @param shortName short name of the option
+ * @param name long name of the option
+ * @param argumentHelp help text for the option argument
+ * @param description long help text for the option
+ * @param[out] val set to the value specified at the command line
+ */
+struct GNUNET_GETOPT_CommandLineOption
+GNUNET_GETOPT_option_uint16 (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ uint16_t *val);
/**
* @param[out] val set to the value specified at the command line
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_ULONG (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- unsigned long long *val);
+GNUNET_GETOPT_option_ulong (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ unsigned long long *val);
/**
* @param[out] val set to the time specified at the command line
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- struct GNUNET_TIME_Relative *val);
+GNUNET_GETOPT_option_relative_time (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ struct GNUNET_TIME_Relative *val);
/**
* @param[out] val set to the time specified at the command line
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_SET_ABSOLUTE_TIME (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- struct GNUNET_TIME_Absolute *val);
+GNUNET_GETOPT_option_absolute_time (char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ struct GNUNET_TIME_Absolute *val);
/**
* @param[out] val set to 1 if the option is present
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_INCREMENT_VALUE (char shortName,
- const char *name,
- const char *description,
- unsigned int *val);
+GNUNET_GETOPT_option_increment_uint (char shortName,
+ const char *name,
+ const char *description,
+ unsigned int *val);
/**
* @param[out] level set to the log level
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_LOGLEVEL (char **level);
+GNUNET_GETOPT_option_loglevel (char **level);
/**
* @param[out] level set to the verbosity level
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_VERBOSE (unsigned int *level);
+GNUNET_GETOPT_option_verbose (unsigned int *level);
/**
* @param[out] logfn set to the name of the logfile
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_LOGFILE (char **logfn);
+GNUNET_GETOPT_option_logfile (char **logfn);
/**
* @param[out] fn set to the name of the configuration file
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_CFG_FILE (char **fn);
+GNUNET_GETOPT_option_cfgfile (char **fn);
/**
* @return @a opt with the mandatory flag set.
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_GETOPT_OPTION_MANDATORY (struct GNUNET_GETOPT_CommandLineOption opt);
+GNUNET_GETOPT_option_mandatory (struct GNUNET_GETOPT_CommandLineOption opt);
/**