From bf4193e8a3333843da243b9bce6bb01c96cd110d Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 Apr 2004 01:27:44 +0000 Subject: added mode.h/mode.cpp and seperated mode functions into it git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@666 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/ctables.h | 2 -- include/inspircd.h | 6 ++++++ include/mode.h | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 include/mode.h (limited to 'include') diff --git a/include/ctables.h b/include/ctables.h index ab39bf5f3..cd3dc83a7 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -20,8 +20,6 @@ #ifndef __CTABLES_H__ #define __CTABLES_H__ -typedef void (handlerfunc) (char**, int, userrec*); - /** A structure that defines a command */ class command_t : public classbase diff --git a/include/inspircd.h b/include/inspircd.h index 866c545d4..40e878b63 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -71,6 +71,8 @@ typedef std::deque file_cache; +typedef void (handlerfunc) (char**, int, userrec*); + /* prototypes */ int InspIRCd(void); int InitConfig(void); @@ -91,6 +93,9 @@ void ChanExceptSender(chanrec* Ptr, userrec* user, char* text, ...); void WriteCommon(userrec *u, char* text, ...); void WriteCommonExcept(userrec *u, char* text, ...); void WriteWallOps(userrec *source, bool local_only, char* text, ...); +void WriteChannelLocal(chanrec* Ptr, userrec* user, char* text, ...); +void WriteChannelWithServ(char* ServerName, chanrec* Ptr, userrec* user, char* text, ...); +char* chanmodes(chanrec *chan); userrec* Find(std::string nick); chanrec* FindChan(const char* chan); std::string getservername(); @@ -111,6 +116,7 @@ void kill_link(userrec *user,const char* r); int usercount(chanrec *c); void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user); long GetRevision(); +int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins); // mesh network functions diff --git a/include/mode.h b/include/mode.h new file mode 100644 index 000000000..633350ead --- /dev/null +++ b/include/mode.h @@ -0,0 +1,33 @@ +#ifndef __MODE_H +#define __MODE_H + +// include the common header files + +#include +#include +#include +#include +#include +#include +#include "users.h" +#include "channels.h" + + +int give_ops(userrec *user,char *dest,chanrec *chan,int status); +int give_hops(userrec *user,char *dest,chanrec *chan,int status); +int give_voice(userrec *user,char *dest,chanrec *chan,int status); +int take_ops(userrec *user,char *dest,chanrec *chan,int status); +int take_hops(userrec *user,char *dest,chanrec *chan,int status); +int take_voice(userrec *user,char *dest,chanrec *chan,int status); +int add_ban(userrec *user,char *dest,chanrec *chan,int status); +int take_ban(userrec *user,char *dest,chanrec *chan,int status); +void process_modes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local); +bool allowed_umode(char umode, char* sourcemodes,bool adding); +bool process_module_umode(char umode, userrec* source, void* dest, bool adding); +void handle_mode(char **parameters, int pcnt, userrec *user); +void server_mode(char **parameters, int pcnt, userrec *user); +void merge_mode(char **parameters, int pcnt); +void merge_mode2(char **parameters, int pcnt, userrec* user); + + +#endif -- cgit v1.2.3