Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch
[silc.git] / lib / silcutil / silcbuffmt.h
index 5ba91e4657968e2e3ae8c9fd5afe018a5e53c0c1..909d6ead5263dcacde272995fe772a909f970975 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2006 Pekka Riikonen
+  Copyright (C) 1997 - 2007 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
@@ -253,11 +253,11 @@ int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
  ***/
 int silc_buffer_format_vp(SilcBuffer dst, va_list ap);
 
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format_vp
+/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat_vp
  *
  * SYNOPSIS
  *
- *    int silc_buffer_format_vp(SilcBuffer dst, va_list vp);
+ *    int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list vp);
  *
  * DESCRIPTION
  *
@@ -338,16 +338,16 @@ int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap);
  *
  * SYNOPSIS
  *
- *   int silc_buffer_strformat(SilcBuffer dst, ...);
+ *    int silc_buffer_strformat(SilcBuffer dst, ...);
  *
  * DESCRIPTION
  *
- *   Formats a buffer from variable argument list of strings.  Each
- *   string must be NULL-terminated and the variable argument list must
- *   be end with SILC_STR_END argument.  This allows that a string in
- *   the list can be NULL, in which case it is skipped.  This automatically
- *   allocates the space for the buffer data but `dst' must be already
- *   allocated by the caller.
+ *    Formats a buffer from variable argument list of strings.  Each
+ *    string must be NULL-terminated and the variable argument list must
+ *    be end with SILC_STRFMT_END argument.  This allows that a string in
+ *    the list can be NULL, in which case it is skipped.  This automatically
+ *    allocates the space for the buffer data but `dst' must be already
+ *    allocated by the caller.
  *
  * EXAMPLE
  *
@@ -362,17 +362,17 @@ int silc_buffer_strformat(SilcBuffer dst, ...);
  *
  * SYNOPSIS
  *
- *   int silc_buffer_strformat(SilcStack stack, SilcBuffer dst, ...);
+ *    int silc_buffer_strformat(SilcStack stack, SilcBuffer dst, ...);
  *
  * DESCRIPTION
  *
- *   Formats a buffer from variable argument list of strings.  Each
- *   string must be NULL-terminated and the variable argument list must
- *   be end with SILC_STR_END argument.  This allows that a string in
- *   the list can be NULL, in which case it is skipped.  This automatically
- *   allocates the space for the buffer data but `dst' must be already
- *   allocated by the caller.  This function is equivalent to
- *   silc_buffer_strformat but allocates memory from `stack'.
+ *    Formats a buffer from variable argument list of strings.  Each
+ *    string must be NULL-terminated and the variable argument list must
+ *    be end with SILC_STRFMT_END argument.  This allows that a string in
+ *    the list can be NULL, in which case it is skipped.  This automatically
+ *    allocates the space for the buffer data but `dst' must be already
+ *    allocated by the caller.  This function is equivalent to
+ *    silc_buffer_strformat but allocates memory from `stack'.
  *
  ***/
 int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...);
@@ -462,9 +462,9 @@ typedef enum {
  *
  *    SilcInt16/SilcUInt16.
  *
- *    Formatting:    SILC_STR_SI_SHORT(short)
+ *    Formatting:    SILC_STR_SI_SHORT(SilcInt16)
  *                   SILC_STR_UI_SHORT(SilcUInt16)
- *    Unformatting:  SILC_STR_SI_SHORT(short *)
+ *    Unformatting:  SILC_STR_SI_SHORT(SilcInt16 *)
  *                   SILC_STR_UI_SHORT(SilcUInt16 *)
  *
  ***/
@@ -482,9 +482,9 @@ typedef enum {
  *
  *    SilcInt32/SilcUInt32.
  *
- *    Formatting:    SILC_STR_SI_INT(int)
+ *    Formatting:    SILC_STR_SI_INT(SilcInt32)
  *                   SILC_STR_UI_INT(SilcUInt32)
- *    Unformatting:  SILC_STR_SI_INT(int *)
+ *    Unformatting:  SILC_STR_SI_INT(SilcInt32 *)
  *                   SILC_STR_UI_INT(SilcUInt32 *)
  *
  ***/
@@ -502,10 +502,10 @@ typedef enum {
  *
  *    SilcInt64/SilcUInt64.
  *
- *     Formatting:    SILC_STR_SI_INT64(int)
- *                    SILC_STR_UI_INT64(SilcUInt32)
- *     Unformatting:  SILC_STR_SI_INT64(int *)
- *                    SILC_STR_UI_INT64(SilcUInt32 *)
+ *     Formatting:    SILC_STR_SI_INT64(SilcInt64)
+ *                    SILC_STR_UI_INT64(SilcUInt64)
+ *     Unformatting:  SILC_STR_SI_INT64(SilcInt64 *)
+ *                    SILC_STR_UI_INT64(SilcUInt64 *)
  *
  ***/
 #define SILC_STR_SI_INT64(x) SILC_PARAM_SI64_INT, (x)
@@ -759,6 +759,7 @@ typedef enum {
  *    buffer is located at the start of the data.  With SILC_STR_ADVANCE
  *    the buffer will be located at the end of the data.  This makes it
  *    easy to add new data immediately after the previously added data.
+ *    The SILC_STR_ADVANCE may also be used in unformatting.
  *
  * EXAMPLE
  *
@@ -773,7 +774,7 @@ typedef enum {
  *    } while (len > 0);
  *
  *    // Move to beginning of buffer
- *    silc_buffer_push(buffer, silc_buffer_truelen(buffer));
+ *    silc_buffer_start(buffer);
  *
  ***/
 #define SILC_STR_ADVANCE SILC_PARAM_ADVANCE