standard code for GNUnet startup and shutdown More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_resolver_service.h"
#include "gnunet_constants.h"
#include "speedup.h"
#include <gcrypt.h>
Go to the source code of this file.
Data Structures | |
struct | CommandContext |
Context for the command. More... | |
struct | MonoContext |
struct | DaemonHandleList |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "util-program", __VA_ARGS__) |
#define | LOG_STRERROR_FILE(kind, syscall, filename) GNUNET_log_from_strerror_file (kind, "util-program", syscall, filename) |
Functions | |
static void | shutdown_task (void *cls) |
task run when the scheduler shuts down More... | |
static void | program_main (void *cls) |
Initial task called by the scheduler for each program. More... | |
static int | cmd_sorter (const void *a1, const void *a2) |
Compare function for 'qsort' to sort command-line arguments by the short option. More... | |
enum GNUNET_GenericReturnValue | GNUNET_PROGRAM_run2 (const struct GNUNET_OS_ProjectData *pd, 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 (const struct GNUNET_OS_ProjectData *pd, 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... | |
enum GNUNET_GenericReturnValue | GNUNET_PROGRAM_conf_and_options (const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg) |
Create configuration handle from options and configuration file. More... | |
static void | monolith_main (void *cls) |
void | GNUNET_PROGRAM_monolith_main (const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg) |
Start all services and daemons in a single process. More... | |
static void | launch_daemon (void *cls) |
static void | launch_daemons (void *cls) |
void | GNUNET_DAEMON_main (const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_GenericReturnValue with_scheduler) |
Run the mainloop in a monolithic libgnunet. More... | |
enum GNUNET_GenericReturnValue | GNUNET_DAEMON_register (const char *daemon_name, const char *daemon_help, GNUNET_PROGRAM_Main task) |
Variables | |
static struct DaemonHandleList * | hll_head = NULL |
static struct DaemonHandleList * | hll_tail = NULL |
standard code for GNUnet startup and shutdown
Definition in file program.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "util-program", __VA_ARGS__) |
#define LOG_STRERROR_FILE | ( | kind, | |
syscall, | |||
filename | |||
) | GNUNET_log_from_strerror_file (kind, "util-program", syscall, filename) |
|
static |
task run when the scheduler shuts down
Definition at line 76 of file program.c.
References GNUNET_SPEEDUP_stop_().
Referenced by program_main().
|
static |
Initial task called by the scheduler for each program.
Runs the program-specific main task.
Definition at line 88 of file program.c.
References CommandContext::args, CommandContext::cfg, CommandContext::cfgfile, GNUNET_RESOLVER_connect(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SPEEDUP_start_(), shutdown_task(), CommandContext::task, and CommandContext::task_cls.
Referenced by GNUNET_PROGRAM_run2().
|
static |
Compare function for 'qsort' to sort command-line arguments by the short option.
a1 | first command line option |
a2 | second command line option |
Definition at line 111 of file program.c.
References GNUNET_GETOPT_CommandLineOption::shortName.
Referenced by GNUNET_PROGRAM_run2().
|
static |
Definition at line 564 of file program.c.
References GNUNET_DAEMON_main(), GNUNET_NO, GNUNET_SERVICE_main(), and mc.
Referenced by GNUNET_PROGRAM_monolith_main().
|
static |
Definition at line 629 of file program.c.
References DaemonHandleList::cfg, and DaemonHandleList::d.
Referenced by launch_daemons().
|
static |
Definition at line 639 of file program.c.
References cfg, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SCHEDULER_add_now(), hll_head, launch_daemon(), LOG, and DaemonHandleList::next.
Referenced by GNUNET_DAEMON_main().
|
static |
Definition at line 623 of file program.c.
Referenced by GNUNET_DAEMON_register(), and launch_daemons().
|
static |
Definition at line 626 of file program.c.
Referenced by GNUNET_DAEMON_register().