ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/modules.h
Revision: 1230
Committed: Thu Sep 22 19:41:19 2011 UTC (13 years, 11 months ago) by michael
Content type: text/x-chdr
Original Path: ircd-hybrid-8/include/modules.h
File size: 2231 byte(s)
Log Message:
- cleanup module loader. Make module api more flexible

File Contents

# Content
1 /*
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 * $Id$
23 */
24
25 #ifndef INCLUDED_modules_h
26 #define INCLUDED_modules_h
27
28 #include "config.h"
29 #include "parse.h"
30
31 #include "ircd_handler.h"
32 #include "msg.h"
33 #include "memory.h"
34
35
36 #define MODULE_FLAG_CORE 0x1
37
38 struct module
39 {
40 dlink_node node;
41 char *name;
42 const char *version;
43 void *handle;
44 void (*modinit)(void);
45 void (*modexit)(void);
46 void (*modremove)(void);
47 unsigned int flags;
48 int core;
49 };
50
51 struct module_path
52 {
53 dlink_node node;
54 char path[PATH_MAX + 1];
55 };
56
57 extern dlink_list mod_list;
58
59 /* add a path */
60 extern void mod_add_path(const char *);
61 extern void mod_clear_paths(void);
62
63 /* load all modules */
64 extern void load_all_modules(int);
65
66 /* load core modules */
67 extern void load_core_modules(int);
68
69 /* Add this module to list of modules to be loaded from conf */
70 extern void add_conf_module(const char *);
71 /* load all modules listed in conf */
72 extern void load_conf_modules(void);
73
74 extern void _modinit(void);
75 extern void _moddeinit(void);
76
77 extern void dynlink_init(void);
78 extern int unload_one_module(const char *, int);
79 extern int modules_valid_suffix(const char *);
80 extern int load_one_module(const char *, int);
81 extern int load_a_module(const char *, int, int);
82 extern struct module *findmodule_byname(const char *);
83 extern void modules_init(void);
84 #endif /* INCLUDED_modules_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision