updates.
[silc.git] / lib / silcclient / silcclient.h
index dd3e5cb1a46a30506b8bfc017ae520e92ca8989c..918d266f2ef7943070c3e8b0efd95091ea2c94cf 100644 (file)
@@ -254,6 +254,28 @@ typedef enum {
 } SilcClientMessageType;
 /***/
 
+/****d* silcclient/SilcClientAPI/SilcClientConnectionStatus
+ *
+ * NAME
+ *
+ *    typedef enum { ... } SilcClientConnectionStatus
+ *
+ * DESCRIPTION
+ *
+ *    This type is returned to the `connect' client operation to indicate
+ *    the status of the created connection.  It can indicated if it was
+ *    successful or whether an error occurred.
+ *
+ * SOURCE
+ */
+typedef enum {
+  SILC_CLIENT_CONN_SUCCESS,           /* Successfully connected */
+  SILC_CLIENT_CONN_SUCCESS_RESUME,     /* Successfully connected and
+                                         resumed old detached session */
+  SILC_CLIENT_CONN_ERROR,             /* Error occurred during connecting */
+} SilcClientConnectionStatus;
+/***/
+
 /****s* silcclient/SilcClientAPI/SilcClientOperations
  *
  * NAME
@@ -341,14 +363,16 @@ typedef struct {
      SilcClientEntry. */
   void (*command_reply)(SilcClient client, SilcClientConnection conn,
                        SilcCommandPayload cmd_payload, int success,
-                       SilcCommand command, SilcCommandStatus status, ...);
+                       SilcCommand command, SilcStatus status, ...);
 
   /* Called to indicate that connection was either successfully established
      or connecting failed.  This is also the first time application receives
      the SilcClientConnection object which it should save somewhere.
-     If the `success' is FALSE the application must always call the function
+     The `status' indicated whether the connection were successful.  If it
+     is error value the application must always call the function
      silc_client_close_connection. */
-  void (*connect)(SilcClient client, SilcClientConnection conn, int success);
+  void (*connect)(SilcClient client, SilcClientConnection conn,
+                 SilcClientConnectionStatus status);
 
   /* Called to indicate that connection was disconnected to the server. */
   void (*disconnect)(SilcClient client, SilcClientConnection conn);
@@ -553,7 +577,8 @@ typedef struct {
  *    the client. The `application' is application specific user data pointer
  *    and caller must free it. The `silc_version' is the application version
  *    that will be used to compare against remote host's (usually a server)
- *    version string.
+ *    version string.  The `application' context is accessible by the
+ *    application by client->application, client being SilcClient.
  *
  ***/
 SilcClient silc_client_alloc(SilcClientOperations *ops,