port fix from branch_1_1
[freeradius.git] / src / include / modpriv.h
1 /* modpriv.h: Stuff needed by both modules.c and modcall.c, but should not be
2  * accessed from anywhere else.
3  *
4  * Version: $Id$ */
5 #include <freeradius-devel/radiusd.h>
6 #include <freeradius-devel/modules.h>
7 #include "ltdl.h"
8
9 /*
10  *      Keep track of which modules we've loaded.
11  */
12 typedef struct module_entry_t {
13         char                    name[MAX_STRING_LEN];
14         const module_t          *module;
15         lt_dlhandle             handle;
16 } module_entry_t;
17
18 /*
19  *      Per-instance data structure, to correlate the modules
20  *      with the instance names (may NOT be the module names!),
21  *      and the per-instance data structures.
22  */
23 typedef struct module_instance_t {
24         char                    name[MAX_STRING_LEN];
25         module_entry_t          *entry;
26         void                    *insthandle;
27 #ifdef HAVE_PTHREAD_H
28         pthread_mutex_t         *mutex;
29 #endif
30 } module_instance_t;
31
32 module_instance_t *find_module_instance(CONF_SECTION *, const char *instname);