1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
21 #include "inspircd_config.h"
27 /*typedef void (handlerfunc) (char**, int, userrec*);*/
29 /** A structure that defines a command
31 class command_t : public Extensible
37 /** User flags needed to execute the command or 0
40 /** Minimum number of parameters command takes
49 /** used for resource tracking between modules
52 /** True if the command is disabled to non-opers
55 /** Syntax string for the command, displayed if non-empty string.
56 * This takes place of the text in the 'not enough parameters' numeric.
60 command_t(const std::string &cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara), disabled(false)
62 use_count = total_bytes = 0;
67 virtual void Handle(const char** parameters, int pcnt, userrec* user) = 0;
69 void Disable(bool setting)
79 virtual ~command_t() {}
82 typedef nspace::hash_map<std::string,command_t*> command_table;