<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 

<refentry id="sstream_get_str"> <!-- ID for references -->

<refentrytitle>sstream_get_str</refentrytitle> <!-- title shown in references -->
<manvolnum>3</manvolnum></refmeta> <!-- man volume id (3 for libraries) -->

<refname>sstream_get_str</refname> <!-- function name -->
<refpurpose>read data from input stream</refpurpose> <!-- short function description -->

#include &lt;cds/serialize.h&gt; <!-- included headers -->

<funcprototype> <!-- function prototype -->
  <funcdef>int <function>sstream_get_str</function></funcdef>
  <paramdef>sstream_t *<parameter>ss</parameter></paramdef>
  <paramdef>int <parameter>length</parameter></paramdef>
  <paramdef>str_t *<parameter>dst</parameter></paramdef>


<para>Reads <parameter>len</parameter> bytes from input stream makes a copy of
them and returns them in string <parameter>dst</parameter>. For allocation it
uses cds_malloc function. The string may be freed using for example
<function>str_free_content</function>. If there is not enough data to read (less
than <parameter>len</parameter> bytes), the function returns error.
<!-- detailed description -->


<refsect1><title>Return value</title>
<!-- return value description -->
Returns 0 on success, non-zero on error. 

<refsect1><title>See Also</title>
<xref linkend="sstream_t"/>, <xref linkend="sstream_get"/>, <xref
<!-- references to other pages -->