Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / modcall.h
1 #ifndef FR_MODCALL_H
2 #define FR_MODCALL_H
3
4 /* modcall.h: the outside interface to the module-calling tree. Includes
5  * functions to build the tree from the config file, and to call it by
6  * feeding it REQUESTs.
7  *
8  * Version: $Id$ */
9
10 #include <freeradius-devel/conffile.h> /* Need CONF_* definitions */
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 /*
17  *      For each authorize/authtype/etc, we have an ordered
18  *      tree of instances to call.  This data structure keeps track
19  *      of that order.
20  */
21 typedef struct modcallable modcallable;
22
23 int modcall(int component, modcallable *c, REQUEST *request);
24
25 /* Parse a module-method's config section (e.g. authorize{}) into a tree that
26  * may be called with modcall() */
27 modcallable *compile_modgroup(modcallable *parent,
28                               int component, CONF_SECTION *cs);
29
30 /* Create a single modcallable node that references a module instance. This
31  * may be a CONF_SECTION containing action specifiers like "notfound = return"
32  * or a simple CONF_PAIR, in which case the default actions are used. */
33 modcallable *compile_modsingle(modcallable *parent, int component, CONF_ITEM *ci,
34                                const char **modname);
35
36 /* Add an entry to the end of a modgroup, creating it first if necessary */
37 void add_to_modcallable(modcallable **parent, modcallable *this,
38                         int component, const char *name);
39
40 /* Free a tree returned by compile_modgroup or compile_modsingle */
41 void modcallable_free(modcallable **pc);
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif