GNUnet  0.11.x
001.c
Go to the documentation of this file.
1 #include <gnunet/platform.h>
2 #include <gnunet/gnunet_util_lib.h>
3 
4 static int ret;
5 
6 static void
7 run (void *cls,
8  char *const *args,
9  const char *cfgfile,
10  const struct GNUNET_CONFIGURATION_Handle *cfg)
11 {
12  // main code here
13  ret = 0;
14 }
15 
16 int
17 main (int argc, char *const *argv)
18 {
19  struct GNUNET_GETOPT_CommandLineOption options[] = {
21  };
22  return (GNUNET_OK ==
23  GNUNET_PROGRAM_run (argc,
24  argv,
25  "binary-name",
26  gettext_noop ("binary description text"),
27  options, &run, NULL)) ? ret : 1;
28 }
29 
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
Definition of a command line option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
int main(int argc, char *const *argv)
Definition: 001.c:17
static int ret
Definition: 001.c:4
configuration data
Definition: configuration.c:85
int 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).
Definition: program.c:367
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Definition: 001.c:7
#define gettext_noop(String)
Definition: gettext.h:69