]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/parse.h
ef42be1456b0ce5099799213963a029e7881d5af
[ngircd-alex.git] / src / ngircd / parse.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
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  * Please read the file COPYING, README and AUTHORS for more information.
10  */
11
12
13 #ifndef __parse_h__
14 #define __parse_h__
15
16 /**
17  * @file
18  * IRC command parser and validator (header)
19  */
20
21 #include "portab.h"
22
23 typedef struct _REQUEST                 /* vgl. RFC 2812, 2.3 */
24 {
25         char *prefix;                   /* Prefix */
26         char *command;                  /* IRC-Befehl */
27         char *argv[15];                 /* Parameter (max. 15: 0..14) */
28         int argc;                       /* Anzahl vorhandener Parameter */
29 } REQUEST;
30
31
32 typedef struct _COMMAND
33 {
34         const char *name;               /* command name */
35         bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
36         CLIENT_TYPE type;               /* valid client types (bit mask) */
37         long lcount, rcount;            /* number of local and remote calls */
38         long bytes;                     /* number of bytes created */
39 } COMMAND;
40
41
42 GLOBAL bool Parse_Request PARAMS((CONN_ID Idx, char *Request ));
43
44 GLOBAL COMMAND *Parse_GetCommandStruct PARAMS(( void ));
45
46 #endif
47
48
49 /* -eof- */