/*
- command.h
+ command.h
Author: Pekka Riikonen <priikone@silcnet.org>
SilcCommandCb reply; /* Command reply callback */
char *name; /* Name of the command (optional) */
SilcUInt8 max_args; /* Maximum arguments (optional) */
- SilcUInt16 ident; /* Identifier for command (optional) */
+ SilcUInt16 ident; /* Identifier for command (optional) */
struct SilcClientCommandStruct *next;
};
executed after command reply has been executed. */
typedef struct SilcClientCommandPendingStruct {
SilcCommand reply_cmd;
+ SilcUInt16 ident;
+ unsigned int reply_check : 8;
SilcCommandCb callback;
void *context;
- SilcUInt16 ident;
struct SilcClientCommandPendingStruct *next;
} SilcClientCommandPending;
silc_client_command_pending_del(ctx->sock->user_data, cmd, ctx->ident); \
} while(0)
+SilcClientCommandContext silc_client_command_alloc(void);
+void silc_client_command_free(SilcClientCommandContext ctx);
+SilcClientCommandContext silc_client_command_dup(SilcClientCommandContext ctx);
+SilcClientCommand silc_client_command_find(SilcClient client,
+ const char *name);
bool silc_client_command_register(SilcClient client,
SilcCommand command,
const char *name,
SilcClientCommandPendingCallbacks
silc_client_command_pending_check(SilcClientConnection conn,
SilcClientCommandReplyContext ctx,
- SilcCommand command,
+ SilcCommand command,
SilcUInt16 ident,
SilcUInt32 *callbacks_count);
+void silc_client_command_process(SilcClient client,
+ SilcSocketConnection sock,
+ SilcPacketContext *packet);
SILC_CLIENT_CMD_FUNC(whois);
SILC_CLIENT_CMD_FUNC(whowas);
SILC_CLIENT_CMD_FUNC(identify);
SILC_CLIENT_CMD_FUNC(kick);
SILC_CLIENT_CMD_FUNC(ban);
SILC_CLIENT_CMD_FUNC(detach);
+SILC_CLIENT_CMD_FUNC(watch);
SILC_CLIENT_CMD_FUNC(silcoper);
SILC_CLIENT_CMD_FUNC(leave);
SILC_CLIENT_CMD_FUNC(users);