parse.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * $Id: parse.h,v 1.11 2005/03/19 18:43:49 fw Exp $
  12. *
  13. * IRC command parser and validator (header)
  14. */
  15. #ifndef __parse_h__
  16. #define __parse_h__
  17. #include "portab.h"
  18. typedef struct _REQUEST /* vgl. RFC 2812, 2.3 */
  19. {
  20. char *prefix; /* Prefix */
  21. char *command; /* IRC-Befehl */
  22. char *argv[15]; /* Parameter (max. 15: 0..14) */
  23. int argc; /* Anzahl vorhandener Parameter */
  24. } REQUEST;
  25. typedef struct _COMMAND
  26. {
  27. char *name; /* command name */
  28. bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
  29. CLIENT_TYPE type; /* valid client types (bit mask) */
  30. long lcount, rcount; /* number of local and remote calls */
  31. long bytes; /* number of bytes created */
  32. } COMMAND;
  33. GLOBAL bool Parse_Request PARAMS((CONN_ID Idx, char *Request ));
  34. GLOBAL COMMAND *Parse_GetCommandStruct PARAMS(( void ));
  35. #endif
  36. /* -eof- */