X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_ops_example.c;h=19b9acc14fdc856291da82e83f43c54b5f13938e;hp=66014b89157a4a03c675074941b65cc95eda02be;hb=382d15d447b7a95390decfa783836ae4fe255b3d;hpb=981adb86cf9b49c3d5ba6c575eb063271f97ecd9 diff --git a/lib/silcclient/client_ops_example.c b/lib/silcclient/client_ops_example.c index 66014b89..19b9acc1 100644 --- a/lib/silcclient/client_ops_example.c +++ b/lib/silcclient/client_ops_example.c @@ -11,7 +11,7 @@ /* Message sent to the application by library. `conn' associates the message to a specific connection. `conn', however, may be NULL. The `type' indicates the type of the message sent by the library. - The applicationi can for example filter the message according the + The application can for example filter the message according the type. */ static void @@ -23,26 +23,31 @@ silc_say(SilcClient client, SilcClientConnection conn, /* Message for a channel. The `sender' is the sender of the message - The `channel' is the channel. The `msg' is the message. Note that - `msg' maybe NULL. */ + The `channel' is the channel. The `message' is the message. Note + that `message' maybe NULL. The `flags' indicates message flags + and it is used to determine how the message can be interpreted + (like it may tell the message is multimedia message). */ static void silc_channel_message(SilcClient client, SilcClientConnection conn, SilcClientEntry sender, SilcChannelEntry channel, - SilcMessageFlags flags, const unsigned char *message, - SilcUInt32 message_len) + SilcMessagePayload payload, SilcMessageFlags flags, + const unsigned char *message, SilcUInt32 message_len) { } /* Private message to the client. The `sender' is the sender of the - message. */ + message. The message is `message'and maybe NULL. The `flags' + indicates message flags and it is used to determine how the message + can be interpreted (like it may tell the message is multimedia + message). */ static void silc_private_message(SilcClient client, SilcClientConnection conn, - SilcClientEntry sender, SilcMessageFlags flags, - const unsigned char *message, + SilcClientEntry sender, SilcMessagePayload payload, + SilcMessageFlags flags, const unsigned char *message, SilcUInt32 message_len) { @@ -77,8 +82,8 @@ silc_notify(SilcClient client, SilcClientConnection conn, static void silc_command(SilcClient client, SilcClientConnection conn, - SilcClientCommandContext cmd_context, int success, - SilcCommand command) + SilcClientCommandContext cmd_context, bool success, + SilcCommand command, SilcStatus status) { } @@ -103,7 +108,7 @@ silc_command(SilcClient client, SilcClientConnection conn, static void silc_command_reply(SilcClient client, SilcClientConnection conn, - SilcCommandPayload cmd_payload, int success, + SilcCommandPayload cmd_payload, bool success, SilcCommand command, SilcStatus status, ...) { @@ -117,17 +122,21 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, silc_client_close_connection. */ static void -silc_connect(SilcClient client, SilcClientConnection conn, - SilcClientConnectionStatus status) +silc_connected(SilcClient client, SilcClientConnection conn, + SilcClientConnectionStatus status) { } -/* Called to indicate that connection was disconnected to the server. */ +/* Called to indicate that connection was disconnected to the server. + The `status' may tell the reason of the disconnection, and if the + `message' is non-NULL it may include the disconnection message + received from server. */ static void -silc_disconnect(SilcClient client, SilcClientConnection conn) +silc_disconnected(SilcClient client, SilcClientConnection conn, + SilcStatus status, const char *message) { } @@ -150,8 +159,9 @@ silc_get_auth_method(SilcClient client, SilcClientConnection conn, /* Verifies received public key. The `conn_type' indicates which entity (server, client etc.) has sent the public key. If user decides to trust - the key may be saved as trusted public key for later use. The - `completion' must be called after the public key has been verified. */ + the application may save the key as trusted public key for later + use. The `completion' must be called after the public key has been + verified. */ static void silc_verify_public_key(SilcClient client, SilcClientConnection conn, @@ -200,7 +210,7 @@ silc_failure(SilcClient client, SilcClientConnection conn, silc_client_perform_key_agreement). If TRUE is returned also the `completion' and `context' arguments must be set by the application. */ -static int +static bool silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, const char *hostname, SilcUInt16 port, SilcKeyAgreementCallback *completion, @@ -260,8 +270,8 @@ SilcClientOperations ops = { silc_notify, silc_command, silc_command_reply, - silc_connect, - silc_disconnect, + silc_connected, + silc_disconnected, silc_get_auth_method, silc_verify_public_key, silc_ask_passphrase,