This repository has been archived by the owner on Aug 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.c
81 lines (77 loc) · 2.29 KB
/
commands.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* commands.c: The command table for efserv.
* This is part of efserv, a services.int implementation.
* efserv is Copyright(C) 2001 by Andrew Miller, and others.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA.
* $Id: commands.c,v 1.12 2001/12/10 07:47:19 a1kmm Exp $
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include "config.h"
#include "define.h"
#include "struct.h"
#include "utils.h"
void m_ping(char *, int, char **);
void m_part(char *, int, char **);
void m_join(char *, int, char **);
void m_server(char *, int, char **);
void m_nick(char *, int, char **);
void m_squit(char *, int, char **);
void m_quit(char *, int, char **);
void m_kill(char *, int, char **);
void m_mode(char *, int, char **);
void m_privmsg(char *, int, char **);
void m_sjoin(char *, int, char **);
void m_admin(char *, int, char **);
void m_motd(char *, int, char **);
void m_version(char *, int, char **);
void m_whois(char *, int, char **);
void m_error(char *, int, char **);
void m_kick(char *, int, char **);
struct Command Commands[] = {
{"PING", m_ping},
{"SERVER", m_server},
{"NICK", m_nick},
{"SQUIT", m_squit},
{"QUIT", m_quit},
{"KILL", m_kill},
{"MODE", m_mode},
{"PRIVMSG", m_privmsg},
{"SJOIN", m_sjoin},
{"VERSION", m_version},
{"ADMIN", m_admin},
{"MOTD", m_motd},
{"PART", m_part},
{"JOIN", m_join},
{"WHOIS", m_whois},
{"ERROR", m_error},
{"KICK", m_kick},
{0, 0}
};
void
hash_commands(void)
{
struct Command *cmd;
for (cmd = Commands; cmd; cmd++)
{
if (cmd->name == NULL)
return;
add_to_hash(HASH_COMMAND, cmd->name, cmd);
}
}