diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:18:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:18:39 +0000 |
commit | fff5217f02d91268ce90c8c05665602c059faaef (patch) | |
tree | 2ba24d32dc96eafe7ed0a85269548e76796d849d /src/irc/core/irc-commands.h | |
parent | Initial commit. (diff) | |
download | irssi-fff5217f02d91268ce90c8c05665602c059faaef.tar.xz irssi-fff5217f02d91268ce90c8c05665602c059faaef.zip |
Adding upstream version 1.4.5.upstream/1.4.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/irc/core/irc-commands.h')
-rw-r--r-- | src/irc/core/irc-commands.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/irc/core/irc-commands.h b/src/irc/core/irc-commands.h new file mode 100644 index 0000000..6f68931 --- /dev/null +++ b/src/irc/core/irc-commands.h @@ -0,0 +1,26 @@ +#ifndef IRSSI_IRC_CORE_IRC_COMMANDS_H +#define IRSSI_IRC_CORE_IRC_COMMANDS_H + +#include <irssi/src/core/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 |