http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_closedir/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_closedir/index.html b/os/modules/fs/fs/fs_closedir/index.html index e299776..f07e37b 100644 --- a/os/modules/fs/fs/fs_closedir/index.html +++ b/os/modules/fs/fs/fs_closedir/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95closedir"><font color="#F2853F" style="font-size:24pt">fs_closedir</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_closedir(struct fs_dir *dir) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_closedir</span>(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -687,53 +694,53 @@ <li><a href="../fs_return_codes/">FS error code</a> on failure</li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example iterates through the contents of a directory, printing the name of each child node. When the traversal is complete, the code closes the directory handle.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -traverse_dir(const char *dirname) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">traverse_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*dirname</span>) { - struct fs_dirent *dirent; - struct fs_dir *dir; - char buf[64]; - uint8_t name_len; - int rc; - - rc = fs_opendir(dirname, &dir); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>; + <span style="color: #A90D91">char</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">64</span>]; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">name_len</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #000000">dirname</span>, <span style="color: #000000">&dir</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Iterate through the parent directory, printing the name of each child - * entry. The loop only terminates via a function return. - */ - while (1) { - /* Retrieve the next child node. */ - rc = fs_readdir(dir, &dirent); - if (rc == FS_ENOENT) { - /* Traversal complete. */ - return 0; - } else if (rc != 0) { - /* Unexpected error. */ - return -1; + <span style="color: #177500">/* Iterate through the parent directory, printing the name of each child</span> +<span style="color: #177500"> * entry. The loop only terminates via a function return.</span> +<span style="color: #177500"> */</span> + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #177500">/* Retrieve the next child node. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&dirent</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) { + <span style="color: #177500">/* Traversal complete. */</span> + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Unexpected error. */</span> + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read the child node's name from the file system. */ - rc = fs_dirent_name(dirent, sizeof buf, buf, &name_len); - if (rc != 0) { - return -1; + <span style="color: #177500">/* Read the child node's name from the file system. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&name_len</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Print the child node's name to the console. */ - if (fs_dirent_is_dir(dirent)) { - console_printf(" dir: "); - } else { - console_printf("file: "); + <span style="color: #177500">/* Print the child node's name to the console. */</span> + <span style="color: #A90D91">if</span> (<span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #000000">dirent</span>)) { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">" dir: "</span>); + } <span style="color: #A90D91">else</span> { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"file: "</span>); } - console_printf("%s\n", buf); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s\n"</span>, <span style="color: #000000">buf</span>); } } </pre></div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_dirent_is_dir/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_dirent_is_dir/index.html b/os/modules/fs/fs/fs_dirent_is_dir/index.html index d244322..e36bd57 100644 --- a/os/modules/fs/fs/fs_dirent_is_dir/index.html +++ b/os/modules/fs/fs/fs_dirent_is_dir/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95dirent95is95dir"><font color="#F2853F" style="font-size:24pt">fs_dirent_is_dir</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_dirent_is_dir(const struct fs_dirent *dirent) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -687,53 +694,53 @@ <li>0: The entry is a regular file.</li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example iterates through the contents of a directory, printing the name of each child node. When the traversal is complete, the code closes the directory handle.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -traverse_dir(const char *dirname) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">traverse_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*dirname</span>) { - struct fs_dirent *dirent; - struct fs_dir *dir; - char buf[64]; - uint8_t name_len; - int rc; - - rc = fs_opendir(dirname, &dir); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>; + <span style="color: #A90D91">char</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">64</span>]; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">name_len</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #000000">dirname</span>, <span style="color: #000000">&dir</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Iterate through the parent directory, printing the name of each child - * entry. The loop only terminates via a function return. - */ - while (1) { - /* Retrieve the next child node. */ - rc = fs_readdir(dir, &dirent); - if (rc == FS_ENOENT) { - /* Traversal complete. */ - return 0; - } else if (rc != 0) { - /* Unexpected error. */ - return -1; + <span style="color: #177500">/* Iterate through the parent directory, printing the name of each child</span> +<span style="color: #177500"> * entry. The loop only terminates via a function return.</span> +<span style="color: #177500"> */</span> + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #177500">/* Retrieve the next child node. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&dirent</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) { + <span style="color: #177500">/* Traversal complete. */</span> + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Unexpected error. */</span> + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read the child node's name from the file system. */ - rc = fs_dirent_name(dirent, sizeof buf, buf, &name_len); - if (rc != 0) { - return -1; + <span style="color: #177500">/* Read the child node's name from the file system. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&name_len</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Print the child node's name to the console. */ - if (fs_dirent_is_dir(dirent)) { - console_printf(" dir: "); - } else { - console_printf("file: "); + <span style="color: #177500">/* Print the child node's name to the console. */</span> + <span style="color: #A90D91">if</span> (<span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #000000">dirent</span>)) { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">" dir: "</span>); + } <span style="color: #A90D91">else</span> { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"file: "</span>); } - console_printf("%s\n", buf); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s\n"</span>, <span style="color: #000000">buf</span>); } } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_dirent_name/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_dirent_name/index.html b/os/modules/fs/fs/fs_dirent_name/index.html index 3b8e503..a8cd2cc 100644 --- a/os/modules/fs/fs/fs_dirent_name/index.html +++ b/os/modules/fs/fs/fs_dirent_name/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,8 +668,8 @@ </div> <h2 id="fs95dirent95name"><font color="#F2853F" style="font-size:24pt">fs_dirent_name</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_dirent_name(const struct fs_dirent *dirent, size_t max_len, - char *out_name, uint8_t *out_name_len) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>, <span style="color: #A90D91">size_t</span> <span style="color: #000000">max_len</span>, + <span style="color: #A90D91">char</span> <span style="color: #000000">*out_name</span>, <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">*out_name_len</span>) </pre></div> @@ -671,8 +678,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -702,53 +709,53 @@ <h4 id="notes">Notes</h4> <p>The retrieved filename is always null-terminated. To ensure enough space to hold the full filename plus a null-termintor, a destination buffer of size <em>filename-max-length + 1</em> should be used.</p> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example iterates through the contents of a directory, printing the name of each child node. When the traversal is complete, the code closes the directory handle.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -traverse_dir(const char *dirname) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">traverse_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*dirname</span>) { - struct fs_dirent *dirent; - struct fs_dir *dir; - char buf[64]; - uint8_t name_len; - int rc; - - rc = fs_opendir(dirname, &dir); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>; + <span style="color: #A90D91">char</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">64</span>]; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">name_len</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #000000">dirname</span>, <span style="color: #000000">&dir</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Iterate through the parent directory, printing the name of each child - * entry. The loop only terminates via a function return. - */ - while (1) { - /* Retrieve the next child node. */ - rc = fs_readdir(dir, &dirent); - if (rc == FS_ENOENT) { - /* Traversal complete. */ - return 0; - } else if (rc != 0) { - /* Unexpected error. */ - return -1; + <span style="color: #177500">/* Iterate through the parent directory, printing the name of each child</span> +<span style="color: #177500"> * entry. The loop only terminates via a function return.</span> +<span style="color: #177500"> */</span> + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #177500">/* Retrieve the next child node. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&dirent</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) { + <span style="color: #177500">/* Traversal complete. */</span> + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Unexpected error. */</span> + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read the child node's name from the file system. */ - rc = fs_dirent_name(dirent, sizeof buf, buf, &name_len); - if (rc != 0) { - return -1; + <span style="color: #177500">/* Read the child node's name from the file system. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&name_len</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Print the child node's name to the console. */ - if (fs_dirent_is_dir(dirent)) { - console_printf(" dir: "); - } else { - console_printf("file: "); + <span style="color: #177500">/* Print the child node's name to the console. */</span> + <span style="color: #A90D91">if</span> (<span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #000000">dirent</span>)) { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">" dir: "</span>); + } <span style="color: #A90D91">else</span> { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"file: "</span>); } - console_printf("%s\n", buf); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s\n"</span>, <span style="color: #000000">buf</span>); } } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_filelen/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_filelen/index.html b/os/modules/fs/fs/fs_filelen/index.html index 6952454..4bbac92 100644 --- a/os/modules/fs/fs/fs_filelen/index.html +++ b/os/modules/fs/fs/fs_filelen/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95filelen"><font color="#F2853F" style="font-size:24pt">fs_filelen</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_filelen(const struct fs_file *file, uint32_t *out_len) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_filelen</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*out_len</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -691,35 +698,35 @@ <li><a href="../fs_return_codes/">FS error code</a> on failure</li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -write_config(void) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">write_config</span>(<span style="color: #A90D91">void</span>) { - struct fs_file *file; - int rc; - - /* If the file doesn't exist, create it. If it does exist, truncate it to - * zero bytes. - */ - rc = fs_open("/settings/config.txt", FS_ACCESS_WRITE | FS_ACCESS_TRUNCATE, - &file); - if (rc == 0) { - /* Write 5 bytes of data to the file. */ - rc = fs_write(file, "hello", 5); - if (rc == 0) { - /* The file should now contain exactly five bytes. */ - assert(fs_filelen(file) == 5); + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #177500">/* If the file doesn't exist, create it. If it does exist, truncate it to</span> +<span style="color: #177500"> * zero bytes.</span> +<span style="color: #177500"> */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_open</span>(<span style="color: #C41A16">"/settings/config.txt"</span>, <span style="color: #000000">FS_ACCESS_WRITE</span> <span style="color: #000000">|</span> <span style="color: #000000">FS_ACCESS_TRUNCATE</span>, + <span style="color: #000000">&file</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Write 5 bytes of data to the file. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_write</span>(<span style="color: #000000">file</span>, <span style="color: #C41A16">"hello"</span>, <span style="color: #1C01CE">5</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* The file should now contain exactly five bytes. */</span> + <span style="color: #000000">assert</span>(<span style="color: #000000">fs_filelen</span>(<span style="color: #000000">file</span>) <span style="color: #000000">==</span> <span style="color: #1C01CE">5</span>); } - /* Close the file. */ - fs_close(file); + <span style="color: #177500">/* Close the file. */</span> + <span style="color: #000000">fs_close</span>(<span style="color: #000000">file</span>); } - return rc == 0 ? 0 : -1; + <span style="color: #A90D91">return</span> <span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">?</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">:</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_getpos/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_getpos/index.html b/os/modules/fs/fs/fs_getpos/index.html index 846a1a9..e9ba9b6 100644 --- a/os/modules/fs/fs/fs_getpos/index.html +++ b/os/modules/fs/fs/fs_getpos/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95getpos"><font color="#F2853F" style="font-size:24pt">fs_getpos</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">uint32_t fs_getpos(const struct fs_file *file) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">uint32_t</span> <span style="color: #000000">fs_getpos</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -688,7 +695,7 @@ <h4 id="notes">Notes</h4> <p>If a file is opened in append mode, its write pointer is always positioned at the end of the file. Calling this function on such a file only indicates the read position.</p> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <div class="row"> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_mkdir/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_mkdir/index.html b/os/modules/fs/fs/fs_mkdir/index.html index f1f609f..bab5761 100644 --- a/os/modules/fs/fs/fs_mkdir/index.html +++ b/os/modules/fs/fs/fs_mkdir/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95mkdir"><font color="#F2853F" style="font-size:24pt">fs_mkdir</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_mkdir(const char *path) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_mkdir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*path</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -689,35 +696,35 @@ <h4 id="notes">Notes</h4> <p>All intermediate directories must already exist. The specified path must start with a '/' character.</p> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example demonstrates creating a series of nested directories.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -create_path(void) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">create_path</span>(<span style="color: #A90D91">void</span>) { - int rc; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; - rc = fs_mkdir("/data"); - if (rc != 0) goto err; + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_mkdir</span>(<span style="color: #C41A16">"/data"</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) <span style="color: #A90D91">goto</span> <span style="color: #000000">err</span>; - rc = fs_mkdir("/data/logs"); - if (rc != 0) goto err; + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_mkdir</span>(<span style="color: #C41A16">"/data/logs"</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) <span style="color: #A90D91">goto</span> <span style="color: #000000">err</span>; - rc = fs_mkdir("/data/logs/temperature"); - if (rc != 0) goto err; + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_mkdir</span>(<span style="color: #C41A16">"/data/logs/temperature"</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) <span style="color: #A90D91">goto</span> <span style="color: #000000">err</span>; - rc = fs_mkdir("/data/logs/temperature/current"); - if (rc != 0) goto err; + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_mkdir</span>(<span style="color: #C41A16">"/data/logs/temperature/current"</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) <span style="color: #A90D91">goto</span> <span style="color: #000000">err</span>; - return 0; + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; -err: - /* Clean up the incomplete directory tree, if any. */ - fs_unlink("/data"); - return -1; +<span style="color: #000000">err</span>: + <span style="color: #177500">/* Clean up the incomplete directory tree, if any. */</span> + <span style="color: #000000">fs_unlink</span>(<span style="color: #C41A16">"/data"</span>); + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_open/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_open/index.html b/os/modules/fs/fs/fs_open/index.html index f55b239..afd1705 100644 --- a/os/modules/fs/fs/fs_open/index.html +++ b/os/modules/fs/fs/fs_open/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,8 +668,8 @@ </div> <h2 id="fs95open"><font color="F2853F" style="font-size:24pt">fs_open</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_open(const char *filename, uint8_t access_flags, - struct fs_file **out_file) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_open</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*filename</span>, <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">access_flags</span>, + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">**out_file</span>) </pre></div> @@ -682,8 +689,8 @@ The mode strings passed to <code>fopen()</code> map to <code>fs_open()</code>'s <table> <thead> <tr> -<th>Argument</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -716,37 +723,37 @@ The mode strings passed to <code>fopen()</code> map to <code>fs_open()</code>'s </li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>The below code opens the file <code>/settings/config.txt</code> for reading, reads some data, and then closes the file.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -read_config(void) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">read_config</span>(<span style="color: #A90D91">void</span>) { - struct fs_file *file; - uint32_t bytes_read; - uint8_t buf[16]; - int rc; - - /* Open the file for reading. */ - rc = fs_open("/settings/config.txt", FS_ACCESS_READ, &file); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>; + <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">bytes_read</span>; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">16</span>]; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #177500">/* Open the file for reading. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_open</span>(<span style="color: #C41A16">"/settings/config.txt"</span>, <span style="color: #000000">FS_ACCESS_READ</span>, <span style="color: #000000">&file</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read up to 16 bytes from the file. */ - rc = fs_read(file, sizeof buf, buf, &bytes_read); - if (rc == 0) { - /* buf now contains up to 16 bytes of file data. */ - console_printf("read %u bytes\n", bytes_read) + <span style="color: #177500">/* Read up to 16 bytes from the file. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_read</span>(<span style="color: #000000">file</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&bytes_read</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* buf now contains up to 16 bytes of file data. */</span> + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"read %u bytes\n"</span>, <span style="color: #000000">bytes_read</span>) } - /* Close the file. */ - fs_close(file); + <span style="color: #177500">/* Close the file. */</span> + <span style="color: #000000">fs_close</span>(<span style="color: #000000">file</span>); - return rc == 0 ? 0 : -1; + <span style="color: #A90D91">return</span> <span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">?</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">:</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_opendir/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_opendir/index.html b/os/modules/fs/fs/fs_opendir/index.html index efc2dfd..ce61357 100644 --- a/os/modules/fs/fs/fs_opendir/index.html +++ b/os/modules/fs/fs/fs_opendir/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95opendir"><font color="#F2853F" style="font-size:24pt">fs_opendir</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_opendir(const char *path, struct fs_dir **out_dir) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*path</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">**out_dir</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -701,53 +708,53 @@ </li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example iterates through the contents of a directory, printing the name of each child node. When the traversal is complete, the code closes the directory handle.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -traverse_dir(const char *dirname) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">traverse_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*dirname</span>) { - struct fs_dirent *dirent; - struct fs_dir *dir; - char buf[64]; - uint8_t name_len; - int rc; - - rc = fs_opendir(dirname, &dir); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>; + <span style="color: #A90D91">char</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">64</span>]; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">name_len</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #000000">dirname</span>, <span style="color: #000000">&dir</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Iterate through the parent directory, printing the name of each child - * entry. The loop only terminates via a function return. - */ - while (1) { - /* Retrieve the next child node. */ - rc = fs_readdir(dir, &dirent); - if (rc == FS_ENOENT) { - /* Traversal complete. */ - return 0; - } else if (rc != 0) { - /* Unexpected error. */ - return -1; + <span style="color: #177500">/* Iterate through the parent directory, printing the name of each child</span> +<span style="color: #177500"> * entry. The loop only terminates via a function return.</span> +<span style="color: #177500"> */</span> + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #177500">/* Retrieve the next child node. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&dirent</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) { + <span style="color: #177500">/* Traversal complete. */</span> + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Unexpected error. */</span> + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read the child node's name from the file system. */ - rc = fs_dirent_name(dirent, sizeof buf, buf, &name_len); - if (rc != 0) { - return -1; + <span style="color: #177500">/* Read the child node's name from the file system. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&name_len</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Print the child node's name to the console. */ - if (fs_dirent_is_dir(dirent)) { - console_printf(" dir: "); - } else { - console_printf("file: "); + <span style="color: #177500">/* Print the child node's name to the console. */</span> + <span style="color: #A90D91">if</span> (<span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #000000">dirent</span>)) { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">" dir: "</span>); + } <span style="color: #A90D91">else</span> { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"file: "</span>); } - console_printf("%s\n", buf); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s\n"</span>, <span style="color: #000000">buf</span>); } } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_ops/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_ops/index.html b/os/modules/fs/fs/fs_ops/index.html index 6b3d9de..9ee57dd 100644 --- a/os/modules/fs/fs/fs_ops/index.html +++ b/os/modules/fs/fs/fs_ops/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -525,31 +532,31 @@ </div> <h2 id="struct-fs95ops"><font color="F2853F" style="font-size:24pt">struct fs_ops</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">struct fs_ops { - int (*f_open)(const char *filename, uint8_t access_flags, - struct fs_file **out_file); - int (*f_close)(struct fs_file *file); - int (*f_read)(struct fs_file *file, uint32_t len, void *out_data, - uint32_t *out_len); - int (*f_write)(struct fs_file *file, const void *data, int len); - - int (*f_seek)(struct fs_file *file, uint32_t offset); - uint32_t (*f_getpos)(const struct fs_file *file); - int (*f_filelen)(const struct fs_file *file, uint32_t *out_len); - - int (*f_unlink)(const char *filename); - int (*f_rename)(const char *from, const char *to); - int (*f_mkdir)(const char *path); - - int (*f_opendir)(const char *path, struct fs_dir **out_dir); - int (*f_readdir)(struct fs_dir *dir, struct fs_dirent **out_dirent); - int (*f_closedir)(struct fs_dir *dir); - - int (*f_dirent_name)(const struct fs_dirent *dirent, size_t max_len, - char *out_name, uint8_t *out_name_len); - int (*f_dirent_is_dir)(const struct fs_dirent *dirent); - - const char *f_name; +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">struct</span> <span style="color: #000000">fs_ops</span> { + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_open</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*filename</span>, <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">access_flags</span>, + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">**out_file</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_close</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_read</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*out_data</span>, + <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*out_len</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_write</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">void</span> <span style="color: #000000">*data</span>, <span style="color: #A90D91">int</span> <span style="color: #000000">len</span>); + + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_seek</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">offset</span>); + <span style="color: #A90D91">uint32_t</span> (<span style="color: #000000">*f_getpos</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_filelen</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*out_len</span>); + + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_unlink</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*filename</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_rename</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*from</span>, <span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*to</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_mkdir</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*path</span>); + + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_opendir</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*path</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">**out_dir</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_readdir</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">**out_dirent</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_closedir</span>)(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>); + + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_dirent_name</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>, <span style="color: #A90D91">size_t</span> <span style="color: #000000">max_len</span>, + <span style="color: #A90D91">char</span> <span style="color: #000000">*out_name</span>, <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">*out_name_len</span>); + <span style="color: #A90D91">int</span> (<span style="color: #000000">*f_dirent_is_dir</span>)(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>); + + <span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*f_name</span>; }; </pre></div> @@ -557,7 +564,7 @@ <p>This data structure consists of a set of function pointers. Each function pointer corresponds to a file system operation. When registering a file system with the abstraction layer, each function pointer must be pointed at the corresponding routine in the custom file system package.</p> <p>The required behavior of each corresponding function is documented in the <a href="../fs/#api">file system abstraction layer API</a>.</p> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs_if.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs_if.h"</span> </pre></div> <div class="row"> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_read/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_read/index.html b/os/modules/fs/fs/fs_read/index.html index 281c77b..39ccf6f 100644 --- a/os/modules/fs/fs/fs_read/index.html +++ b/os/modules/fs/fs/fs_read/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95read"><font color="#F2853F" style="font-size:24pt">fs_read</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_read(struct fs_file *file, uint32_t len, void *out_data, uint32_t *out_len) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_read</span>(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">len</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*out_data</span>, <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">*out_len</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -699,37 +706,37 @@ <li><a href="../fs_return_codes/">FS error code</a> on failure</li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>The below code opens the file <code>/settings/config.txt</code> for reading, reads some data, and then closes the file.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -read_config(void) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">read_config</span>(<span style="color: #A90D91">void</span>) { - struct fs_file *file; - uint32_t bytes_read; - uint8_t buf[16]; - int rc; - - /* Open the file for reading. */ - rc = fs_open("/settings/config.txt", FS_ACCESS_READ, &file); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_file</span> <span style="color: #000000">*file</span>; + <span style="color: #A90D91">uint32_t</span> <span style="color: #000000">bytes_read</span>; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">16</span>]; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #177500">/* Open the file for reading. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_open</span>(<span style="color: #C41A16">"/settings/config.txt"</span>, <span style="color: #000000">FS_ACCESS_READ</span>, <span style="color: #000000">&file</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read up to 16 bytes from the file. */ - rc = fs_read(file, sizeof buf, buf, &bytes_read); - if (rc == 0) { - /* buf now contains up to 16 bytes of file data. */ - console_printf("read %u bytes\n", bytes_read) + <span style="color: #177500">/* Read up to 16 bytes from the file. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_read</span>(<span style="color: #000000">file</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&bytes_read</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* buf now contains up to 16 bytes of file data. */</span> + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"read %u bytes\n"</span>, <span style="color: #000000">bytes_read</span>) } - /* Close the file. */ - fs_close(file); + <span style="color: #177500">/* Close the file. */</span> + <span style="color: #000000">fs_close</span>(<span style="color: #000000">file</span>); - return rc == 0 ? 0 : -1; + <span style="color: #A90D91">return</span> <span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">?</span> <span style="color: #1C01CE">0</span> <span style="color: #000000">:</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_readdir/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_readdir/index.html b/os/modules/fs/fs/fs_readdir/index.html index da8e177..f3fce20 100644 --- a/os/modules/fs/fs/fs_readdir/index.html +++ b/os/modules/fs/fs/fs_readdir/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs_readdir"><font color="#F2853F" style="font-size:24pt">fs_readdir</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_readdir(struct fs_dir *dir, struct fs_dirent **out_dirent); +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>, <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">**out_dirent</span>); </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Arguments</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -692,53 +699,53 @@ <li>Other <a href="../fs_return_codes/">FS error code</a> on error.</li> </ul> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <h4 id="example">Example</h4> <p>This example iterates through the contents of a directory, printing the name of each child node. When the traversal is complete, the code closes the directory handle.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int -traverse_dir(const char *dirname) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> +<span style="color: #000000">traverse_dir</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">char</span> <span style="color: #000000">*dirname</span>) { - struct fs_dirent *dirent; - struct fs_dir *dir; - char buf[64]; - uint8_t name_len; - int rc; - - rc = fs_opendir(dirname, &dir); - if (rc != 0) { - return -1; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dirent</span> <span style="color: #000000">*dirent</span>; + <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_dir</span> <span style="color: #000000">*dir</span>; + <span style="color: #A90D91">char</span> <span style="color: #000000">buf</span>[<span style="color: #1C01CE">64</span>]; + <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">name_len</span>; + <span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>; + + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_opendir</span>(<span style="color: #000000">dirname</span>, <span style="color: #000000">&dir</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Iterate through the parent directory, printing the name of each child - * entry. The loop only terminates via a function return. - */ - while (1) { - /* Retrieve the next child node. */ - rc = fs_readdir(dir, &dirent); - if (rc == FS_ENOENT) { - /* Traversal complete. */ - return 0; - } else if (rc != 0) { - /* Unexpected error. */ - return -1; + <span style="color: #177500">/* Iterate through the parent directory, printing the name of each child</span> +<span style="color: #177500"> * entry. The loop only terminates via a function return.</span> +<span style="color: #177500"> */</span> + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #177500">/* Retrieve the next child node. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_readdir</span>(<span style="color: #000000">dir</span>, <span style="color: #000000">&dirent</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">==</span> <span style="color: #000000">FS_ENOENT</span>) { + <span style="color: #177500">/* Traversal complete. */</span> + <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #177500">/* Unexpected error. */</span> + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Read the child node's name from the file system. */ - rc = fs_dirent_name(dirent, sizeof buf, buf, &name_len); - if (rc != 0) { - return -1; + <span style="color: #177500">/* Read the child node's name from the file system. */</span> + <span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">fs_dirent_name</span>(<span style="color: #000000">dirent</span>, <span style="color: #A90D91">sizeof</span> <span style="color: #000000">buf</span>, <span style="color: #000000">buf</span>, <span style="color: #000000">&name_len</span>); + <span style="color: #A90D91">if</span> (<span style="color: #000000">rc</span> <span style="color: #000000">!=</span> <span style="color: #1C01CE">0</span>) { + <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } - /* Print the child node's name to the console. */ - if (fs_dirent_is_dir(dirent)) { - console_printf(" dir: "); - } else { - console_printf("file: "); + <span style="color: #177500">/* Print the child node's name to the console. */</span> + <span style="color: #A90D91">if</span> (<span style="color: #000000">fs_dirent_is_dir</span>(<span style="color: #000000">dirent</span>)) { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">" dir: "</span>); + } <span style="color: #A90D91">else</span> { + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"file: "</span>); } - console_printf("%s\n", buf); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s\n"</span>, <span style="color: #000000">buf</span>); } } </pre></div> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/bdc0c773/os/modules/fs/fs/fs_register/index.html ---------------------------------------------------------------------- diff --git a/os/modules/fs/fs/fs_register/index.html b/os/modules/fs/fs/fs_register/index.html index d847b46..014c9a4 100644 --- a/os/modules/fs/fs/fs_register/index.html +++ b/os/modules/fs/fs/fs_register/index.html @@ -46,6 +46,11 @@ + + + + + <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Collapsed navigation --> @@ -79,7 +84,9 @@ > <a href="/about/">About</a> </li> - <li> + <li + class="active" +> <a href="/os/introduction/">Documentation</a> </li> <li @@ -112,7 +119,7 @@ <div class="container"> <div class="row"> - <div class="col-md-3 v2-sidebar"><div class="hidden-print" role="complementary"> + <div class="col-md-3 v2-sidebar"><div id="docSidebar" class="hidden-print" role="complementary"> <div class="top"> <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt"> <div role="search"> @@ -661,7 +668,7 @@ </div> <h2 id="fs95register"><font color="F2853F" style="font-size:24pt">fs_register</font></h2> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">int fs_register(const struct fs_ops *fops) +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">fs_register</span>(<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">fs_ops</span> <span style="color: #000000">*fops</span>) </pre></div> @@ -670,8 +677,8 @@ <table> <thead> <tr> -<th>Argument</th> -<th>Description</th> +<th><em>Argument</em></th> +<th><em>Description</em></th> </tr> </thead> <tbody> @@ -689,7 +696,7 @@ <h4 id="notes">Notes</h4> <p>Only one file system can be registered. The registered file system is mounted in the root directory (<em>/</em>).</p> <h4 id="header-file">Header file</h4> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">#include "fs/fs.h" +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include "fs/fs.h"</span> </pre></div> <div class="row">
