Moved some stuff from irc to core. Added command_bind_proto() function to

bind protocol-specific commands. Added #define command_bind_irc() for easier
access. CMD_IRC_SERVER(server) check should be done at the beginning of each
command requiring IRC server as active server, it handles it correctly the
cases when it is not. Did some other cleanups as well.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1955 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-02 01:05:14 +00:00 committed by cras
commit f354fe54c7
70 changed files with 381 additions and 438 deletions

View file

@ -0,0 +1,26 @@
#ifndef __IRC_COMMANDS_H
#define __IRC_COMMANDS_H
#include "commands.h"
#define command_bind_irc(cmd, section, signal) \
command_bind_proto(cmd, IRC_PROTOCOL, section, signal)
#define command_bind_irc_first(cmd, section, signal) \
command_bind_proto_first(cmd, IRC_PROTOCOL, section, signal)
#define command_bind_irc_last(cmd, section, signal) \
command_bind_proto_last(cmd, IRC_PROTOCOL, section, signal)
/* Simply returns if server isn't for IRC protocol. Prints ERR_NOT_CONNECTED
error if there's no server or server isn't connected yet */
#define CMD_IRC_SERVER(server) \
G_STMT_START { \
if (server != NULL && !IS_IRC_SERVER(server)) \
return; \
if (server == NULL || !(server)->connected) \
cmd_return_error(CMDERR_NOT_CONNECTED); \
} G_STMT_END
void irc_commands_init(void);
void irc_commands_deinit(void);
#endif