2005-12-16 09:56:33 +00:00
|
|
|
/* +------------------------------------+
|
|
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
|
|
* +------------------------------------+
|
|
|
|
*
|
2006-01-15 15:59:11 +00:00
|
|
|
* InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
|
2005-12-16 09:56:33 +00:00
|
|
|
* E-mail:
|
|
|
|
* <brain@chatspike.net>
|
|
|
|
* <Craig@chatspike.net>
|
|
|
|
*
|
|
|
|
* Written by Craig Edwards, Craig McLure, and others.
|
|
|
|
* This program is free but copyrighted software; see
|
|
|
|
* the file COPYING for details.
|
|
|
|
*
|
|
|
|
* ---------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __COMMAND_PARSE_H
|
|
|
|
#define __COMMAND_PARSE_H
|
|
|
|
|
|
|
|
#include <typeinfo>
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
#include "users.h"
|
2005-12-16 10:38:28 +00:00
|
|
|
#include "ctables.h"
|
|
|
|
#include "typedefs.h"
|
2005-12-16 09:56:33 +00:00
|
|
|
|
2005-12-16 10:22:16 +00:00
|
|
|
class CommandParser
|
|
|
|
{
|
2005-12-16 10:38:28 +00:00
|
|
|
private:
|
2006-01-02 21:40:02 +00:00
|
|
|
int ProcessParameters(char **command_p,char *parameters);
|
|
|
|
void ProcessCommand(userrec *user, char* cmd);
|
2005-12-16 10:38:28 +00:00
|
|
|
void SetupCommandTable();
|
2005-12-16 10:22:16 +00:00
|
|
|
public:
|
2005-12-16 10:38:28 +00:00
|
|
|
command_table cmdlist;
|
|
|
|
|
|
|
|
CommandParser();
|
2006-03-11 16:56:07 +00:00
|
|
|
bool CallHandler(const std::string &commandname,char **parameters, int pcnt, userrec *user);
|
|
|
|
bool IsValidCommand(const std::string &commandname, int pcnt, userrec * user);
|
2005-12-16 18:10:38 +00:00
|
|
|
int LoopCall(command_t *fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
|
2005-12-16 10:22:16 +00:00
|
|
|
void ProcessBuffer(const char* cmdbuf,userrec *user);
|
|
|
|
bool RemoveCommands(const char* source);
|
2005-12-16 18:10:38 +00:00
|
|
|
bool CreateCommand(command_t *f);
|
2005-12-16 10:22:16 +00:00
|
|
|
};
|
2005-12-16 09:56:33 +00:00
|
|
|
|
|
|
|
#endif
|