Added SilcStack aware buffer unformatting.
[runtime.git] / lib / silcutil / silcbuffmt.h
index 9fbdfe0aa3f777e9725434ab3339f90475910551..4c2a4d69f3e011fb128b0ca3bf0a9efe3bae0e8e 100644 (file)
  * into specified data types.  It is especially useful to format packets,
  * protocol payloads and such.
  *
+ * As the SilcBuffer API is not thread-safe these routines may not be used
+ * in multithreaded environment with a same SilcBuffer context without
+ * concurrency control.
+ *
  ***/
 
 #ifndef SILCBUFFMT_H
@@ -145,6 +149,20 @@ int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap);
  ***/
 int silc_buffer_unformat(SilcBuffer src, ...);
 
+/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat
+ *
+ * SYNOPSIS
+ *
+ *    int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
+ *
+ * DESCRIPTION
+ *
+ *    Same as silc_buffer_unformat but uses `stack' to allocate the memory.
+ *    if `stack' is NULL reverts back to silc_buffer_format call.
+ *
+ ***/
+int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
+
 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat_vp
  *
  * SYNOPSIS
@@ -159,6 +177,20 @@ int silc_buffer_unformat(SilcBuffer src, ...);
  ***/
 int silc_buffer_unformat_vp(SilcBuffer src, va_list ap);
 
+/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat_vp
+ *
+ * SYNOPSIS
+ *
+ *    int silc_buffer_sunformat_vp(SilcBuffer src, va_list vp);
+ *
+ * DESCRIPTION
+ *
+ *    Same as silc_buffer_unformat_vp but uses `stack' to allocate the
+ *    memory.  if `stack' is NULL reverts back to silc_buffer_format_vp call.
+ *
+ ***/
+int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap);
+
 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_strformat
  *
  * SYNOPSIS