21#if ! defined (__GNUNET_UTIL_LIB_H_INSIDE__)
22#error "Only <gnunet_util_lib.h> can be included directly."
40#ifndef GNUNET_PROGRAM_LIB_H
41#define GNUNET_PROGRAM_LIB_H
92 const char *binaryName,
93 const char *binaryHelp,
97 int run_without_scheduler);
119 const char *binaryName,
120 const char *binaryHelp,
127 const char *daemon_desc,
138#ifndef HAVE_GNUNET_MONOLITH
139#define GNUNET_DAEMON_MAIN(daemon_name, daemon_help, init_cb) \
145 struct GNUNET_GETOPT_CommandLineOption options[] = { \
146 GNUNET_GETOPT_OPTION_END \
148 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, \
151 ret = GNUNET_PROGRAM_run (argc, \
158 GNUNET_free_nz ((void*) argv); \
162#define GNUNET_DAEMON_MAIN(daemon_name, daemon_help, init_cb) \
164 int __attribute__ ((constructor)) \
167 return GNUNET_DAEMON_register (daemon_name, \
struct GNUNET_GETOPT_CommandLineOption options[]
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Command line parsing and –help formatting.
API to schedule computations using continuation passing style.
GNUNET_GenericReturnValue
Named constants for return values.
enum GNUNET_GenericReturnValue GNUNET_DAEMON_register(const char *daemon_name, const char *daemon_desc, GNUNET_PROGRAM_Main task)
void GNUNET_DAEMON_main(int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_GenericReturnValue with_scheduler)
Run the mainloop in a monolithic libgnunet.
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,...
void(* GNUNET_PROGRAM_Main)(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run.
void GNUNET_PROGRAM_monolith_main(int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg)
Start all services and daemons in a single process.
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,...
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_conf_and_options(int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg)
Create configuration handle from options and configuration file.
Definition of a command line option.