![]() |
GNUnet
0.11.x
|
Start command-line programs. More...
Typedefs | |
typedef void(* | GNUNET_PROGRAM_Main) (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run. More... | |
Functions | |
enum GNUNET_GenericReturnValue | GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls, int run_without_scheduler) |
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options). More... | |
enum GNUNET_GenericReturnValue | GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls) |
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options). More... | |
Start command-line programs.
typedef void(* GNUNET_PROGRAM_Main) (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 56 of file gnunet_program_lib.h.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run2 | ( | int | argc, |
char *const * | argv, | ||
const char * | binaryName, | ||
const char * | binaryHelp, | ||
const struct GNUNET_GETOPT_CommandLineOption * | options, | ||
GNUNET_PROGRAM_Main | task, | ||
void * | task_cls, | ||
int | run_without_scheduler | ||
) |
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
argc | number of command line arguments in argv |
argv | command line arguments |
binaryName | our expected name |
binaryHelp | help text for the program |
options | command line options |
task | main function to run |
task_cls | closure for task |
run_without_scheduler | GNUNET_NO start the scheduler, GNUNET_YES do not start the scheduler just run the main task |
Definition at line 126 of file program.c.
References _, CommandContext::args, bindtextdomain, CommandContext::cfg, CommandContext::cfgfile, cleanup(), cmd_sorter(), GNUNET_OS_ProjectData::config_file, DIR_SEPARATOR_STR, getenv(), GNUNET_OS_ProjectData::gettext_domain, GNUNET_OS_ProjectData::gettext_path, GNUNET_array_append, GNUNET_asprintf(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_have_value(), GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GETOPT_option_cfgfile(), GNUNET_GETOPT_option_help(), GNUNET_GETOPT_option_logfile(), GNUNET_GETOPT_option_loglevel(), GNUNET_GETOPT_option_version(), GNUNET_GETOPT_run(), GNUNET_log, GNUNET_log_setup(), GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_OK, GNUNET_OS_installation_get_path(), GNUNET_OS_IPK_LOCALEDIR, GNUNET_OS_project_data_get(), GNUNET_RESOLVER_connect(), GNUNET_SCHEDULER_run(), GNUNET_strdup, GNUNET_SYSERR, GNUNET_TIME_set_offset(), GNUNET_YES, name, program_main(), ret, CommandContext::task, CommandContext::task_cls, textdomain, GNUNET_OS_ProjectData::user_config_file, and GNUNET_OS_ProjectData::version.
Referenced by GNUNET_PROGRAM_run(), and main().
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run | ( | int | argc, |
char *const * | argv, | ||
const char * | binaryName, | ||
const char * | binaryHelp, | ||
const struct GNUNET_GETOPT_CommandLineOption * | options, | ||
GNUNET_PROGRAM_Main | task, | ||
void * | task_cls | ||
) |
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
argc | number of command line arguments |
argv | command line arguments |
binaryName | our expected name |
binaryHelp | helptext for "-h" option (about the app) |
options | command line options |
task | main function to run |
task_cls | closure for task |
Definition at line 363 of file program.c.
References GNUNET_NO, and GNUNET_PROGRAM_run2().
Referenced by GNUNET_TESTBED_test_run(), GNUNET_TRANSPORT_TESTING_connect_check(), and main().