d2ba8367f46cc9c6814ca3d9bd76d5a187dc23c7
[silc.git] / apps / irssi / src / silc / core / silc-commands.h
1 #ifndef SILC_COMMANDS_H
2 #define SILC_COMMANDS_H
3
4 #define command_bind_silc(cmd, section, signal) \
5         command_bind_proto(cmd, SILC_PROTOCOL, section, signal)
6 #define command_bind_silc_first(cmd, section, signal) \
7         command_bind_proto_first(cmd, SILC_PROTOCOL, section, signal)
8 #define command_bind_silc_last(cmd, section, signal) \
9         command_bind_proto_last(cmd, SILC_PROTOCOL, section, signal)
10
11 /* Simply returns if server isn't for SILC protocol. Prints ERR_NOT_CONNECTED
12    error if there's no server or server isn't connected yet */
13 #define CMD_SILC_SERVER(server) \
14         G_STMT_START { \
15           if (server != NULL && !IS_SILC_SERVER(server)) \
16             return; \
17           if (server == NULL || !(server)->connected) \
18             cmd_return_error(CMDERR_NOT_CONNECTED); \
19         } G_STMT_END
20
21 #endif