5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 1997 - 2001 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
20 #ifndef COMMAND_REPLY_H
21 #define COMMAND_REPLY_H
23 /* Structure holding one command reply and pointer to its function. */
27 } SilcClientCommandReply;
29 /* Context sent as argument to all command reply functions */
32 SilcSocketConnection sock;
33 SilcCommandPayload payload;
34 SilcArgumentPayload args;
35 SilcPacketContext *packet;
37 /* If defined this executes the pending command. */
38 SilcClientPendingDestructor destructor;
39 SilcCommandCb callback;
42 } *SilcClientCommandReplyContext;
46 /* Macro used to declare command reply functions */
47 #define SILC_CLIENT_CMD_REPLY_FUNC(func) \
48 void silc_client_command_reply_##func(void *context, void *context2)
50 /* Status message structure. Messages are defined below. */
52 SilcCommandStatus status;
54 } SilcCommandStatusMessage;
56 /* Status messages returned by the server */
57 #define STAT(x) SILC_STATUS_ERR_##x
58 extern const SilcCommandStatusMessage silc_command_status_messages[];
62 void silc_client_command_reply_process(SilcClient client,
63 SilcSocketConnection sock,
64 SilcPacketContext *packet);
65 char *silc_client_command_status_message(SilcCommandStatus status);
66 SILC_CLIENT_CMD_REPLY_FUNC(whois);
67 SILC_CLIENT_CMD_REPLY_FUNC(whowas);
68 SILC_CLIENT_CMD_REPLY_FUNC(identify);
69 SILC_CLIENT_CMD_REPLY_FUNC(nick);
70 SILC_CLIENT_CMD_REPLY_FUNC(list);
71 SILC_CLIENT_CMD_REPLY_FUNC(topic);
72 SILC_CLIENT_CMD_REPLY_FUNC(invite);
73 SILC_CLIENT_CMD_REPLY_FUNC(kill);
74 SILC_CLIENT_CMD_REPLY_FUNC(info);
75 SILC_CLIENT_CMD_REPLY_FUNC(links);
76 SILC_CLIENT_CMD_REPLY_FUNC(stats);
77 SILC_CLIENT_CMD_REPLY_FUNC(users);
78 SILC_CLIENT_CMD_REPLY_FUNC(connect);
79 SILC_CLIENT_CMD_REPLY_FUNC(ping);
80 SILC_CLIENT_CMD_REPLY_FUNC(pong);
81 SILC_CLIENT_CMD_REPLY_FUNC(oper);
82 SILC_CLIENT_CMD_REPLY_FUNC(join);
83 SILC_CLIENT_CMD_REPLY_FUNC(motd);
84 SILC_CLIENT_CMD_REPLY_FUNC(umode);
85 SILC_CLIENT_CMD_REPLY_FUNC(cmode);
86 SILC_CLIENT_CMD_REPLY_FUNC(cumode);
87 SILC_CLIENT_CMD_REPLY_FUNC(kick);
88 SILC_CLIENT_CMD_REPLY_FUNC(ban);
89 SILC_CLIENT_CMD_REPLY_FUNC(close);
90 SILC_CLIENT_CMD_REPLY_FUNC(shutdown);
91 SILC_CLIENT_CMD_REPLY_FUNC(silcoper);
92 SILC_CLIENT_CMD_REPLY_FUNC(leave);
93 SILC_CLIENT_CMD_REPLY_FUNC(users);
94 SILC_CLIENT_CMD_REPLY_FUNC(getkey);
95 SILC_CLIENT_CMD_REPLY_FUNC(quit);
97 /* Internal command reply functions */
98 SILC_CLIENT_CMD_REPLY_FUNC(whois_i);
99 SILC_CLIENT_CMD_REPLY_FUNC(identify_i);
100 SILC_CLIENT_CMD_REPLY_FUNC(info_i);