]> jfr.im git - irc/quakenet/newserv.git/blobdiff - control/control.h
CHANSERV: remove accidental sendemail from SETEMAIL command.
[irc/quakenet/newserv.git] / control / control.h
index 901cd53e78ff19f57cb4e2983686373b3d76f096..1b3e9c9c3c8070d5990ad2459b0bb1ba064c600c 100644 (file)
@@ -2,29 +2,17 @@
 #ifndef __CONTROL_H
 #define __CONTROL_H
 
+#include "control_db.h"
+#include "../lib/flags.h"
 #include "../parser/parser.h"
 #include "../nick/nick.h"
 #include "../channel/channel.h"
 
-void registercontrolhelpcmd(const char *name, int level, int maxparams, CommandHandler handler, char *help);
-int deregistercontrolcmd(const char *name, CommandHandler handler);
-void controlmessage(nick *target, char *message, ... );
-void controlchanmsg(channel *cp, char *message, ...);
-void controlnotice(nick *target, char *message, ...);
-int controlshowcommands(void *sender, int cargc, char **cargv);
-int controlrmmod(void *sender, int cargc, char **cargv);
-void controlspecialrmmod(void *arg);
-void controlspecialreloadmod(void *arg);
-void controlhelp(nick *np, Command *cmd);
-void controlnswall(int noticelevel, char *format, ...);
-
 #define registercontrolcmd(a, b, c, d) registercontrolhelpcmd(a, b, c, d, NULL)
 
-typedef void (*ControlMsg)(nick *, char *, ... );
-typedef void (*ControlWall)(flag_t, flag_t, char *, ...);
-
-extern ControlMsg controlreply;
-extern ControlWall controlwall;
+void controlreply(nick *, char *, ...);
+void controlwall(flag_t, flag_t, char *, ...);
+int controlpermitted(flag_t, nick *);
 
 extern nick *mynick;
 
@@ -35,6 +23,26 @@ struct specialsched {
   void *schedule;
 };
 
+typedef void (*CommandHelp)(nick *, Command *);
+typedef struct cmdhelp {
+  char *helpstr;
+  CommandHelp helpcmd;
+} cmdhelp;
+
+void registercontrolhelpcmd(const char *name, int level, int maxparams, CommandHandler handler, char *help);
+void registercontrolhelpfunccmd(const char *name, int level, int maxparams, CommandHandler handler, CommandHelp helpcmd);
+int deregistercontrolcmd(const char *name, CommandHandler handler);
+void controlmessage(nick *target, char *message, ... ) __attribute__ ((format (printf, 2, 3)));
+void controlchanmsg(channel *cp, char *message, ...) __attribute__ ((format (printf, 2, 3)));
+void controlnotice(nick *target, char *message, ...) __attribute__ ((format (printf, 2, 3)));
+int controlshowcommands(void *sender, int cargc, char **cargv);
+int controlrmmod(void *sender, int cargc, char **cargv);
+void controlspecialrmmod(void *arg);
+void controlspecialreloadmod(void *arg);
+void controlhelp(nick *np, Command *cmd);
+void controlnswall(int noticelevel, char *format, ...) __attribute__ ((format (printf, 2, 3)));
+char *controlid(nick *);
+
 /* NEVER USE THE FOLLOWING IN COMMANDS, you'll end up missing bits off and users'll end up being able to gline people */
 #define __NO_ANYONE      0x000
 #define __NO_AUTHED      0x001 /* must be authed with the network, don't know what use this is really */
@@ -89,5 +97,21 @@ struct specialsched {
 #define NL_OPERING         0x0800  /* when someone opers */
 #define NL_NOTICES         0x1000  /* turn off to receive privmsgs instead of notices */
 #define NL_ALL_COMMANDS    0x2000  /* every single command sent */
+#define NL_GLINES_AUTO     0x4000  /* automated gline messages */
+#define NL_CLEANUP         0x8000  /* automated cleanup notices */
+
+extern int noperserv_ext;
+
+extern const flag no_userflags[];
+extern const flag no_noticeflags[];
+extern const flag no_commandflags[];
+
+#define NO_NICKS_PER_WHOIS_LINE 3
+
+#define NOGetAuthedUser(user)  (no_autheduser *)(user->auth ? user->auth->exts[noperserv_ext] : NULL)
+#define NOGetAuthLevel(user)   user->authlevel
+#define NOGetNoticeLevel(user) user->noticelevel
+#define NOMax(a, b) (a>b?a:b)
+#define NOMin(a, b) (a<b?b:a)
 
 #endif