summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-25 03:16:57 -0400
committerAdam <Adam@anope.org>2011-05-16 04:07:56 -0400
commit076ebafa1b4cc935c466c615b94eaac415af9a67 (patch)
treedbc8b0f9e7b6f954569c13ad35598f5ebe8a081d /include
parent6922bd239c778e8f6f2081476ce20b9426c515ad (diff)
Moved some global functions to be member functions and misc cleanup
Diffstat (limited to 'include')
-rw-r--r--include/anope.h12
-rw-r--r--include/extern.h14
-rw-r--r--include/modules.h14
-rw-r--r--include/regchannel.h6
-rw-r--r--include/users.h6
5 files changed, 37 insertions, 15 deletions
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<Anope::string> BuildStringList(const Anope::string &, char = ' ');
E std::vector<Anope::string> 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<Module *> 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<ChannelInfoFlag,
*/
ModeLock *GetMLock(ChannelModeName mname, const Anope::string &param = "");
+ /** Get the current mode locks as a string
+ * @param complete True to show mlock parameters aswell
+ * @return A string of mode locks, eg: +nrt
+ */
+ Anope::string GetMLockAsString(bool complete) const;
+
/** Check whether a user is permitted to be on this channel
* @param u The user
* @return true if they are allowed, false if they aren't and were kicked
diff --git a/include/users.h b/include/users.h
index dcfe219bf..fd6600326 100644
--- a/include/users.h
+++ b/include/users.h
@@ -284,6 +284,12 @@ class CoreExport User : public Extensible
* @return true or false
*/
bool IsProtected() const;
+
+ /** Kill a user
+ * @param source The user/server doing the kill
+ * @param reason The reason for the kill
+ */
+ void Kill(const Anope::string &source, const Anope::string &reason);
};
#endif // USERS_H