GNUnet  0.11.x
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 
32 #ifndef GNUNET_PLUGIN_LIB_H
33 #define GNUNET_PLUGIN_LIB_H
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #if 0 /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42 
43 #include "gnunet_common.h"
45 
46 
55 typedef void *
56 (*GNUNET_PLUGIN_Callback) (void *arg);
57 
58 
68 int
69 GNUNET_PLUGIN_test (const char *library_name);
70 
71 
84 void *
85 GNUNET_PLUGIN_load (const char *library_name,
86  void *arg);
87 
88 
99 typedef void
101  const char *library_name,
102  void *lib_ret);
103 
104 
117 void
118 GNUNET_PLUGIN_load_all (const char *basename,
119  void *arg,
121  void *cb_cls);
122 
123 
133 void *
134 GNUNET_PLUGIN_unload (const char *library_name,
135  void *arg);
136 
137 
138 #if 0 /* keep Emacsens' auto-indent happy */
139 {
140 #endif
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 /* ifndef GNUNET_PLUGIN_LIB_H */
146 #endif
147  /* end of group */
149 
150 /* end of gnunet_plugin_lib.h */
void(* GNUNET_PLUGIN_LoaderCallback)(void *cls, const char *library_name, void *lib_ret)
Signature of a function called by GNUNET_PLUGIN_load_all().
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
Definition: plugin.c:256
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:372
void * GNUNET_PLUGIN_load(const char *library_name, void *arg)
Setup plugin (runs the "init" callback and returns whatever "init" returned).
Definition: plugin.c:207
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
int GNUNET_PLUGIN_test(const char *library_name)
Test if a plugin exists.
Definition: plugin.c:166