GNUnet  0.10.x
gnunet_program_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001-2013 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
32 #ifndef GNUNET_PROGRAM_LIB_H
33 #define GNUNET_PROGRAM_LIB_H
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #if 0 /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42 
44 #include "gnunet_getopt_lib.h"
45 #include "gnunet_scheduler_lib.h"
46 
55 typedef void
56 (*GNUNET_PROGRAM_Main) (void *cls,
57  char *const *args,
58  const char *cfgfile,
59  const struct GNUNET_CONFIGURATION_Handle *cfg);
60 
61 
77 int
78 GNUNET_PROGRAM_run2 (int argc,
79  char *const *argv,
80  const char *binaryName,
81  const char *binaryHelp,
84  void *task_cls,
85  int run_without_scheduler);
86 
87 
101 int
102 GNUNET_PROGRAM_run (int argc,
103  char *const *argv,
104  const char *binaryName,
105  const char *binaryHelp,
107  GNUNET_PROGRAM_Main task,
108  void *task_cls);
109 
110 
111 #if 0 /* keep Emacsens' auto-indent happy */
112 {
113 #endif
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 /* ifndef GNUNET_PROGRAM_LIB_H */
119 #endif
120  /* end of group program */
122 
123 /* end of gnunet_program_lib.h */
void(* GNUNET_PROGRAM_Main)(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run.
int 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).
Definition: program.c:141
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
Definition of a command line option.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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:361