1 |
/* |
2 |
* Copyright (c) 2002 Erik Fears |
3 |
* Copyright (c) 2014-2021 ircd-hybrid development team |
4 |
* |
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 |
#ifndef OPERCMD_H |
22 |
#define OPERCMD_H |
23 |
|
24 |
struct OperCommandHash |
25 |
{ |
26 |
const char *command; |
27 |
void (*handler)(char *, const char *); |
28 |
}; |
29 |
|
30 |
struct Command |
31 |
{ |
32 |
node_t node; /**< List node; linked into COMMANDS */ |
33 |
|
34 |
/* Points to specific entry in COMMAND_TABLE in opercmd.c */ |
35 |
const struct OperCommandHash *tab; |
36 |
|
37 |
/* 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 |
|
45 |
/* Who ordered it. */ |
46 |
char *irc_nick; |
47 |
|
48 |
/* Where the reply is to be sent. */ |
49 |
const char *target; |
50 |
|
51 |
/* |
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 |
}; |
57 |
|
58 |
extern void command_init(void); |
59 |
extern void command_userhost(const char *); |
60 |
extern void command_timer(void); |
61 |
extern void command_parse(const char *, const char *, const char *); |
62 |
#endif |