updartes.
[silc.git] / lib / silcclient / silcapi.h
index 11851aff98a354b3aa275f0e2a7fb2da8f78c7c9..1cb8801c9e0776cd3a10acb1c80f722c6d44e6f8 100644 (file)
@@ -670,9 +670,9 @@ void silc_client_del_socket(SilcClient client, SilcSocketConnection sock);
  *
  * SYNOPSIS
  *
- *    int silc_client_start_key_exchange(SilcClient client,
- *                                       SilcClientConnection conn,
- *                                       int fd);
+ *    void silc_client_start_key_exchange(SilcClient client,
+ *                                        SilcClientConnection conn,
+ *                                        int fd);
  *
  * DESCRIPTION
  *
@@ -685,7 +685,7 @@ void silc_client_del_socket(SilcClient client, SilcSocketConnection sock);
  *    if the key exchange could not be started.
  *
  ***/
-bool silc_client_start_key_exchange(SilcClient client,
+void silc_client_start_key_exchange(SilcClient client,
                                    SilcClientConnection conn,
                                    int fd);
 
@@ -964,11 +964,11 @@ bool silc_client_del_client(SilcClient client, SilcClientConnection conn,
  *
  * SYNOPSIS
  *
- *    typedef void (*SilcGetClientCallback)(SilcClient client,
- *                                          SilcClientConnection conn,
- *                                          SilcClientEntry *clients,
- *                                          uint32 clients_count,
- *                                          void *context);
+ *    typedef void (*SilcGetChannelCallback)(SilcClient client,
+ *                                           SilcClientConnection conn,
+ *                                           SilcChannelEntry *channels,
+ *                                           uint32 channels_count,
+ *                                           void *context);
  *
  * DESCRIPTION
  *
@@ -1117,6 +1117,23 @@ SilcServerEntry silc_client_get_server_by_id(SilcClient client,
 bool silc_client_del_server(SilcClient client, SilcClientConnection conn,
                            SilcServerEntry server);
 
+/****f* silcclient/SilcClientAPI/silc_client_on_channel
+ *
+ * SYNOPSIS
+ *
+ *    SilcChannelUser silc_client_on_channel(SilcChannelEntry channel,
+ *                                           SilcClientEntry client_entry);
+ *
+ * DESCRIPTION
+ *
+ *    Returns the ChannelUser entry if the `client_entry' is joined on the 
+ *    channel indicated by the `channel'. NULL if client is not joined on
+ *    the channel. 
+ *
+ ***/
+SilcChannelUser silc_client_on_channel(SilcChannelEntry channel,
+                                      SilcClientEntry client_entry);
+
 /* Command management (command.c) */
 
 /****f* silcclient/SilcClientAPI/silc_client_command_alloc
@@ -1227,23 +1244,6 @@ void silc_client_command_send(SilcClient client, SilcClientConnection conn,
                              SilcCommand command, uint16 ident,
                              uint32 argc, ...);
 
-/****f* silcclient/SilcClientAPI/SilcClientPendingDestructor
- *
- * SYNOPSIS
- *
- *    typedef void (*SilcClientPendingDestructor)(void *context);
- *
- * DESCRIPTION
- *
- *    Pending Command callback destructor. This is called after calling the
- *    pending callback or if error occurs while processing the pending command.
- *    If error occurs then the callback won't be called at all, and only this
- *    destructor is called. The `context' is the context given for the function
- *    silc_client_command_pending. 
- *
- ***/
-typedef void (*SilcClientPendingDestructor)(void *context);
-
 /****f* silcclient/SilcClientAPI/silc_client_command_pending
  *
  * SYNOPSIS
@@ -1251,7 +1251,6 @@ typedef void (*SilcClientPendingDestructor)(void *context);
  *    void silc_client_command_pending(SilcClientConnection conn,
  *                                     SilcCommand reply_cmd,
  *                                     uint16 ident,
- *                                     SilcClientPendingDestructor destructor,
  *                                     SilcCommandCb callback,
  *                                     void *context);
  *
@@ -1271,7 +1270,6 @@ typedef void (*SilcClientPendingDestructor)(void *context);
 void silc_client_command_pending(SilcClientConnection conn,
                                 SilcCommand reply_cmd,
                                 uint16 ident,
-                                SilcClientPendingDestructor destructor,
                                 SilcCommandCb callback,
                                 void *context);
 
@@ -1864,6 +1862,7 @@ typedef enum {
   SILC_CLIENT_FILE_ALREADY_STARTED,
   SILC_CLIENT_FILE_NO_SUCH_FILE,
   SILC_CLIENT_FILE_PERMISSION_DENIED,
+  SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED,
 } SilcClientFileError;
 /***/
 
@@ -1909,14 +1908,16 @@ typedef void (*SilcClientFileMonitor)(SilcClient client,
  *
  * SYNOPSIS
  *
- *    uint32 silc_client_file_send(SilcClient client,
- *                                 SilcClientConnection conn,
- *                                 SilcClientFileMonitor monitor,
- *                                 void *monitor_context,
- *                                 const char *local_ip,
- *                                 uint32 local_port,
- *                                 SilcClientEntry client_entry,
- *                                 const char *filepath);
+ *    SilcClientFileError 
+ *    silc_client_file_send(SilcClient client,
+ *                          SilcClientConnection conn,
+ *                          SilcClientFileMonitor monitor,
+ *                          void *monitor_context,
+ *                          const char *local_ip,
+ *                          uint32 local_port,
+ *                          SilcClientEntry client_entry,
+ *                          const char *filepath);
+ *                          uint32 *session_id);
  *
  * DESCRIPTION
  *
@@ -1926,12 +1927,10 @@ typedef void (*SilcClientFileMonitor)(SilcClient client,
  *    the file.  The `monitor' callback will be called to monitor the
  *    transmission of the file.
  *
- *    This returns a file session ID for the file transmission.  It can
- *    be used to close the session (and abort the file transmission) by
- *    calling the silc_client_file_close function.  The session ID is
- *    also returned in the `monitor' callback. This returns 0 if the
- *    file indicated by the `filepath' is being transmitted to the remote
- *    client indicated by the `client_entry', already.
+ *    This returns a file session ID for the file transmission to the
+ *    `session_id' pointer..  It can be used to close the session (and
+ *    abort the file transmission) by calling the silc_client_file_close
+ *    function.  The session ID is also returned in the `monitor' callback. 
  *
  *    If the `local_ip' is provided then this will try to bind the 
  *    listener for key exchange protocol to that IP.  If `local_port' is
@@ -1947,14 +1946,16 @@ typedef void (*SilcClientFileMonitor)(SilcClient client,
  *    session.
  *
  ***/
-uint32 silc_client_file_send(SilcClient client,
-                            SilcClientConnection conn,
-                            SilcClientFileMonitor monitor,
-                            void *monitor_context,
-                            const char *local_ip,
-                            uint32 local_port,
-                            SilcClientEntry client_entry,
-                            const char *filepath);
+SilcClientFileError 
+silc_client_file_send(SilcClient client,
+                     SilcClientConnection conn,
+                     SilcClientFileMonitor monitor,
+                     void *monitor_context,
+                     const char *local_ip,
+                     uint32 local_port,
+                     SilcClientEntry client_entry,
+                     const char *filepath,
+                     uint32 *session_id);
 
 /****f* silcclient/SilcClientAPI/silc_client_file_receive
  *