X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fcommand_parse.h;h=cbcbea2d8382b205eaeeefcb6add4e9bf877e85a;hb=86ce62c9e6ea6db43703ee5017dd4acd323e9959;hp=98e189f9ace9aa1ad9184e1ef73f842116273d3b;hpb=696ee9ff66bb94be2229bfa9c3dc288affc38a72;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/command_parse.h b/include/command_parse.h index 98e189f9a..cbcbea2d8 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -28,7 +28,7 @@ typedef std::map SharedObjectList; * call command handlers by name, and chop up comma seperated * parameters into multiple calls. */ -class CommandParser : public classbase +class CoreExport CommandParser : public classbase { private: /** The creator of this class @@ -72,6 +72,12 @@ class CommandParser : public classbase */ void LoadCommand(const char* name); + /** Removes a command if the sources match. Used as a helper for + * safe hash_map delete while iter in RemoveCommands(const char* source). + */ + void RemoveCommand(nspace::hash_map::iterator safei, const char* source); + + public: /** Command list, a hash_map of command names to command_t* */ @@ -199,6 +205,32 @@ class cmd_reload : public command_t CmdResult Handle(const char** parameters, int pcnt, userrec *user); }; - +/** A lookup table of values for multiplier characters used by + * InspIRCd::Duration(). In this lookup table, the indexes for + * the ascii values 'm' and 'M' have the value '60', the indexes + * for the ascii values 'D' and 'd' have a value of '86400', etc. + */ +const int duration_multi[] = +{ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 86400, 1, 1, 1, 3600, + 1, 1, 1, 1, 60, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 604800, 1, 31536000, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 86400, 1, 1, 1, 3600, 1, 1, 1, 1, 60, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 604800, 1, 31536000, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; #endif +