<?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_init_static">
  <info>
    <link type="guide" xref="bson_t" group="function"/>
  </info>
  <title>bson_init_static()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[bool
bson_init_static (bson_t        *b,
                  const uint8_t *data,
                  size_t         length);
]]></code></synopsis>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>b</p></td><td><p>A <code xref="bson_t">bson_t</code>.</p></td></tr>
      <tr><td><p>data</p></td><td><p>A buffer to initialize with.</p></td></tr>
      <tr><td><p>length</p></td><td><p>The length of <code>data</code> in bytes.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>The <code xref="bson_init_static">bson_init_static()</code> function shall shall initialize a read-only <code xref="bson_t">bson_t</code> on the stack using the data provided. No copies of the data will be made and therefore must remain valid for the lifetime of the <code xref="bson_t">bson_t</code>.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p><code xref="bson_init_static">bson_init_static()</code> will return <code>true</code> if the <code xref="bson_t">bson_t</code> was successfully initialized.</p>
  </section>

</page>
