Added SILC Thread Queue API
[crypto.git] / lib / silcclient / command_reply.h
index 4e5cdbee8178e133c15d7940dfd7c73306bedb3e..be1b56434ae5afb00f233e55316347aae743c0b3 100644 (file)
@@ -1,10 +1,10 @@
 /*
 
-  command_reply.h 
+  command_reply.h
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2001 Pekka Riikonen
+  Copyright (C) 2006 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 #ifndef COMMAND_REPLY_H
 #define COMMAND_REPLY_H
 
-/* Structure holding one command reply and pointer to its function. */
-typedef struct {
-  SilcCommandCb cb;
-  SilcCommand cmd;
-} SilcClientCommandReply;
-
-/* Context sent as argument to all command reply functions */
-struct SilcClientCommandReplyContextStruct {
-  SilcClient client;
-  SilcSocketConnection sock;
-  SilcCommandPayload payload;
-  SilcArgumentPayload args;
-  SilcPacketContext *packet;
-
-  /* If defined this executes the pending command. */
-  SilcCommandCb callback;
-  void *context;
-  SilcUInt16 ident;
-};
-
-/* Macros */
-
-/* Macro used to declare command reply functions */
-#define SILC_CLIENT_CMD_REPLY_FUNC(func)                               \
-void silc_client_command_reply_##func(void *context, void *context2)
-
-/* Status message structure. Messages are defined below. */
-typedef struct {
-  SilcCommandStatus status;
-  char *message;
-} SilcCommandStatusMessage;
-
-/* Status messages returned by the server */
-#define STAT(x) SILC_STATUS_ERR_##x
-DLLAPI extern const SilcCommandStatusMessage silc_command_status_messages[];
-
-/* Prototypes */
-
-void silc_client_command_reply_process(SilcClient client,
-                                      SilcSocketConnection sock,
-                                      SilcPacketContext *packet);
-char *silc_client_command_status_message(SilcCommandStatus status);
-SILC_CLIENT_CMD_REPLY_FUNC(whois);
-SILC_CLIENT_CMD_REPLY_FUNC(whowas);
-SILC_CLIENT_CMD_REPLY_FUNC(identify);
-SILC_CLIENT_CMD_REPLY_FUNC(nick);
-SILC_CLIENT_CMD_REPLY_FUNC(list);
-SILC_CLIENT_CMD_REPLY_FUNC(topic);
-SILC_CLIENT_CMD_REPLY_FUNC(invite);
-SILC_CLIENT_CMD_REPLY_FUNC(kill);
-SILC_CLIENT_CMD_REPLY_FUNC(info);
-SILC_CLIENT_CMD_REPLY_FUNC(links);
-SILC_CLIENT_CMD_REPLY_FUNC(stats);
-SILC_CLIENT_CMD_REPLY_FUNC(users);
-SILC_CLIENT_CMD_REPLY_FUNC(connect);
-SILC_CLIENT_CMD_REPLY_FUNC(ping);
-SILC_CLIENT_CMD_REPLY_FUNC(pong);
-SILC_CLIENT_CMD_REPLY_FUNC(oper);
-SILC_CLIENT_CMD_REPLY_FUNC(join);
-SILC_CLIENT_CMD_REPLY_FUNC(motd);
-SILC_CLIENT_CMD_REPLY_FUNC(umode);
-SILC_CLIENT_CMD_REPLY_FUNC(cmode);
-SILC_CLIENT_CMD_REPLY_FUNC(cumode);
-SILC_CLIENT_CMD_REPLY_FUNC(kick);
-SILC_CLIENT_CMD_REPLY_FUNC(ban);
-SILC_CLIENT_CMD_REPLY_FUNC(close);
-SILC_CLIENT_CMD_REPLY_FUNC(shutdown);
-SILC_CLIENT_CMD_REPLY_FUNC(silcoper);
-SILC_CLIENT_CMD_REPLY_FUNC(leave);
-SILC_CLIENT_CMD_REPLY_FUNC(users);
-SILC_CLIENT_CMD_REPLY_FUNC(getkey);
-SILC_CLIENT_CMD_REPLY_FUNC(quit);
-
-/* Internal command reply functions */
-SILC_CLIENT_CMD_REPLY_FUNC(whois_i);
-SILC_CLIENT_CMD_REPLY_FUNC(identify_i);
-SILC_CLIENT_CMD_REPLY_FUNC(info_i);
-
-#endif
+SILC_FSM_STATE(silc_client_command_reply);
+SILC_FSM_STATE(silc_client_command_reply_wait);
+SILC_FSM_STATE(silc_client_command_reply_timeout);
+SILC_FSM_STATE(silc_client_command_reply_process);
+SILC_FSM_STATE(silc_client_command_reply_processed);
+SILC_FSM_STATE(silc_client_command_reply_whois);
+SILC_FSM_STATE(silc_client_command_reply_whowas);
+SILC_FSM_STATE(silc_client_command_reply_identify);
+SILC_FSM_STATE(silc_client_command_reply_nick);
+SILC_FSM_STATE(silc_client_command_reply_list);
+SILC_FSM_STATE(silc_client_command_reply_topic);
+SILC_FSM_STATE(silc_client_command_reply_invite);
+SILC_FSM_STATE(silc_client_command_reply_kill);
+SILC_FSM_STATE(silc_client_command_reply_info);
+SILC_FSM_STATE(silc_client_command_reply_stats);
+SILC_FSM_STATE(silc_client_command_reply_ping);
+SILC_FSM_STATE(silc_client_command_reply_oper);
+SILC_FSM_STATE(silc_client_command_reply_join);
+SILC_FSM_STATE(silc_client_command_reply_motd);
+SILC_FSM_STATE(silc_client_command_reply_umode);
+SILC_FSM_STATE(silc_client_command_reply_cmode);
+SILC_FSM_STATE(silc_client_command_reply_cumode);
+SILC_FSM_STATE(silc_client_command_reply_kick);
+SILC_FSM_STATE(silc_client_command_reply_ban);
+SILC_FSM_STATE(silc_client_command_reply_detach);
+SILC_FSM_STATE(silc_client_command_reply_watch);
+SILC_FSM_STATE(silc_client_command_reply_silcoper);
+SILC_FSM_STATE(silc_client_command_reply_leave);
+SILC_FSM_STATE(silc_client_command_reply_users);
+SILC_FSM_STATE(silc_client_command_reply_getkey);
+SILC_FSM_STATE(silc_client_command_reply_service);
+SILC_FSM_STATE(silc_client_command_reply_quit);
+
+#endif /* COMMAND_REPLY_H */