]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/parse.h
When sending an error use the IRC_WriteErrClient() variant
[ngircd-alex.git] / src / ngircd / parse.h
index d11a9bae279b046bd813ea03495b3dbc19d9448a..beac227521b6d1d677df721b617f795b7e44bd62 100644 (file)
@@ -1,54 +1,50 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
  *
- * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
- * der GNU General Public License (GPL), wie von der Free Software Foundation
- * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
- * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
- * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
- * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
- *
- * $Id: parse.h,v 1.3 2001/12/31 02:18:51 alex Exp $
- *
- * parse.h: Parsen der Client-Anfragen (Header)
- *
- * $Log: parse.h,v $
- * Revision 1.3  2001/12/31 02:18:51  alex
- * - viele neue Befehle (WHOIS, ISON, OPER, DIE, RESTART),
- * - neuen Header "defines.h" mit (fast) allen Konstanten.
- * - Code Cleanups und viele "kleine" Aenderungen & Bugfixes.
- *
- * Revision 1.2  2001/12/26 14:45:37  alex
- * - "Code Cleanups".
- *
- * Revision 1.1  2001/12/21 23:53:16  alex
- * - Modul zum Parsen von Client-Requests begonnen.
+ * 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.
+ * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #ifndef __parse_h__
 #define __parse_h__
 
-#include "conn.h"
+/**
+ * @file
+ * IRC command parser and validator (header)
+ */
 
+#include "portab.h"
 
-typedef struct _REQUEST                        /* vgl. RFC 2812, 2.3 */
+/** A single IRC request ("command"). See RFC 2812 section 2.3 for details. */
+typedef struct _REQUEST
 {
-       CHAR *prefix;                   /* Prefix */
-       CHAR *command;                  /* IRC-Befehl */
-       CHAR *argv[15];                 /* Parameter (max. 15: 0..14) */
-       INT argc;                       /* Anzahl vorhandener Parameter */
+       char *prefix;                   /**< Prefix */
+       char *command;                  /**< IRC command */
+       char *argv[15];                 /**< Parameters, at most 15 (0..14) */
+       int argc;                       /**< Number of given paramaters */
 } REQUEST;
 
+/** IRC command handling structure */
+typedef struct _COMMAND
+{
+       const char *name;               /**< Command name */
+       bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
+                                       /**< Function to handle this command */
+       CLIENT_TYPE type;               /**< Valid client types (bit mask) */
+       int min_argc;                   /**< Min parameters */
+       int max_argc;                   /**< Max parameters */
+       long lcount, rcount;            /**< Number of local and remote calls */
+       long bytes;                     /**< Number of bytes created */
+} COMMAND;
 
-GLOBAL VOID Parse_Init( VOID );
-GLOBAL VOID Parse_Exit( VOID );
-
-GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request );
+GLOBAL bool Parse_Request PARAMS((CONN_ID Idx, char *Request ));
 
+GLOBAL COMMAND *Parse_GetCommandStruct PARAMS(( void ));
 
 #endif
 
-
 /* -eof- */