/[cvs]/botnetop.mod/botnetop.c
ViewVC logotype

Contents of /botnetop.mod/botnetop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Mon Aug 14 01:47:33 2000 UTC (18 years, 8 months ago) by guppy
Branch: MAIN
Changes since 1.1: +2 -0 lines
File MIME type: text/x-chdr
added Id tags

1 /*
2 * $Id$
3 *
4 * Copyright (C) 2000 Teemu Hjelt <temex@iki.fi>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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, USA.
19 */
20
21 #define MODULE_NAME "botnetop"
22 #define MAKING_BOTNETOP
23 #define MODULE_VERSION "0.2.0"
24 #include "../module.h"
25 #include "../irc.mod/irc.h"
26 #include "../server.mod/server.h"
27 #include "../channels.mod/channels.h"
28
29 #undef global
30 static Function *global = NULL, *irc_funcs = NULL, *server_funcs = NULL, *channels_funcs = NULL;
31
32 #include "botnetop.h"
33
34 static int strict_host = 1;
35 static int bop_modeop = 0;
36 static int bop_linkop = 1;
37 static int bop_osync = 0;
38 static int bop_addhost = 0;
39 static int bop_log = 2;
40
41 #include "misc.c"
42 #include "botcmds.c"
43 #include "ircbinds.c"
44 #include "botbinds.c"
45 #include "tclcmds.c"
46
47 static int botnetop_expmem()
48 {
49 return 0;
50 }
51
52 static void botnetop_report(int idx, int details)
53 {
54 if (details) {
55 dprintf(idx, " Tcl commands: bop_reqop, bop_letmein\n");
56 dprintf(idx, " Tcl variables: bop_modeop, bop_linkop, bop_osync, bop_addhost, bop_log\n");
57 }
58 }
59
60 static tcl_ints botnetop_tcl_ints[] =
61 {
62 {"strict-host", &strict_host, 0},
63 {"bop_modeop", &bop_modeop, 0},
64 {"bop_linkop", &bop_linkop, 0},
65 {"bop_osync", &bop_osync, 0},
66 {"bop_addhost", &bop_addhost, 0},
67 {"bop_log", &bop_log, 0},
68 {0, 0, 0}
69 };
70
71 static char *botnetop_close()
72 {
73 Context;
74 rem_builtins(H_join, botnetop_join);
75 rem_builtins(H_mode, botnetop_mode);
76 rem_builtins(H_link, botnetop_link);
77 rem_builtins(H_bot, botnetop_bot);
78 rem_tcl_ints(botnetop_tcl_ints);
79 rem_tcl_commands(botnetop_tcl_cmds);
80 module_undepend(MODULE_NAME);
81 return NULL;
82 }
83
84 char *botnetop_start();
85
86 static Function botnetop_table[] =
87 {
88 (Function) botnetop_start,
89 (Function) botnetop_close,
90 (Function) botnetop_expmem,
91 (Function) botnetop_report,
92 };
93
94 char *botnetop_start(Function * global_funcs)
95 {
96 global = global_funcs;
97 Context;
98 module_register(MODULE_NAME, botnetop_table, 0, 2);
99 if (!(irc_funcs = module_depend(MODULE_NAME, "irc", 1, 0)))
100 return "You need the irc module to use the botnetop module.";
101 if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0)))
102 return "You need the server module to use the botnetop module.";
103 if (!(channels_funcs = module_depend(MODULE_NAME, "channels", 1, 0)))
104 return "You need the channels module to use the botnetop module.";
105 if (!module_depend(MODULE_NAME, "eggdrop", 105, 0))
106 return "This module requires eggdrop1.5.0 or later";
107 add_builtins(H_join, botnetop_join);
108 add_builtins(H_mode, botnetop_mode);
109 add_builtins(H_link, botnetop_link);
110 add_builtins(H_bot, botnetop_bot);
111 add_tcl_ints(botnetop_tcl_ints);
112 add_tcl_commands(botnetop_tcl_cmds);
113 putlog(LOG_MISC, "*", "botnetop.mod v%s by Sup loaded.", MODULE_VERSION);
114 return NULL;
115 }

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23