]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/modcmd.h
Fix for crash bug during burst where X3 sends a B (BURST) message with a channel...
[irc/evilnet/x3.git] / src / modcmd.h
index f65b2bf9c4f3d78be41b921a0ddd7df193abe6d1..0feb737079860d3c30179190808f844d77e94a3e 100644 (file)
@@ -32,16 +32,16 @@ struct modcmd;
 
 #define MODCMD_FUNC(NAME) int NAME(struct userNode *user, UNUSED_ARG(struct chanNode *channel), UNUSED_ARG(unsigned int argc), UNUSED_ARG(char **argv), UNUSED_ARG(struct svccmd *cmd))
 typedef MODCMD_FUNC(modcmd_func_t);
-#define SVCMSG_HOOK(NAME) int NAME(struct userNode *user, struct userNode *target, const char *text, int server_qualified);
+#define SVCMSG_HOOK(NAME) int NAME(struct userNode *user, struct userNode *target, const char *text, int server_qualified)
 typedef SVCMSG_HOOK(svcmsg_hook_t);
 
 DECLARE_LIST(svccmd_list, struct svccmd*);
 DECLARE_LIST(module_list, struct module*);
 
-#if defined(__GNUC__) && (__GNUC__ < 3)
-#define reply(FMT...) send_message(user, cmd->parent->bot, FMT)
-#elif !defined(S_SPLINT_S) /* doesn't recognize C99 variadic macros */
-#define reply(...) send_message(user, cmd->parent->bot, __VA_ARGS__)
+#if defined(GCC_VARMACROS)
+# define reply(ARGS...) send_message(user, cmd->parent->bot, ARGS)
+#elif defined(C99_VARMACROS)
+# define reply(...) send_message(user, cmd->parent->bot, __VA_ARGS__)
 #endif
 #define modcmd_get_handle_info(USER, NAME) smart_get_handle_info(cmd->parent->bot, USER, NAME)
 #define modcmd_chanmode_announce(CHANGE) mod_chanmode_announce(cmd->parent->bot, channel, CHANGE)
@@ -81,7 +81,6 @@ DECLARE_LIST(module_list, struct module*);
 #define CMD_LOG_STAFF       0x02
 #define CMD_LOG_OVERRIDE    0x04
 
-
 /* Modularized commands work like this:
  *
  * Modules define commands.  Services contain "bindings" of those
@@ -187,8 +186,8 @@ int svccmd_invoke_argv(struct userNode *user, struct service *service, struct ch
 /* Get notification when a command is being unbound.  This lets
  * services which cache svccmd references remove them.
  */
-typedef void (*svccmd_unbind_func_t)(struct svccmd *target);
-void reg_svccmd_unbind_func(svccmd_unbind_func_t handler);
+typedef void (*svccmd_unbind_func_t)(struct svccmd *target, void *extra);
+void reg_svccmd_unbind_func(svccmd_unbind_func_t handler, void *extra);
 
 /* Initialize the module command subsystem. */
 void modcmd_init(void);