<?xml version="1.0"?>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="bson_string_free">
  <info>
    <link type="guide" xref="bson_string_t" group="function"/>
  </info>
  <title>bson_string_free()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[char *
bson_string_free (bson_string_t *string,
                  bool           free_segment);
]]></code></synopsis>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p><code>string</code></p></td><td><p>A <code xref="bson_string_t">bson_string_t</code>.</p></td></tr>
      <tr><td><p><code>free_segment</code></p></td><td><p>A bool indicating if <code>str->str</code> should be returned.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>Frees the bson_string_t structure and optionally the string itself.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p><code>str->str</code> if <code>free_segment</code> is true, otherwise NULL.</p>
  </section>
</page>
