Merge commit 'origin/silc.1.1.branch'
[silc.git] / lib / silcclient / silcclient.h
index 569b2ab23164fd587559f9a0856f9ea319ff506c..23f1aabcc863ab3988a3049d9f8942f17e2a902b 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2000 - 2007 Pekka Riikonen
+  Copyright (C) 2000 - 2008 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
@@ -227,6 +227,8 @@ struct SilcClientConnectionStruct {
   SilcPublicKey public_key;           /* Public key used in this connection */
   SilcPrivateKey private_key;         /* Private key */
   SilcPacketStream stream;            /* Connection to remote host */
+  SilcStream socket_stream;           /* Socket stream from 'stream' */
+  SilcSocket sock;                    /* The socket from 'socket_stream' */
   SilcConnectionType type;            /* Connection type */
   SilcClientConnectCallback callback;  /* Connection callback */
   void *callback_context;             /* Connection context */
@@ -665,13 +667,16 @@ typedef struct SilcClientParamsStruct {
      %H  full hostname - the full hostname of the client
 
      Example format strings: "%n#%a"     (fe. nick#2, nick#3)
-                             "%n@%h%a"   (fe. nick@host, nick@host2)
-                             "%a!%n@%h"  (fe. nick@host, 2!nick@host)
+                             "%n#%h%a"   (fe. nick#host, nick#host2)
+                             "%a!%n#%h"  (fe. nick#host, 2!nick#host)
 
      Note that there must always be some separator characters around '%n'
      format.  It is not possible to put format characters before or after
      '%n' without separators (such ash '#').  Also note that the separator
      character should be a character that cannot be part of normal nickname.
+     Note that, using '@' as a separator is not recommended as the nickname
+     string may contain it to separate a server name from the nickname (eg.
+     nickname@silcnet.org).
   */
   char nickname_format[32];
 
@@ -683,9 +688,24 @@ typedef struct SilcClientParamsStruct {
      value. */
   SilcBool nickname_force_format;
 
-  /* If this is set to TRUE, the silcclient library will not register and
-     deregister the cipher, pkcs, hash and hmac algorithms. The application
-     itself will need to handle that. */
+  /* If this is set to TRUE then all nickname strings returned by the library
+     and stored by the library are in the format of 'nickname@server', eg.
+     nickname@silcnet.org.  If this is FALSE then the server name of the
+     nickname is available only from the SilcClientEntry structure.  When this
+     is TRUE the server name is still parsed to SilcClientEntry. */
+  SilcBool full_nicknames;
+
+  /* If this is set to TRUE then all channel name strings returned by the
+     library and stored by the library are in the format of 'channel@server',
+     eg. silc@silcnet.org.  If this is FALSE then the server name of the
+     channel is available only from the SilcChannelEntry structure.  When this
+     is TRUE the server name is still parsed to SilcChannelEntry.  Note that,
+     not all SILC server versions return such channel name strings. */
+  SilcBool full_channel_names;
+
+  /* If this is set to TRUE, the silcclient library will not initialize
+     or uninitialize the SILC Crypto Toolkit.  The application will have
+     to do that itself by calling silc_crypto_init and silc_crypto_uninit. */
   SilcBool dont_register_crypto_library;
 
 } SilcClientParams;
@@ -1065,11 +1085,11 @@ silc_client_connect_to_client(SilcClient client,
  *                                  stream_create_cb, app);
  *
  *    // Stream callback delivers our new SilcStream context
- *    void stream_create_cb(SilcSocketStreamStatus status, SilcStream stream,
+ *    void stream_create_cb(SilcResult status, SilcStream stream,
  *                          void *context)
  *    {
  *      ...
- *      if (status != SILC_SOCKET_OK)
+ *      if (status != SILC_OK)
  *        error(status);
  *
  *      // Start key exchange
@@ -1373,7 +1393,7 @@ SilcUInt16 silc_client_command_call(SilcClient client,
  *
  *    If FALSE is returned in this function this callback will not be called
  *    again for `command' even if there are more comand replies.  By returning
- *    FALSE the caller my stop the command reply handling when needed.
+ *    FALSE the caller may stop the command reply handling when needed.
  *
  ***/
 typedef SilcBool (*SilcClientCommandReply)(SilcClient client,