1 |
michael |
5351 |
/* |
2 |
|
|
* Copyright (c) 2002 Erik Fears |
3 |
michael |
9865 |
* Copyright (c) 2014-2021 ircd-hybrid development team |
4 |
michael |
5351 |
* |
5 |
|
|
* This program is free software; you can redistribute it and/or modify |
6 |
|
|
* it under the terms of the GNU General Public License as published by |
7 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
8 |
|
|
* (at your option) any later version. |
9 |
|
|
* |
10 |
|
|
* This program is distributed in the hope that it will be useful, |
11 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
|
* GNU General Public License for more details. |
14 |
|
|
* |
15 |
|
|
* You should have received a copy of the GNU General Public License |
16 |
|
|
* along with this program; if not, write to the Free Software |
17 |
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
18 |
|
|
* USA |
19 |
|
|
*/ |
20 |
|
|
|
21 |
michael |
5052 |
#ifndef OPERCMD_H |
22 |
|
|
#define OPERCMD_H |
23 |
|
|
|
24 |
michael |
5287 |
struct OperCommandHash |
25 |
|
|
{ |
26 |
|
|
const char *command; |
27 |
michael |
8193 |
void (*handler)(char *, const char *); |
28 |
michael |
5287 |
}; |
29 |
|
|
|
30 |
michael |
5052 |
struct Command |
31 |
|
|
{ |
32 |
michael |
8579 |
node_t node; /**< List node; linked into COMMANDS */ |
33 |
|
|
|
34 |
michael |
5287 |
/* Points to specific entry in COMMAND_TABLE in opercmd.c */ |
35 |
|
|
const struct OperCommandHash *tab; |
36 |
michael |
5052 |
|
37 |
michael |
5120 |
/* Command parameter. |
38 |
|
|
* <erik> but i cant think of any commands bopm will ever have that is |
39 |
|
|
* multiple parameters |
40 |
|
|
* |
41 |
|
|
* I still havn't -Erik 12/11/02 |
42 |
|
|
*/ |
43 |
|
|
char *param; |
44 |
michael |
5052 |
|
45 |
michael |
5120 |
/* Who ordered it. */ |
46 |
|
|
char *irc_nick; |
47 |
michael |
5052 |
|
48 |
michael |
5120 |
/* Where the reply is to be sent. */ |
49 |
michael |
8193 |
const char *target; |
50 |
michael |
5052 |
|
51 |
michael |
5120 |
/* |
52 |
|
|
* When it was added, because we might need to remove it if it does |
53 |
|
|
* not get executed. |
54 |
|
|
*/ |
55 |
|
|
time_t added; |
56 |
michael |
5052 |
}; |
57 |
|
|
|
58 |
|
|
extern void command_init(void); |
59 |
michael |
5291 |
extern void command_userhost(const char *); |
60 |
michael |
5052 |
extern void command_timer(void); |
61 |
michael |
8193 |
extern void command_parse(const char *, const char *, const char *); |
62 |
michael |
5052 |
#endif |