| 1 |
|
/* |
| 2 |
< |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
| 3 |
< |
* parse.h: A header for the message parser. |
| 2 |
> |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (C) 2002 by the past and present ircd coders, and others. |
| 4 |
> |
* Copyright (c) 1997-2014 ircd-hybrid development team |
| 5 |
|
* |
| 6 |
|
* This program is free software; you can redistribute it and/or modify |
| 7 |
|
* it under the terms of the GNU General Public License as published by |
| 17 |
|
* along with this program; if not, write to the Free Software |
| 18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 |
|
* USA |
| 20 |
< |
* |
| 21 |
< |
* $Id$ |
| 20 |
> |
*/ |
| 21 |
> |
|
| 22 |
> |
/*! \file parse.h |
| 23 |
> |
* \brief A header for the message parser. |
| 24 |
> |
* \version $Id$ |
| 25 |
|
*/ |
| 26 |
|
|
| 27 |
|
#ifndef INCLUDED_parse_h |
| 110 |
|
* int parc - parameter count |
| 111 |
|
* char* parv[] - parameter vector |
| 112 |
|
*/ |
| 113 |
< |
typedef void (*MessageHandler)(struct Client *, struct Client *, int, char *[]); |
| 113 |
> |
typedef int (*MessageHandler)(struct Client *, struct Client *, int, char *[]); |
| 114 |
|
|
| 115 |
< |
/* |
| 116 |
< |
* Message table structure |
| 115 |
> |
/* |
| 116 |
> |
* Message table structure |
| 117 |
|
*/ |
| 118 |
|
struct Message |
| 119 |
|
{ |
| 121 |
|
unsigned int count; /* number of times command used */ |
| 122 |
|
unsigned int rcount; /* number of times command used by server */ |
| 123 |
|
unsigned int args_min; /* at least this many args must be passed |
| 124 |
< |
* or an error will be sent to the user |
| 125 |
< |
* before the m_func is even called |
| 124 |
> |
* or an error will be sent to the user |
| 125 |
> |
* before the m_func is even called |
| 126 |
|
*/ |
| 127 |
|
unsigned int args_max; /* maximum permitted parameters */ |
| 128 |
|
unsigned int flags; /* bit 0 set means that this command is allowed |
| 147 |
|
* Constants |
| 148 |
|
*/ |
| 149 |
|
#define MFLG_SLOW 0x001 /* Command can be executed roughly |
| 150 |
< |
* once per 2 seconds. |
| 150 |
> |
* once per 2 seconds. |
| 151 |
|
*/ |
| 150 |
– |
#define MFLG_UNREG 0x002 /* Command available to unregistered |
| 151 |
– |
* clients. |
| 152 |
– |
*/ |
| 153 |
– |
|
| 152 |
|
#define MAXPARA 15 |
| 153 |
|
|
| 154 |
|
extern void parse(struct Client *, char *, char *); |
| 158 |
|
extern void report_messages(struct Client *); |
| 159 |
|
|
| 160 |
|
/* generic handlers */ |
| 161 |
< |
extern void rfc1459_command_send_error(struct Client *, struct Client *,int, char *[]); |
| 162 |
< |
extern void m_ignore(struct Client *, struct Client *, int, char *[]); |
| 163 |
< |
extern void m_not_oper(struct Client *, struct Client *, int, char *[]); |
| 164 |
< |
extern void m_registered(struct Client *, struct Client *, int, char *[]); |
| 167 |
< |
extern void m_unregistered(struct Client *, struct Client *, int, char *[]); |
| 168 |
< |
|
| 161 |
> |
extern int m_ignore(struct Client *, struct Client *, int, char *[]); |
| 162 |
> |
extern int m_not_oper(struct Client *, struct Client *, int, char *[]); |
| 163 |
> |
extern int m_registered(struct Client *, struct Client *, int, char *[]); |
| 164 |
> |
extern int m_unregistered(struct Client *, struct Client *, int, char *[]); |
| 165 |
|
#endif /* INCLUDED_parse_h */ |