1 |
adx |
30 |
/* |
2 |
michael |
2865 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
adx |
30 |
* |
4 |
michael |
2865 |
* Copyright (c) 2000-2014 ircd-hybrid development team |
5 |
adx |
30 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
19 |
|
|
* USA |
20 |
|
|
*/ |
21 |
|
|
|
22 |
michael |
2865 |
/*! \file modules.h |
23 |
|
|
* \brief A header for the modules functions. |
24 |
|
|
* \version $Id$ |
25 |
|
|
*/ |
26 |
|
|
|
27 |
adx |
30 |
#ifndef INCLUDED_modules_h |
28 |
|
|
#define INCLUDED_modules_h |
29 |
|
|
|
30 |
michael |
1448 |
#define MODULE_FLAG_CORE 0x1 |
31 |
|
|
#define MODULE_FLAG_NOUNLOAD 0x2 |
32 |
michael |
1230 |
|
33 |
adx |
30 |
struct module |
34 |
|
|
{ |
35 |
|
|
dlink_node node; |
36 |
|
|
char *name; |
37 |
|
|
const char *version; |
38 |
michael |
255 |
void *handle; |
39 |
michael |
1230 |
void (*modinit)(void); |
40 |
|
|
void (*modexit)(void); |
41 |
|
|
unsigned int flags; |
42 |
adx |
30 |
}; |
43 |
|
|
|
44 |
|
|
struct module_path |
45 |
|
|
{ |
46 |
|
|
dlink_node node; |
47 |
michael |
1737 |
char path[HYB_PATH_MAX + 1]; |
48 |
adx |
30 |
}; |
49 |
|
|
|
50 |
michael |
1447 |
extern dlink_list modules_list; |
51 |
|
|
|
52 |
adx |
30 |
/* add a path */ |
53 |
|
|
extern void mod_add_path(const char *); |
54 |
|
|
extern void mod_clear_paths(void); |
55 |
|
|
|
56 |
|
|
/* load all modules */ |
57 |
|
|
extern void load_all_modules(int); |
58 |
|
|
|
59 |
|
|
/* load core modules */ |
60 |
|
|
extern void load_core_modules(int); |
61 |
|
|
|
62 |
|
|
/* Add this module to list of modules to be loaded from conf */ |
63 |
|
|
extern void add_conf_module(const char *); |
64 |
|
|
/* load all modules listed in conf */ |
65 |
|
|
extern void load_conf_modules(void); |
66 |
michael |
1404 |
extern void modules_init(void); |
67 |
adx |
30 |
|
68 |
michael |
978 |
extern int unload_one_module(const char *, int); |
69 |
michael |
943 |
extern int modules_valid_suffix(const char *); |
70 |
michael |
1404 |
extern int load_one_module(const char *); |
71 |
|
|
extern int load_a_module(const char *, int); |
72 |
michael |
1230 |
extern struct module *findmodule_byname(const char *); |
73 |
adx |
30 |
#endif /* INCLUDED_modules_h */ |