]> git.decadent.org.uk Git - ion3.git/blob - mod_mgmtmode/main.c
ef62c52bff2497ab5d777c4bcce58b4dd1644983
[ion3.git] / mod_mgmtmode / main.c
1 /*
2  * ion/mod_mgmtmode/main.c
3  *
4  * Copyright (c) Tuomo Valkonen 2004-2007. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #include <libextl/readconfig.h>
13 #include <ioncore/saveload.h>
14 #include <ioncore/bindmaps.h>
15
16 #include "exports.h"
17
18 /*{{{ Module information */
19
20
21 #include "../version.h"
22
23 char mod_mgmtmode_ion_api_version[]=ION_API_VERSION;
24
25
26 /*}}}*/
27
28
29 /*{{{ Bindmaps */
30
31
32 WBindmap *mod_mgmtmode_bindmap=NULL;
33
34
35 /*}}}*/
36
37
38 /*{{{ Init & deinit */
39
40
41 void mod_mgmtmode_deinit()
42 {
43     if(mod_mgmtmode_bindmap!=NULL){
44         ioncore_free_bindmap("WMgmtMode", mod_mgmtmode_bindmap);
45         mod_mgmtmode_bindmap=NULL;
46     }
47
48     mod_mgmtmode_unregister_exports();
49 }
50
51
52 bool mod_mgmtmode_init()
53 {
54     mod_mgmtmode_bindmap=ioncore_alloc_bindmap("WMgmtMode", NULL);
55     
56     if(mod_mgmtmode_bindmap==NULL)
57         return FALSE;
58
59     if(!mod_mgmtmode_register_exports()){
60         mod_mgmtmode_deinit();
61         return FALSE;
62     }
63
64     extl_read_config("cfg_mgmtmode", NULL, TRUE);
65     
66     return TRUE;
67 }
68
69
70 /*}}}*/
71