GNUnet  0.17.6
gnunet_plugin_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 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_PLUGIN_LIB_H
37 #define GNUNET_PLUGIN_LIB_H
38 
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #if 0 /* keep Emacsens' auto-indent happy */
43 }
44 #endif
45 #endif
46 
47 #include "gnunet_common.h"
49 
50 
59 typedef void *
60 (*GNUNET_PLUGIN_Callback) (void *arg);
61 
62 
72 int
73 GNUNET_PLUGIN_test (const char *library_name);
74 
75 
88 void *
89 GNUNET_PLUGIN_load (const char *library_name,
90  void *arg);
91 
92 
103 typedef void
104 (*GNUNET_PLUGIN_LoaderCallback) (void *cls,
105  const char *library_name,
106  void *lib_ret);
107 
108 
121 void
122 GNUNET_PLUGIN_load_all (const char *basename,
123  void *arg,
125  void *cb_cls);
126 
127 
142 void
144  const char *basename,
145  void *arg,
147  void *cb_cls);
148 
149 
159 void *
160 GNUNET_PLUGIN_unload (const char *library_name,
161  void *arg);
162 
163 
164 #if 0 /* keep Emacsens' auto-indent happy */
165 {
166 #endif
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 /* ifndef GNUNET_PLUGIN_LIB_H */
172 #endif
173  /* end of group */
175  /* end of group addition */
177 
178 /* end of gnunet_plugin_lib.h */
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Configuration API.
void GNUNET_PLUGIN_load_all(const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls)
Load all compatible plugins with the given base name.
Definition: plugin.c:358
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
Definition: plugin.c:241
int GNUNET_PLUGIN_test(const char *library_name)
Test if a plugin exists.
Definition: plugin.c:167
void * GNUNET_PLUGIN_load(const char *library_name, void *arg)
Setup plugin (runs the "init" callback and returns whatever "init" returned).
Definition: plugin.c:197
void GNUNET_PLUGIN_load_all_in_context(const struct GNUNET_OS_ProjectData *ctx, const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls)
Load all compatible plugins with the given base name while inside the given context (i....
Definition: plugin.c:385
void(* GNUNET_PLUGIN_LoaderCallback)(void *cls, const char *library_name, void *lib_ret)
Signature of a function called by GNUNET_PLUGIN_load_all().
Project-specific data used to help the OS subsystem find installation paths.