36#if ! defined (__GNUNET_UTIL_LIB_H_INSIDE__)
37#error "Only <gnunet_util_lib.h> can be included directly."
40#ifndef GNUNET_GETOPT_LIB_H
41#define GNUNET_GETOPT_LIB_H
275#define GNUNET_GETOPT_option_base32_auto(shortName, \
280 GNUNET_GETOPT_option_base32_fixed_size (shortName, \
352 unsigned long long *val);
476#define GNUNET_GETOPT_OPTION_END \
478 '\0', NULL, NULL, NULL, 0, 0, 0, NULL, NULL, NULL \
static struct GNUNET_FS_Handle * ctx
static char * name
Name (label) of the records to list.
static char * value
Value of the record to add/remove.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_timestamp(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Timestamp *val)
Allow user to specify a struct GNUNET_TIME_Timestamp (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_increment_uint(char shortName, const char *name, const char *description, unsigned int *val)
Increment val each time the option flag is given by one.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_cfgfile(char **fn)
Allow user to specify configuration file name (-c option)
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_logfile(char **logfn)
Allow user to specify log file name (-l option)
int GNUNET_GETOPT_run(const char *binaryOptions, const struct GNUNET_GETOPT_CommandLineOption *allOptions, unsigned int argc, char *const *argv)
Parse the command line.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_filename(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a filename (automatically path expanded).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_exclusive(struct GNUNET_GETOPT_CommandLineOption opt)
Make the given option mutually exclusive with other options.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_mandatory(struct GNUNET_GETOPT_CommandLineOption opt)
Make the given option mandatory.
int(* GNUNET_GETOPT_CommandLineOptionProcessor)(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value)
Process a command line option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_timetravel(char shortName, const char *name)
Allow user to specify a long long with an offset to add to the current system time to construct the t...
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_base32_fixed_size(char shortName, const char *name, const char *argumentHelp, const char *description, void *val, size_t val_size)
Allow user to specify a binary value using Crockford Base32 encoding.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_relative_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Relative *val)
Allow user to specify a struct GNUNET_TIME_Relative (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_help(const struct GNUNET_OS_ProjectData *pd, const char *about)
Defining the option to print the command line help text (-h option).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_absolute_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Absolute *val)
Allow user to specify a struct GNUNET_TIME_Absolute (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_loglevel(char **level)
Define the '-L' log level option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_ulong(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned long long *val)
Allow user to specify an unsigned long long.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_verbose(unsigned int *level)
Define the '-V' verbosity option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint16(char shortName, const char *name, const char *argumentHelp, const char *description, uint16_t *val)
Allow user to specify an uint16_t.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_version(const char *version)
Define the option to print the version of the application (-v option)
Definition of a command line option.
int require_argument
Is an argument required? GNUNET_NO (includes optional) or GNUNET_YES (required)
const char * description
Help text for the option (description)
const char * argumentHelp
Name of the argument for the user in help text.
int option_exclusive
Is the option exclusive?
int option_mandatory
Is the presence of this option mandatory?
const char * name
Long name of the option (may not be NULL)
void * scls
Specific closure to pass to the processor.
GNUNET_GETOPT_CommandLineOptionProcessor processor
Handler for the option.
const char shortName
Short name of the option.
void(* cleaner)(void *cls)
Function to call on scls to clean up after processing all the arguments.
General context for command line processors.
const char * binaryName
Name of the application.
const char * binaryOptions
Name of application with option summary.
const struct GNUNET_GETOPT_CommandLineOption * allOptions
Array with all command line options.
char *const * argv
Original command line.
unsigned int argc
Total number of argv's.
unsigned int currentArgument
Current argument.
Project-specific data used to help the OS subsystem find installation paths.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
Time for timestamps used by GNUnet, in microseconds rounded to seconds.