GNUnet  0.10.x
Data Structures | Macros | Typedefs | Functions
gnunet_getopt_lib.h File Reference
#include "gnunet_configuration_lib.h"
Include dependency graph for gnunet_getopt_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_GETOPT_CommandLineProcessorContext
 General context for command line processors. More...
 
struct  GNUNET_GETOPT_CommandLineOption
 Definition of a command line option. More...
 

Macros

#define GNUNET_GETOPT_option_base32_auto(shortName, name, argumentHelp, description, val)
 Allow user to specify a binary value using Crockford Base32 encoding where the size of the binary value is automatically determined from its type. More...
 
#define GNUNET_GETOPT_OPTION_END
 Marker for the end of the list of options. More...
 

Typedefs

typedef int(* GNUNET_GETOPT_CommandLineOptionProcessor) (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value)
 Process a command line option. More...
 

Functions

struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_help (const char *about)
 Defining the option to print the command line help text (-h option). More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_version (const char *version)
 Define the option to print the version of the application (-v option) More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_logfile (char **logfn)
 Allow user to specify log file name (-l option) More...
 
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. More...
 
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). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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). More...
 
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). More...
 
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. More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_loglevel (char **level)
 Define the '-L' log level option. More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_verbose (unsigned int *level)
 Define the '-V' verbosity option. More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_cfgfile (char **fn)
 Allow user to specify configuration file name (-c option) More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_mandatory (struct GNUNET_GETOPT_CommandLineOption opt)
 Make the given option mandatory. More...
 
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_exclusive (struct GNUNET_GETOPT_CommandLineOption opt)
 Make the given option mutually exclusive with other options. More...
 
int GNUNET_GETOPT_run (const char *binaryOptions, const struct GNUNET_GETOPT_CommandLineOption *allOptions, unsigned int argc, char *const *argv)
 Parse the command line. More...
 

Detailed Description

Author
Christian Grothoff

Command line parsing and –help formatting

Definition in file gnunet_getopt_lib.h.