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