OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="the-nacl-io-library"> | 3 <section id="the-nacl-io-library"> |
4 <span id="nacl-io"></span><h1 id="the-nacl-io-library"><span id="nacl-io"></span
>The nacl_io Library</h1> | 4 <span id="nacl-io"></span><h1 id="the-nacl-io-library"><span id="nacl-io"></span
>The nacl_io Library</h1> |
5 <div class="contents local" id="contents" style="display: none"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><a class="reference internal" href="#introduction" id="id1">Introduction</a>
</li> | 7 <li><a class="reference internal" href="#introduction" id="id1">Introduction</a>
</li> |
8 <li><a class="reference internal" href="#using-nacl-io" id="id2">Using nacl_io</
a></li> | 8 <li><a class="reference internal" href="#using-nacl-io" id="id2">Using nacl_io</
a></li> |
9 <li><p class="first"><a class="reference internal" href="#the-nacl-io-demo" id="
id3">The nacl_io demo</a></p> | 9 <li><p class="first"><a class="reference internal" href="#the-nacl-io-demo" id="
id3">The nacl_io demo</a></p> |
10 <ul class="small-gap"> | 10 <ul class="small-gap"> |
11 <li><a class="reference internal" href="#building-and-running-the-demo" id="id4"
>Building and running the demo</a></li> | 11 <li><a class="reference internal" href="#building-and-running-the-demo" id="id4"
>Building and running the demo</a></li> |
12 <li><a class="reference internal" href="#a-look-at-the-code" id="id5">A look at
the code</a></li> | 12 <li><a class="reference internal" href="#a-look-at-the-code" id="id5">A look at
the code</a></li> |
13 </ul> | 13 </ul> |
14 </li> | 14 </li> |
15 <li><a class="reference internal" href="#reference-information" id="id6">Referen
ce information</a></li> | 15 <li><a class="reference internal" href="#additional-information" id="id6">Additi
onal information</a></li> |
16 </ul> | 16 </ul> |
17 | 17 |
18 </div><h2 id="introduction">Introduction</h2> | 18 </div><h2 id="introduction">Introduction</h2> |
19 <p><code>nacl_io</code> is a utility library that provides implementations of st
andard | 19 <p><code>nacl_io</code> is a utility library that provides implementations of st
andard |
20 C APIs such as POSIX I/O (<code>stdio.h</code>) and BSD sockets (<code>sys/socke
t.h</code>). | 20 C APIs such as POSIX I/O (<code>stdio.h</code>) and BSD sockets (<code>sys/socke
t.h</code>). |
21 Its primary function is to allow code that uses these standard APIs to be | 21 Its primary function is to allow code that uses these standard APIs to be |
22 compiled and used in a Native Client module. The library is included as part | 22 compiled and used in a Native Client module. The library is included as part |
23 of Native Client SDK and is implemented in on top of Pepper API.</p> | 23 of Native Client SDK and is implemented in on top of Pepper API.</p> |
24 <p>Since Native Client modules cannot access the host machine’s file syste
m | 24 <p>Since Native Client modules cannot access the host machine’s file syste
m |
25 directly, nacl_io provides several alternative filesystem types which | 25 directly, nacl_io provides several alternative filesystem types which |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 return 2; | 196 return 2; |
197 } | 197 } |
198 | 198 |
199 bytes_written = fwrite(data, 1, data_len, file); | 199 bytes_written = fwrite(data, 1, data_len, file); |
200 | 200 |
201 *output = PrintfToNewString("fwrite\1%s\1%d", file_index_string, | 201 *output = PrintfToNewString("fwrite\1%s\1%d", file_index_string, |
202 bytes_written); | 202 bytes_written); |
203 return 0; | 203 return 0; |
204 } | 204 } |
205 </pre> | 205 </pre> |
206 <h2 id="reference-information">Reference information</h2> | 206 <h2 id="additional-information">Additional information</h2> |
207 <p>The example discussed here is included in the SDK in the directory | 207 <p>The example discussed here is included in the SDK in the directory |
208 <code>examples/demo/nacl_io_demo</code>.</p> | 208 <code>examples/demo/nacl_io_demo</code>.</p> |
209 <p>The nacl_io library is included in the SDK toolchain and is not a part of the | 209 <p>The nacl_io library is included in the SDK toolchain and is not a part of the |
210 Pepper API. For reference information related to the nacl_io interface see | 210 Pepper API. For reference information related to the nacl_io interface see |
211 its header file in the SDK directory, located at | 211 its header file in the SDK directory, located at |
212 <code>include/nacl_io/nacl_io.h</code>.</p> | 212 <code>include/nacl_io/nacl_io.h</code>.</p> |
| 213 <p>The logging system for nacl_io writes directly to the stderr stream of the Na
Cl |
| 214 process. For more information, see the <a class="reference internal" href="/nati
ve-client/devguide/devcycle/debugging.html#nacl-io-debugging"><em>nacl_io sectio
n</em></a> of the debugging page.</p> |
213 <p>For more about the HTML5 file system read the <a class="reference external" h
ref="http://dev.w3.org/2009/dap/file-system/pub/FileSystem/">specification</a>.<
/p> | 215 <p>For more about the HTML5 file system read the <a class="reference external" h
ref="http://dev.w3.org/2009/dap/file-system/pub/FileSystem/">specification</a>.<
/p> |
214 </section> | 216 </section> |
215 | 217 |
216 {{/partials.standard_nacl_article}} | 218 {{/partials.standard_nacl_article}} |
OLD | NEW |