Watcher list support added.
[silc.git] / lib / silcclient / command_reply.h
index 782b0aa244c2f106087641f8deed76ac454b979b..9811e1c9ae5679be8739c2f50cee7b9dc559ec8f 100644 (file)
@@ -26,19 +26,25 @@ typedef struct {
   SilcCommand cmd;
 } SilcClientCommandReply;
 
+/* Context holding pending command callbacks. */
+typedef struct {
+  SilcCommandCb callback;
+  void *context;
+} *SilcClientCommandPendingCallbacks;
+
 /* Context sent as argument to all command reply functions */
 struct SilcClientCommandReplyContextStruct {
   SilcClient client;
   SilcSocketConnection sock;
   SilcCommandPayload payload;
-  SilcCommandStatus status;
-  SilcCommandStatus error;
+  SilcStatus status;
+  SilcStatus error;
   SilcArgumentPayload args;
   SilcPacketContext *packet;
 
   /* If defined this executes the pending command. */
-  SilcCommandCb callback;
-  void *context;
+  SilcClientCommandPendingCallbacks callbacks;
+  SilcUInt32 callbacks_count;
   SilcUInt16 ident;
 };
 
@@ -61,20 +67,20 @@ void silc_client_command_reply_##func(void *context, void *context2)
 
 /* Status message structure. Messages are defined below. */
 typedef struct {
-  SilcCommandStatus status;
+  SilcStatus status;
   char *message;
-} SilcCommandStatusMessage;
+} SilcStatusMessage;
 
 /* Status messages returned by the server */
 #define STAT(x) SILC_STATUS_ERR_##x
-DLLAPI extern const SilcCommandStatusMessage silc_command_status_messages[];
+DLLAPI extern const SilcStatusMessage silc_command_status_messages[];
 
 /* Prototypes */
 
+char *silc_client_status_message(SilcStatus status);
 void silc_client_command_reply_process(SilcClient client,
                                       SilcSocketConnection sock,
                                       SilcPacketContext *packet);
-char *silc_client_command_status_message(SilcCommandStatus status);
 void silc_client_command_reply_free(SilcClientCommandReplyContext cmd);
 SILC_CLIENT_CMD_REPLY_FUNC(whois);
 SILC_CLIENT_CMD_REPLY_FUNC(whowas);
@@ -96,6 +102,7 @@ SILC_CLIENT_CMD_REPLY_FUNC(cumode);
 SILC_CLIENT_CMD_REPLY_FUNC(kick);
 SILC_CLIENT_CMD_REPLY_FUNC(ban);
 SILC_CLIENT_CMD_REPLY_FUNC(detach);
+SILC_CLIENT_CMD_REPLY_FUNC(watch);
 SILC_CLIENT_CMD_REPLY_FUNC(silcoper);
 SILC_CLIENT_CMD_REPLY_FUNC(leave);
 SILC_CLIENT_CMD_REPLY_FUNC(users);