GNUnet  0.17.6
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 
36 #ifndef GNUNET_PROGRAM_LIB_H
37 #define GNUNET_PROGRAM_LIB_H
38 
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #if 0 /* keep Emacsens' auto-indent happy */
43 }
44 #endif
45 #endif
46 
48 #include "gnunet_getopt_lib.h"
49 #include "gnunet_scheduler_lib.h"
50 
59 typedef void
60 (*GNUNET_PROGRAM_Main) (void *cls,
61  char *const *args,
62  const char *cfgfile,
63  const struct GNUNET_CONFIGURATION_Handle *cfg);
64 
65 
85 GNUNET_PROGRAM_run2 (int argc,
86  char *const *argv,
87  const char *binaryName,
88  const char *binaryHelp,
91  void *task_cls,
92  int run_without_scheduler);
93 
94 
112 GNUNET_PROGRAM_run (int argc,
113  char *const *argv,
114  const char *binaryName,
115  const char *binaryHelp,
117  GNUNET_PROGRAM_Main task,
118  void *task_cls);
119 
120 
121 #if 0 /* keep Emacsens' auto-indent happy */
122 {
123 #endif
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 /* ifndef GNUNET_PROGRAM_LIB_H */
129 #endif
130  /* end of group program */
132  /* end of group addition */
134 
135 /* end of gnunet_program_lib.h */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
Configuration API.
Command line parsing and –help formatting.
API to schedule computations using continuation passing style.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:96
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,...
Definition: program.c:131
void(* GNUNET_PROGRAM_Main)(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run.
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,...
Definition: program.c:399
Definition of a command line option.