From 076ebafa1b4cc935c466c615b94eaac415af9a67 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 25 Apr 2011 03:16:57 -0400 Subject: Moved some global functions to be member functions and misc cleanup --- include/anope.h | 12 ++++++++++++ include/extern.h | 14 -------------- include/modules.h | 14 +++++++++++++- include/regchannel.h | 6 ++++++ include/users.h | 6 ++++++ 5 files changed, 37 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/anope.h b/include/anope.h index 7aa505661..fb201db1e 100644 --- a/include/anope.h +++ b/include/anope.h @@ -335,6 +335,18 @@ namespace Anope */ extern CoreExport void Unhex(const Anope::string &src, Anope::string &dest); extern CoreExport void Unhex(const Anope::string &src, char *dest); + + /** Base 64 encode a string + * @param src The string to encode + * @param target Where the encoded string is placed + */ + extern CoreExport void B64Encode(const Anope::string &src, Anope::string &target); + + /** Base 64 decode a string + * @param src The base64 encoded string + * @param target The plain text result + */ + extern CoreExport void B64Decode(const Anope::string &src, Anope::string &target); /** Returns a sequence of data formatted as the format argument specifies. ** After the format parameter, the function expects at least as many diff --git a/include/extern.h b/include/extern.h index 6ec3310e9..67bb72220 100644 --- a/include/extern.h +++ b/include/extern.h @@ -17,8 +17,6 @@ #include "hashcomp.h" -E void ModuleRunTimeDirCleanUp(); - /* IRC Variables */ E IRCDVar *ircd; @@ -27,7 +25,6 @@ E IRCdMessage *ircdmessage; /**** actions.c ****/ -E void kill_user(const Anope::string &source, User *user, const Anope::string &reason); E bool bad_password(User *u); E void common_unban(ChannelInfo *ci, User *u, bool full = false); @@ -51,7 +48,6 @@ E void do_cmode(const Anope::string &source, const Anope::string &channel, const E void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts); E void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason); E void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason); -E void MassChannelModes(BotInfo *bi, const Anope::string &modes); E void chan_set_correct_modes(User *user, Channel *c, int give_modes); @@ -71,7 +67,6 @@ E void update_cs_lastseen(User *user, ChannelInfo *ci); E int get_idealban(ChannelInfo *ci, User *u, Anope::string &ret); E int levelinfo_maxwidth; -E Anope::string get_mlock_modes(ChannelInfo *ci, int complete); /**** config.c ****/ @@ -187,7 +182,6 @@ E bool isvalidchar(char c); E Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number); E Anope::string myStrGetTokenRemainder(const Anope::string &str, char dilim, int token_number); E int myNumToken(const Anope::string &str, char dilim); -E void EnforceQlinedNick(const Anope::string &nick, const Anope::string &killer); E bool nickIsServices(const Anope::string &nick, bool bot); E void add_entropy_userkeys(); @@ -196,8 +190,6 @@ E unsigned char getrandom8(); E uint16 getrandom16(); E uint32 getrandom32(); -E char *str_signed(unsigned char *str); - E std::list BuildStringList(const Anope::string &, char = ' '); E std::vector BuildStringVector(const Anope::string &, char = ' '); @@ -251,13 +243,7 @@ E void do_umode(const Anope::string &user, const Anope::string &modes); E void do_kill(User *user, const Anope::string &reason); E bool matches_list(Channel *c, User *user, ChannelModeName mode); -E bool is_excepted_mask(ChannelInfo *ci, const Anope::string &mask); E Anope::string create_mask(User *u); -/******************************************************************************/ - -E void b64_encode(const Anope::string &src, Anope::string &target); -E void b64_decode(const Anope::string &src, Anope::string &target); - #endif /* EXTERN_H */ diff --git a/include/modules.h b/include/modules.h index badb59616..b03fca8b1 100644 --- a/include/modules.h +++ b/include/modules.h @@ -129,7 +129,6 @@ class Message; extern CoreExport Module *FindModule(const Anope::string &name); int protocol_module_init(); -extern CoreExport bool moduleMinVersion(int major, int minor, int patch, int build); enum ModuleReturn { @@ -1125,6 +1124,10 @@ class CoreExport ModuleManager */ static std::vector EventHandlers[I_END]; + /** Clean up the module runtime directory + */ + static void CleanupRuntimeDirectory(); + /** Load up a list of modules. * @param module_list The list of modules to load **/ @@ -1144,6 +1147,15 @@ class CoreExport ModuleManager */ static ModuleReturn UnloadModule(Module *m, User * u); + /** Checks whether this version of Anope is at least major.minor.patch.build + * Throws a ModuleException if not + * @param major The major version + * @param minor The minor vesion + * @param patch The patch version + * @param build The build version + */ + static void RequireVersion(int major, int minor, int patch, int build); + /** Change the priority of one event in a module. * Each module event has a list of modules which are attached to that event type. If you wish to be called before or after other specific modules, you may use this * method (usually within void Module::Prioritize()) to set your events priority. You may use this call in other methods too, however, this is not supported behaviour diff --git a/include/regchannel.h b/include/regchannel.h index a3112cfbc..851c4a7d1 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -376,6 +376,12 @@ class CoreExport ChannelInfo : public Extensible, public Flags