Added SILC Thread Queue API
[crypto.git] / lib / silccore / silcnotify.h
index 3b2d7239bfa956414d00f8b8a32afd328c8dbf1a..212a815a591cdacf0a1760146897ef2f3d80ee74 100644 (file)
@@ -1,16 +1,15 @@
 /*
+
   silcnotify.h
+
   Author: Pekka Riikonen <priikone@silcnet.org>
-  Copyright (C) 1997 - 2001 Pekka Riikonen
+
+  Copyright (C) 1997 - 2006 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
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
+  the Free Software Foundation; version 2 of the License.
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 */
 
-/****h* silccore/SilcNotifyAPI
+/****h* silccore/SILC Notify Interface
  *
  * DESCRIPTION
  *
  * Implementation of the Notify Payload. Notify Payload is used usually
- * servers to send different kind of important notify messages to other
+ * by servers to send different kind of important notify messages to other
  * servers and to clients.
  *
  ***/
@@ -34,7 +33,7 @@
 /****s* silccore/SilcNotifyAPI/SilcNotifyPayload
  *
  * NAME
- * 
+ *
  *    typedef struct SilcNotifyPayloadStruct *SilcNotifyPayload;
  *
  * DESCRIPTION
@@ -50,8 +49,8 @@ typedef struct SilcNotifyPayloadStruct *SilcNotifyPayload;
 /****d* silccore/SilcNotifyAPI/SilcNotifyType
  *
  * NAME
- * 
- *    typedef uint16 SilcNotifyType;
+ *
+ *    typedef SilcUInt16 SilcNotifyType;
  *
  * DESCRIPTION
  *
@@ -59,7 +58,7 @@ typedef struct SilcNotifyPayloadStruct *SilcNotifyPayload;
  *
  * SOURCE
  */
-typedef uint16 SilcNotifyType;
+typedef SilcUInt16 SilcNotifyType;
 
 /* SILC notify types. Server may send these notify types to client to
    notify of some action. */
@@ -79,6 +78,8 @@ typedef uint16 SilcNotifyType;
 #define SILC_NOTIFY_TYPE_KILLED          13 /* Killed from the network */
 #define SILC_NOTIFY_TYPE_UMODE_CHANGE    14 /* user mode was changed */
 #define SILC_NOTIFY_TYPE_BAN             15 /* ban list change */
+#define SILC_NOTIFY_TYPE_ERROR           16 /* error notify */
+#define SILC_NOTIFY_TYPE_WATCH           17 /* watch notify */
 /***/
 
 /* Prototypes */
@@ -87,7 +88,9 @@ typedef uint16 SilcNotifyType;
  *
  * SYNOPSIS
  *
- *    SilcNotifyPayload silc_notify_payload_parse(SilcBuffer buffer);
+ *    SilcNotifyPayload
+ *    silc_notify_payload_parse(const unsigned char *payload,
+ *                              SilcUInt32 payload_len);
  *
  * DESCRIPTION
  *
@@ -95,31 +98,33 @@ typedef uint16 SilcNotifyType;
  *    The `buffer' is the raw payload data.
  *
  ***/
-SilcNotifyPayload silc_notify_payload_parse(SilcBuffer buffer);
+SilcNotifyPayload silc_notify_payload_parse(const unsigned char *payload,
+                                           SilcUInt32 payload_len);
 
 /****f* silccore/SilcNotifyAPI/silc_notify_payload_encode
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_notify_payload_encode(SilcNotifyType type, uint32 argc, 
+ *    SilcBuffer silc_notify_payload_encode(SilcNotifyType type,
+ *                                          SilcUInt32 argc,
  *                                          va_list ap);
  *
  * DESCRIPTION
  *
  *    Encode notify payload with variable argument list. If `argc' is > 0
  *    argument payloads will be associated to the notify payload. Variable
- *    arguments must be {usigned char *, uint32 (len)}.
+ *    arguments must be {unsigned char *, SilcUInt32 (len)}.
  *
  ***/
-SilcBuffer silc_notify_payload_encode(SilcNotifyType type, uint32 argc, 
+SilcBuffer silc_notify_payload_encode(SilcNotifyType type, SilcUInt32 argc,
                                      va_list ap);
 
 /****f* silccore/SilcNotifyAPI/silc_notify_payload_encode_args
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_notify_payload_encode_args(SilcNotifyType type, 
- *                                               uint32 argc,
+ *    SilcBuffer silc_notify_payload_encode_args(SilcNotifyType type,
+ *                                               SilcUInt32 argc,
  *                                               SilcBuffer args);
  *
  * DESCRIPTION
@@ -128,8 +133,8 @@ SilcBuffer silc_notify_payload_encode(SilcNotifyType type, uint32 argc,
  *    encoded Argument Payload buffer.
  *
  ***/
-SilcBuffer silc_notify_payload_encode_args(SilcNotifyType type, 
-                                          uint32 argc,
+SilcBuffer silc_notify_payload_encode_args(SilcNotifyType type,
+                                          SilcUInt32 argc,
                                           SilcBuffer args);
 
 /****f* silccore/SilcNotifyAPI/silc_notify_payload_free
@@ -162,14 +167,14 @@ SilcNotifyType silc_notify_get_type(SilcNotifyPayload payload);
  *
  * SYNOPSIS
  *
- *    uint32 silc_notify_get_arg_num(SilcNotifyPayload payload);
+ *    SilcUInt32 silc_notify_get_arg_num(SilcNotifyPayload payload);
  *
  * DESCRIPTION
  *
  *    Return the number of the arguments associated with the Notify Payload.
  *
  ***/
-uint32 silc_notify_get_arg_num(SilcNotifyPayload payload);
+SilcUInt32 silc_notify_get_arg_num(SilcNotifyPayload payload);
 
 /****f* silccore/SilcNotifyAPI/silc_notify_get_args
  *