You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/02/23 02:31:17 UTC

[24/36] incubator-mynewt-site git commit: try merging all the doc structure changes again

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/2b05c3ee/modules/console/index.html
----------------------------------------------------------------------
diff --git a/modules/console/index.html b/modules/console/index.html
deleted file mode 100644
index e69f1de..0000000
--- a/modules/console/index.html
+++ /dev/null
@@ -1,880 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <meta charset="utf-8">
-        <meta http-equiv="X-UA-Compatible" content="IE=edge">
-        <meta name="viewport" content="width=device-width, initial-scale=1.0">
-        
-        
-        <link rel="canonical" href="http://mynewt.incubator.apache.org/modules/console/">
-        <link rel="shortcut icon" href="../../img/favicon.ico">
-
-	<title>Console - Apache Mynewt</title>
-
-        <link href="../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
-        <link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
-        <link rel="stylesheet" href="../../css/highlight.css">
-        <link href="../../css/base.css" rel="stylesheet">
-        <link href="../../css/custom.css" rel="stylesheet">
-        <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
-        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
-        <link href="../../extra.css" rel="stylesheet">
-
-        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
-        <!--[if lt IE 9]>
-            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
-            <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
-        <![endif]-->
-
-        
-            <script>
-                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-                })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-                ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
-                ga('send', 'pageview');
-            </script>
-        
-    </head>
-
-
-    <body class="Console">
-
-
-        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
-    <div class="logo-container">
-        <img src="/img/logo.svg">
-    </div>
-    <div class="container-fluid">
-        <!-- Collapsed navigation -->
-        <div class="navbar-header">
-            <!-- Expander button -->
-            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-                <span class="sr-only">Toggle navigation</span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </button>
-
-        </div>
-
-        <!-- Expanded navigation -->
-        <div class="navbar-collapse collapse">
-            <!-- Main navigation -->
-            <ul class="nav navbar-nav navbar-right">
-                <li>
-                    <a href="/">Home</a>
-                </li>
-                <li>
-                    <a href="/documentation/">Docs</a>
-                </li>
-                <li>
-                    <a href="/download/">Download</a>
-                </li>
-                <li>
-                    <a href="/community/">Community</a>
-                </li>
-                <li>
-                    <a href="/events/">Events</a>
-                </li>
-            </ul>
-
-            <!-- Search, Navigation and Repo links -->
-            <ul class="nav navbar-nav navbar-right">
-                
-            </ul>
-        </div>
-    </div>
-</div>
-
-        <div class="container-fluid">
-            
-                <div class="row sm-extra-padding">
-                    <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
-    <div class="sidebar-top">
-        <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
-        <div class="small" role="search">
-            <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
-                <div class="form-group">
-                    <input type="text" name="q" placeholder="Search documentation" />
-                    <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
-                </div>
-            </form>
-        </div>
-    </div>
-    <ul class="nav bs-sidenav">
-        
-            
-        
-            
-        
-            
-        
-            
-        
-            
-        
-            
-                <li class="main"><a href="../../get_started/newt_concepts/">Chapter 1 - Get Started</a></li>
-                
-            
-        
-            
-                <li class="main"><a href="../../get_acclimated/vocabulary/">Chapter 2 - Get Acclimated</a></li>
-                
-            
-        
-            
-                <li class="main"><a href="../../newt/newt_ops/">Chapter 3 - Newt Tool</a></li>
-                
-            
-        
-            
-                <li class="main"><a href="../../os/mynewt_os/">Chapter 4 - Mynewt OS</a></li>
-                
-            
-        
-            
-                <li class="main"><a href="./">Chapter 5 - Modules</a></li>
-                
-                    <ul class="current-toc">
-                        
-                            <li class="toctree-l2"><a href="./">Console</a></li>
-                            
-                                
-                                    
-                                        <li class="toctree-l3"><a href="#description">Description</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#data-structures">Data structures</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#list-of-functions">List of Functions</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#function-reference">Function Reference</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_printf"> console_printf</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_add_char"> console_add_char</a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_pull_char"> console_pull_char </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_pull_char_head"> console_pull_char_head </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_queue_char"> console_queue_char </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_blocking_tx"> console_blocking_tx </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_blocking_mode"> console_blocking_mode </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_write"> console_write </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_read"> console_read </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_tx_char"> console_tx_char </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_rx_char"> console_rx_char </a></li>
-                                    
-                                        <li class="toctree-l3"><a href="#console_init"> console_init </a></li>
-                                    
-                                
-                            
-                        
-                            <li class="toctree-l2"><a href="../shell/">Shell</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../bootloader/">Bootloader</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../filesystem/">File System Abstraction</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../nffs/">Newtron Flash File System</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../testutil/">Test Utilities</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../imgmgr/">Image Manager</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../baselibc/">Baselibc library</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../elua/">Embedded Lua</a></li>
-                            
-                        
-                            <li class="toctree-l2"><a href="../json/">JSON</a></li>
-                            
-                        
-                    </ul>
-                
-            
-        
-            
-                <li class="main"><a href="../../newtmgr/overview/">Chapter 6 - Newt Manager</a></li>
-                
-            
-        
-            
-                <li class="main"><a href="../../packaging/dist/">Chapter 7 - Packaging it</a></li>
-                
-            
-        
-    </ul>
-</div></div>
-                    
-                    <div class="show-sidebar-container">
-                        <button class="show-sidebar">Docs Menu</button>
-                    </div>
-                    
-                    <div class="col-md-9 documentation-viewer" role="main">
-                        <div role="navigation" aria-label="breadcrumbs navigation">
-  <ul class="wy-breadcrumbs">
-    <li><a href="../..">Docs</a> &raquo;</li>
-    
-      
-        
-          <li>Chapter 5 - Modules &raquo;</li>
-        
-      
-    
-    <li>Console</li>
-    <li class="wy-breadcrumbs-aside">
-      
-    </li>
-  </ul>
-  <hr/>
-</div>
-                        
-                            <h1 id="console">Console<a class="headerlink" href="#console" title="Permanent link">&para;</a></h1>
-<p>The console is an operating system window where users interact with system programs of the operating system or a console application by entering text input (typically from a keyboard) and reading text output (typically on the computer terminal or monitor). The text written on the console brings some information and is a sequence of characters sent by the OS or programs running on the OS. </p>
-<p>Support is currently available for console access via the serial port on the hardware board.</p>
-<h2 id="description">Description<a class="headerlink" href="#description" title="Permanent link">&para;</a></h2>
-<p>In the Mynewt OS, the console library comes in two versions:</p>
-<ul>
-<li>full - containing the full implementation</li>
-<li>stub - containing stubs for the API</li>
-</ul>
-<p>Both of these have <code>egg.yml</code> file which states that they provide the <code>console</code> API. If an egg uses this API, it should list <code>console</code> as a requirement.
-For example, the shell egg is defined by the following egg.yml file:</p>
-<pre><code class="no-highlight">    egg.name: libs/shell 
-    egg.vers: 0.1
-    egg.deps:
-        - libs/os
-        - libs/util
-    egg.reqs:
-        - console
-    egg.identities:
-        - SHELL 
-</code></pre>
-
-<p>The project .yml file decides which version of the console egg should be included. 
-If project requires the full console capability it lists dependency <code>libs/console/full</code> in its egg.yml file. 
-On the other hand, a project may not have a physical console (e.g. a UART port to connect a terminal to) but may have a dependency on an egg that has console capability. In that case you would use a console stub. Another example would be the bootloader project where we want to keep the size of the image small. It includes the <code>libs/os</code> egg that can print out messages on a console (e.g. if there is a hard fault) and the <code>libs/util</code> egg that uses full console (but only if SHELL is present to provide a CLI). However, we do not want to use any console I/O capability in this particular bootloader project to keep the size small. We simply use the console stub instead and the egg.yml file for the project boot egg looks like the following:</p>
-<pre><code class="no-highlight">    project.name: boot
-    project.identities: bootloader
-    project.eggs:
-        - libs/os
-        - libs/bootutil
-        - libs/nffs
-        - libs/console/stub
-        - libs/util 
-</code></pre>
-
-<p>Console has 2 modes for transmit; blocking and non-blocking mode. Usually the non-blocking mode is the active one; the output buffer is drained by getting TX completion interrupts from hardware, and more data is added based on these interrupts.
-Blocking mode is used when we don't want TX completion interrupts. This is used when system crashes, and we still want to output info related to that crash.</p>
-<h2 id="data-structures">Data structures<a class="headerlink" href="#data-structures" title="Permanent link">&para;</a></h2>
-<p>Console interaction is intrinsically composed of two unidirectional systems. The console implementation uses two ring buffers containing input (receive) and output (transmit) characters, respectively. Read and write operations on the console_ring structure are managed by labeling the read location indicator the <code>cr_tail</code> and the write location indicator the <code>cr_head</code>. The console ring length is variable and is specified as the <code>cr_size</code> member of the data structure. <code>cr_buf</code> is the pointer to the actual array of data contained.</p>
-<pre><code class="no-highlight">struct console_ring {
-  32     uint8_t cr_head;
-  33     uint8_t cr_tail;
-  34     uint8_t cr_size;
-  35     uint8_t _pad;
-  36     uint8_t *cr_buf;
-  37 }
-</code></pre>
-
-<pre><code class="no-highlight">struct console_tty {
-  40     struct console_ring ct_tx;
-  41     uint8_t ct_tx_buf[CONSOLE_TX_BUF_SZ]; /* must be after console_ring */
-  42     struct console_ring ct_rx;
-  43     uint8_t ct_rx_buf[CONSOLE_RX_BUF_SZ]; /* must be after console_ring */
-  44     console_rx_cb ct_rx_cb;     /* callback that input is ready */
-  45     console_write_char ct_write_char;
-  46 } console_tty
-</code></pre>
-
-<h2 id="list-of-functions">List of Functions<a class="headerlink" href="#list-of-functions" title="Permanent link">&para;</a></h2>
-<p>The functions available in console are:</p>
-<ul>
-<li><a href="#console_printf">console_printf</a></li>
-<li><a href="#console_add_char">console_add_char</a></li>
-<li><a href="#console_pull_char">console_pull_char</a></li>
-<li><a href="#console_pull_char_head">console_pull_char_head</a></li>
-<li><a href="#console_queue_char">console_queue_char</a></li>
-<li><a href="#console_blocking_tx">console_blocking_tx</a></li>
-<li><a href="#console_blocking_mode">console_blocking_mode</a></li>
-<li><a href="#console_write">console_write</a></li>
-<li><a href="#console_read">console_read</a></li>
-<li><a href="#console_tx_char">console_tx_char</a></li>
-<li><a href="#console_rx_char">console_rx_char</a></li>
-<li><a href="#console_init">console_init</a></li>
-</ul>
-<h2 id="function-reference">Function Reference<a class="headerlink" href="#function-reference" title="Permanent link">&para;</a></h2>
-<hr />
-<h2 id="console_printf"><font color="F2853F" style="font-size:24pt"> console_printf</font><a class="headerlink" href="#console_printf" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">    void 
-    console_printf(const char *fmt, ...)
-</code></pre>
-
-<p>Writes a formatted message instead of raw output to the console. It first composes a C string containing text specified as arguments to the function or containing the elements in the variable argument list passed to it using snprintf or vsnprintf, respectively. It then uses function <code>console_write</code> to output the formatted data (messages) on the console.</p>
-<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>fmt</td>
-<td>Pointer to C string that contains a format string that follows the same specifications as format in printf. The string is printed to console.</td>
-</tr>
-<tr>
-<td>...</td>
-<td>Depending on the format string, the function may expect either a sequence of additional arguments to be used to replace a format specifier in the format string or a variable arguments list. va_list is a special type defined in <cstdarg> in stdarg.h.</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">&para;</a></h4>
-<p>None</p>
-<h4 id="notes">Notes<a class="headerlink" href="#notes" title="Permanent link">&para;</a></h4>
-<p>While <code>console_printf</code>, with its well understood formatting options in C, is more convenient and easy on the eyes than the raw output of <code>console_write</code>, the associated code size is considerably larger.</p>
-<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h4>
-<p>Example #1:</p>
-<pre><code class="no-highlight">char adv_data_buf[32];
-
-void
-task()
-{ 
-   char adv_data_buf[32];
-
-   console_printf(&quot;%s&quot;, adv_data_buf);
-}
-</code></pre>
-
-<p>Example #2:</p>
-<pre><code class="no-highlight">struct exception_frame {
-    uint32_t r0;
-    uint32_t r1;
-
-struct trap_frame {
-    struct exception_frame *ef;
-    uint32_t r2;
-    uint32_t r3;
-};
-
-void
-task(struct trap_frame *tf)
-{
-     console_printf(&quot; r0:%8.8x  r1:%8.8x&quot;, tf-&gt;ef-&gt;r0, tf-&gt;ef-&gt;r1);
-     console_printf(&quot; r8:%8.8x  r9:%8.8x&quot;, tf-&gt;r2, tf-&gt;r3);
-}
-</code></pre>
-
-<hr />
-<h2 id="console_add_char"><font color="#F2853F" style="font-size:24pt"> console_add_char</font><a class="headerlink" href="#console_add_char" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static void
-   console_add_char(struct console_ring *cr, char ch)
-</code></pre>
-
-<p>Adds a character to the console ring buffer. When you store an item in the buffer you store it at the head location, and the head advances to the next location.</p>
-<h4 id="arguments_1">Arguments<a class="headerlink" href="#arguments_1" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>*cr</td>
-<td>Pointer to a console ring data structure whose <code>cr_head</code> variable is to be set to the second argument in this function call</td>
-</tr>
-<tr>
-<td>ch</td>
-<td>Character to be inserted to the ring</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_1">Returned values<a class="headerlink" href="#returned-values_1" title="Permanent link">&para;</a></h4>
-<p>None</p>
-<h4 id="notes_1">Notes<a class="headerlink" href="#notes_1" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_1">Example<a class="headerlink" href="#example_1" title="Permanent link">&para;</a></h4>
-<p>Add a new line character to the output (transmit) buffer.</p>
-<pre><code class="no-highlight">void
-task()
-{
-     struct console_ring *tx = &amp;ct-&gt;ct_tx;
-
-     console_add_char(tx, '\n');
-}
-</code></pre>
-
-<hr />
-<h2 id="console_pull_char"><font color="#F2853F" style="font-size:24pt"> console_pull_char </font><a class="headerlink" href="#console_pull_char" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static uint8_t
-   console_pull_char(struct console_ring *cr)
-</code></pre>
-
-<p>Reads (remove) a byte from the console ring buffer. When you read (pull) an item, you read it at the current tail location, and the tail advances to the next position. </p>
-<h4 id="arguments_2">Arguments<a class="headerlink" href="#arguments_2" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>*cr</td>
-<td>Pointer to the console ring buffer from where a character is to be removed</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_2">Returned values<a class="headerlink" href="#returned-values_2" title="Permanent link">&para;</a></h4>
-<p>Returns the character pulled from the ring buffer.</p>
-<h4 id="notes_2">Notes<a class="headerlink" href="#notes_2" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_2">Example<a class="headerlink" href="#example_2" title="Permanent link">&para;</a></h4>
-<p>Read the characters in the ring buffer into a string.</p>
-<pre><code class="no-highlight">void
-task(struct console_ring *cr, char *str, int cnt)
-{    
-     for (i = 0; i &lt; cnt; i++) {
-          if (cr-&gt;cr_head == cr-&gt;cr_tail) {
-              i = -1;
-              break;
-          }
-     ch = console_pull_char(cr);
-     *str++ = ch;
-     }
-}
-</code></pre>
-
-<hr />
-<h2 id="console_pull_char_head"><font color="#F2853F" style="font-size:24pt"> console_pull_char_head </font><a class="headerlink" href="#console_pull_char_head" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static void
-   console_pull_char_head(struct console_ring *cr)
-</code></pre>
-
-<p>Removes the last character inserted into the ring buffer by moving back the head location and shrinking the ring size by 1. </p>
-<h4 id="arguments_3">Arguments<a class="headerlink" href="#arguments_3" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>cr</td>
-<td>Pointer to the console ring buffer from which the last inserted character must be deleted</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_3">Returned values<a class="headerlink" href="#returned-values_3" title="Permanent link">&para;</a></h4>
-<p>None</p>
-<h4 id="notes_3">Notes<a class="headerlink" href="#notes_3" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_3">Example<a class="headerlink" href="#example_3" title="Permanent link">&para;</a></h4>
-<p>In order to see a character getting deleted when a user hits backspace while typying a command, the following needs to happen in sequence:</p>
-<ul>
-<li>output a backspace (move cursor back one character)</li>
-<li>output space (erasing whatever character there was before)</li>
-<li>output backspace (move cursor back one character)</li>
-<li>remove the previous character from incoming RX queue</li>
-</ul>
-<p>The example below shows console_pull_char_head being used for the last step.</p>
-<pre><code class="no-highlight">void
-task(uint8_t data)
-{
-      struct console_tty *ct = (struct console_tty *)arg;
-      struct console_ring *tx = &amp;ct-&gt;ct_tx;
-      struct console_ring *rx = &amp;ct-&gt;ct_rx;
-
-      switch (data) {
-      case '\b':
-          console_add_char(tx, '\b');
-          console_add_char(tx, ' ');
-          console_add_char(tx, '\b');
-          console_pull_char_head(rx);
-          break;
-      }
-}
-
-</code></pre>
-
-<hr />
-<h2 id="console_queue_char"><font color="#F2853F" style="font-size:24pt"> console_queue_char </font><a class="headerlink" href="#console_queue_char" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static void
-   console_queue_char(char ch)
-</code></pre>
-
-<p>Manage the buffer queue before inserting a character into it. If the head of the output (transmit) console ring is right up to its tail, the queue needs to be drained first before any data can be added. Then it uses console_add_char function to add the character.</p>
-<h4 id="arguments_4">Arguments<a class="headerlink" href="#arguments_4" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>ch</td>
-<td>Character to be inserted to the queue</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_4">Returned values<a class="headerlink" href="#returned-values_4" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_4">Notes<a class="headerlink" href="#notes_4" title="Permanent link">&para;</a></h4>
-<p>Function blocks interrupts as a way of protecting against concurrent access to TX buffer.</p>
-<p>If TX buffer is full, the function waits for TX buffer to drain. And the way it does it currently is by calling os_time_delay(). Therefore this function should only be called from within a task context, not from an interrupt handler. We might want to change this...</p>
-<h4 id="example_4">Example<a class="headerlink" href="#example_4" title="Permanent link">&para;</a></h4>
-<pre><code class="no-highlight">Insert example
-</code></pre>
-
-<hr />
-<h2 id="console_blocking_tx"><font color="#F2853F" style="font-size:24pt"> console_blocking_tx </font><a class="headerlink" href="#console_blocking_tx" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">    static void
-    console_blocking_tx(char ch)
-</code></pre>
-
-<p>Calls the hal function hal_uart_blocking_tx to transmit a byte to the console over UART in a blocking mode until the entire character has been sent. Hence it must be called with interrupts disabled. It is used when printing diagnostic output from system crash. </p>
-<h4 id="arguments_5">Arguments<a class="headerlink" href="#arguments_5" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>ch</td>
-<td>8 bit character (data) to be transmitted</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_5">Returned values<a class="headerlink" href="#returned-values_5" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_5">Notes<a class="headerlink" href="#notes_5" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_5">Example<a class="headerlink" href="#example_5" title="Permanent link">&para;</a></h4>
-<p>Here is an example of a console output queue being flushed.</p>
-<pre><code class="no-highlight">void
-task(void)
-{
-    struct console_tty *ct = &amp;console_tty;
-    uint8_t byte;
-
-    while (ct-&gt;ct_tx.cr_head != ct-&gt;ct_tx.cr_tail) {
-        byte = console_pull_char(&amp;ct-&gt;ct_tx);
-        console_blocking_tx(byte);
-    }
-}
-</code></pre>
-
-<hr />
-<h2 id="console_blocking_mode"><font color="#F2853F" style="font-size:24pt"> console_blocking_mode </font><a class="headerlink" href="#console_blocking_mode" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   void
-   console_blocking_mode(void)
-</code></pre>
-
-<p>Calls the console_blocking_tx function to flush the buffered console output (transmit) queue. The function OS_ENTER_CRITICAL() is called to disable interrupts and OS_EXIT_CRITICAL() is called to enable interrupts back again once the buffer is flushed.</p>
-<h4 id="arguments_6">Arguments<a class="headerlink" href="#arguments_6" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>none</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_6">Returned values<a class="headerlink" href="#returned-values_6" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_6">Notes<a class="headerlink" href="#notes_6" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_6">Example<a class="headerlink" href="#example_6" title="Permanent link">&para;</a></h4>
-<p>Here is an example of calling <code>console_blocking_mode</code> and printing crash information from an assert to help debug.</p>
-<pre><code class="no-highlight">void
-_assert_func(const char *file, int line, const char *func, const char *e)
-{
-    int sr;
-
-    OS_ENTER_CRITICAL(sr);
-    (void)sr;
-    os_die_line = line;
-    os_die_module = file;
-    console_blocking_mode();
-    console_printf(&quot;Assert %s; failed in %s:%d\n&quot;, e ? e : &quot;&quot;, file, line);
-    system_reset();
-}
-</code></pre>
-
-<hr />
-<h2 id="console_write"><font color="#F2853F" style="font-size:24pt"> console_write </font><a class="headerlink" href="#console_write" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   void
-   console_write(char *str, int cnt)
-</code></pre>
-
-<p>Transmit characters to console display over serial port. </p>
-<h4 id="arguments_7">Arguments<a class="headerlink" href="#arguments_7" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>*str</td>
-<td>pointer to the character or packet to be transmitted</td>
-</tr>
-<tr>
-<td>cnt</td>
-<td>size of the character or packet</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_7">Returned values<a class="headerlink" href="#returned-values_7" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_7">Notes<a class="headerlink" href="#notes_7" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_7">Example<a class="headerlink" href="#example_7" title="Permanent link">&para;</a></h4>
-<p>Here is an example of the function being used in an echo command with a newline at the end.</p>
-<pre><code class="no-highlight">static int
-shell_echo_cmd(int argc, char **argv)
-{
-    int i;
-
-    for (i = 1; i &lt; argc; i++) {
-        console_write(argv[i], strlen(argv[i]));
-        console_write(&quot; &quot;, sizeof(&quot; &quot;)-1);
-    }
-    console_write(&quot;\n&quot;, sizeof(&quot;\n&quot;)-1);
-
-    return (0);
-}
-</code></pre>
-
-<hr />
-<h2 id="console_read"><font color="#F2853F" style="font-size:24pt"> console_read </font><a class="headerlink" href="#console_read" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">  int
-  console_read(char *str, int cnt)
-</code></pre>
-
-<p>Calls hal function hal_uart_start_rx to start receiving input from console terminal over serial port.</p>
-<h4 id="arguments_8">Arguments<a class="headerlink" href="#arguments_8" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>xx</td>
-<td>explain argument xx</td>
-</tr>
-<tr>
-<td>yy</td>
-<td>explain argument yy</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_8">Returned values<a class="headerlink" href="#returned-values_8" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_8">Notes<a class="headerlink" href="#notes_8" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_8">Example<a class="headerlink" href="#example_8" title="Permanent link">&para;</a></h4>
-<p>Give at least one example of usage.</p>
-<hr />
-<h2 id="console_tx_char"><font color="#F2853F" style="font-size:24pt"> console_tx_char </font><a class="headerlink" href="#console_tx_char" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static int
-   console_tx_char(void *arg)
-</code></pre>
-
-<h4 id="arguments_9">Arguments<a class="headerlink" href="#arguments_9" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>xx</td>
-<td>explain argument xx</td>
-</tr>
-<tr>
-<td>yy</td>
-<td>explain argument yy</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_9">Returned values<a class="headerlink" href="#returned-values_9" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_9">Notes<a class="headerlink" href="#notes_9" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_9">Example<a class="headerlink" href="#example_9" title="Permanent link">&para;</a></h4>
-<p>Give at least one example of usage.</p>
-<hr />
-<h2 id="console_rx_char"><font color="#F2853F" style="font-size:24pt"> console_rx_char </font><a class="headerlink" href="#console_rx_char" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   static int
-   console_rx_char(void *arg, uint8_t data)
-</code></pre>
-
-<h4 id="arguments_10">Arguments<a class="headerlink" href="#arguments_10" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>xx</td>
-<td>explain argument xx</td>
-</tr>
-<tr>
-<td>yy</td>
-<td>explain argument yy</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_10">Returned values<a class="headerlink" href="#returned-values_10" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_10">Notes<a class="headerlink" href="#notes_10" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_10">Example<a class="headerlink" href="#example_10" title="Permanent link">&para;</a></h4>
-<p>Give at least one example of usage.</p>
-<hr />
-<h2 id="console_init"><font color="#F2853F" style="font-size:24pt"> console_init </font><a class="headerlink" href="#console_init" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   console_init(console_rx_cb rx_cb)
-</code></pre>
-
-<p>Initializes console receive buffer and calls hal funtions hal_uart_init_cbs and hal_uart_config to initialize serial port connection and configure it (e.g. baud rate, flow control etc.)</p>
-<h4 id="arguments_11">Arguments<a class="headerlink" href="#arguments_11" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>xx</td>
-<td>explain argument xx</td>
-</tr>
-<tr>
-<td>yy</td>
-<td>explain argument yy</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_11">Returned values<a class="headerlink" href="#returned-values_11" title="Permanent link">&para;</a></h4>
-<p>List any values returned.
-Error codes?</p>
-<h4 id="notes_11">Notes<a class="headerlink" href="#notes_11" title="Permanent link">&para;</a></h4>
-<p>Any special feature/special benefit that we want to tout. 
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).</p>
-<h4 id="example_11">Example<a class="headerlink" href="#example_11" title="Permanent link">&para;</a></h4>
-<p>Give at least one example of usage.</p>
-<hr />
-                        
-                    </div>
-                </div>
-            
-            <div class="row">    
-                <footer>
-    <div class="row">
-        <div class="col-md-12">
-            
-                <p class="copyright">Copyright &copy; 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-            
-        </div>
-    </div>
-    <div class="copyright-logos">
-        <div class="row">
-            <div class="col-xs-6 text-right">
-                <img src="/img/apache-feather.png" alt="Apache" title="Apache">
-            </div>
-            <div class="col-xs-6 text-left">
-                <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-12">
-            <small class="footnote">
-                MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-            </small>
-        </div>
-    </div>
-</footer>
-            </div>
-        </div>
-
-        <script src="../../js/jquery-1.10.2.min.js"></script>
-        <script src="../../js/bootstrap-3.0.3.min.js"></script>
-        <script src="../../js/highlight.pack.js"></script>
-        <script src="../../js/base.js"></script>
-        <script src="../../js/custom.js"></script>
-
-    </body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/2b05c3ee/modules/elua/index.html
----------------------------------------------------------------------
diff --git a/modules/elua/index.html b/modules/elua/index.html
deleted file mode 100644
index 1d26cec..0000000
--- a/modules/elua/index.html
+++ /dev/null
@@ -1,364 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <meta charset="utf-8">
-        <meta http-equiv="X-UA-Compatible" content="IE=edge">
-        <meta name="viewport" content="width=device-width, initial-scale=1.0">
-        
-        
-        <link rel="canonical" href="http://mynewt.incubator.apache.org/modules/elua/">
-        <link rel="shortcut icon" href="../../img/favicon.ico">
-
-	<title>Embedded Lua - Apache Mynewt</title>
-
-        <link href="../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
-        <link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
-        <link rel="stylesheet" href="../../css/highlight.css">
-        <link href="../../css/base.css" rel="stylesheet">
-        <link href="../../css/custom.css" rel="stylesheet">
-        <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
-        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
-        <link href="../../extra.css" rel="stylesheet">
-
-        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
-        <!--[if lt IE 9]>
-            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
-            <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
-        <![endif]-->
-
-        
-            <script>
-                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-                })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-                ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
-                ga('send', 'pageview');
-            </script>
-        
-    </head>
-
-
-    <body class="Embedded Lua">
-
-
-        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
-    <div class="logo-container">
-        <img src="/img/logo.svg">
-    </div>
-    <div class="container-fluid">
-        <!-- Collapsed navigation -->
-        <div class="navbar-header">
-            <!-- Expander button -->
-            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-                <span class="sr-only">Toggle navigation</span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </button>
-
-        </div>
-
-        <!-- Expanded navigation -->
-        <div class="navbar-collapse collapse">
-            <!-- Main navigation -->
-            <ul class="nav navbar-nav navbar-right">
-                <li>
-                    <a href="/">Home</a>
-                </li>
-                <li>
-                    <a href="/documentation/">Docs</a>
-                </li>
-                <li>
-                    <a href="/download/">Download</a>
-                </li>
-                <li>
-                    <a href="/community/">Community</a>
-                </li>
-                <li>
-                    <a href="/events/">Events</a>
-                </li>
-            </ul>
-
-            <!-- Search, Navigation and Repo links -->
-            <ul class="nav navbar-nav navbar-right">
-                
-            </ul>
-        </div>
-    </div>
-</div>
-
-        <div class="container-fluid">
-            
-                <div class="row sm-extra-padding">
-                    <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
-    <div class="sidebar-top">
-        <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
-        <div class="small" role="search">
-            <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
-                <div class="form-group">
-                    <input type="text" name="q" placeholder="Search documentation" />
-                    <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
-                </div>
-            </form>
-        </div>
-    </div>
-    <ul class="nav bs-sidenav">
-      
-        
-      
-        
-      
-        
-      
-        
-      
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../get_started/newt_concepts/
-">Chapter 1 - Get Started</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../get_acclimated/vocabulary/
-">Chapter 2 - Get Acclimated</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../newt/newt_ops/
-">Chapter 3 - Newt Tool</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../os/mynewt_os/
-">Chapter 4 - Mynewt OS</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  
-  
-  ../console/console/
-
-">Chapter 5 - Modules</a>
-    
-      <ul class="current-toc">
-          
-              
-  
-  <li><a href="
-  ../console/console/
-">Console</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../shell/shell/
-">Shell</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../bootloader/bootloader/
-">Bootloader</a>
-    
-  </li>
-
-          
-              
-  
-    <li>
-      <a href="../filesystem/">File System Abstraction</a>
-    </li>
-  
-
-          
-              
-  
-    <li>
-      <a href="../nffs/">Newtron Flash File System</a>
-    </li>
-  
-
-          
-              
-  
-  <li><a href="
-  ../testutil/testutil/
-">Test Utilities</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../imgmgr/imgmgr/
-">Image Manager</a>
-    
-  </li>
-
-          
-              
-  
-    <li>
-      <a href="../baselibc/">Baselibc library</a>
-    </li>
-  
-
-          
-              
-  
-    <li class="active">
-      Embedded Lua
-    </li>
-  
-
-          
-              
-  
-  <li><a href="
-  ../json/json/
-">JSON</a>
-    
-  </li>
-
-          
-      </ul>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../newtmgr/overview/
-">Chapter 6 - Newt Manager</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../packaging/dist/
-">Chapter 7 - Packaging it</a>
-    
-  </li>
-
-        
-      
-    </ul>
-</div></div>
-                    
-                    <div class="show-sidebar-container">
-                        <button class="show-sidebar">Docs Menu</button>
-                    </div>
-                    
-                    <div class="col-md-9 documentation-viewer" role="main">
-                        <div role="navigation" aria-label="breadcrumbs navigation">
-  <ul class="wy-breadcrumbs">
-    <li><a href="../..">Docs</a> &raquo;</li>
-    
-      
-        
-          <li>Chapter 5 - Modules &raquo;</li>
-        
-      
-    
-    <li>Embedded Lua</li>
-    <li class="wy-breadcrumbs-aside">
-      
-    </li>
-  </ul>
-  <hr/>
-</div>
-                        
-                            <h1 id="elua">elua<a class="headerlink" href="#elua" title="Permanent link">&para;</a></h1>
-<p>Insert synopsis here</p>
-<h2 id="description">Description<a class="headerlink" href="#description" title="Permanent link">&para;</a></h2>
-<p>Describe module here, special features, how pieces fit together etc.</p>
-<h2 id="data-structures">Data structures<a class="headerlink" href="#data-structures" title="Permanent link">&para;</a></h2>
-<p>Replace this with the list of data structures used, why, any neat features</p>
-<h2 id="list-of-functions">List of Functions<a class="headerlink" href="#list-of-functions" title="Permanent link">&para;</a></h2>
-<p><Comments such as these instructions are placed within angle brackets. List all the functions here. Note how the anchors work. You put the text you want to show up as a link within [] and the relevant #heading within (). Note that the header has to have at least 2 words for the anchor to work - that's how it is. "no-highlight" disables syntax highlighting. You can enable it for a particular language by specifying what the language is instead of "no-highlight". Be warned that this highlighting or no-highlighting specification may not show up nicely on Mou.></p>
-                        
-                    </div>
-                </div>
-            
-            <div class="row">    
-                <footer>
-    <div class="row">
-        <div class="col-md-12">
-            
-                <p class="copyright">Copyright &copy; 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-            
-        </div>
-    </div>
-    <div class="copyright-logos">
-        <div class="row">
-            <div class="col-xs-6 text-right">
-                <img src="/img/apache-feather.png" alt="Apache" title="Apache">
-            </div>
-            <div class="col-xs-6 text-left">
-                <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-12">
-            <small class="footnote">
-                MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-            </small>
-        </div>
-    </div>
-</footer>
-            </div>
-        </div>
-
-        <script src="../../js/jquery-1.10.2.min.js"></script>
-        <script src="../../js/bootstrap-3.0.3.min.js"></script>
-        <script src="../../js/highlight.pack.js"></script>
-        <script src="../../js/base.js"></script>
-        <script src="../../js/custom.js"></script>
-
-    </body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/2b05c3ee/modules/filesystem/index.html
----------------------------------------------------------------------
diff --git a/modules/filesystem/index.html b/modules/filesystem/index.html
deleted file mode 100644
index 8ba899b..0000000
--- a/modules/filesystem/index.html
+++ /dev/null
@@ -1,1126 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <meta charset="utf-8">
-        <meta http-equiv="X-UA-Compatible" content="IE=edge">
-        <meta name="viewport" content="width=device-width, initial-scale=1.0">
-        
-        
-        <link rel="canonical" href="http://mynewt.incubator.apache.org/modules/filesystem/">
-        <link rel="shortcut icon" href="../../img/favicon.ico">
-
-	<title>File System Abstraction - Apache Mynewt</title>
-
-        <link href="../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
-        <link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
-        <link rel="stylesheet" href="../../css/highlight.css">
-        <link href="../../css/base.css" rel="stylesheet">
-        <link href="../../css/custom.css" rel="stylesheet">
-        <link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700,900,300,100' rel='stylesheet' type='text/css'>
-        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
-        <link href="../../extra.css" rel="stylesheet">
-
-        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
-        <!--[if lt IE 9]>
-            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
-            <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
-        <![endif]-->
-
-        
-            <script>
-                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-                })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-                ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
-                ga('send', 'pageview');
-            </script>
-        
-    </head>
-
-
-    <body class="File System Abstraction">
-
-
-        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
-    <div class="logo-container">
-        <img src="/img/logo.svg">
-    </div>
-    <div class="container-fluid">
-        <!-- Collapsed navigation -->
-        <div class="navbar-header">
-            <!-- Expander button -->
-            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-                <span class="sr-only">Toggle navigation</span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-                <span class="icon-bar"></span>
-            </button>
-
-        </div>
-
-        <!-- Expanded navigation -->
-        <div class="navbar-collapse collapse">
-            <!-- Main navigation -->
-            <ul class="nav navbar-nav navbar-right">
-                <li>
-                    <a href="/">Home</a>
-                </li>
-                <li>
-                    <a href="/documentation/">Docs</a>
-                </li>
-                <li>
-                    <a href="/download/">Download</a>
-                </li>
-                <li>
-                    <a href="/community/">Community</a>
-                </li>
-                <li>
-                    <a href="/events/">Events</a>
-                </li>
-            </ul>
-
-            <!-- Search, Navigation and Repo links -->
-            <ul class="nav navbar-nav navbar-right">
-                
-            </ul>
-        </div>
-    </div>
-</div>
-
-        <div class="container-fluid">
-            
-                <div class="row sm-extra-padding">
-                    <div class="col-md-3 bg-grey sidebar-container"><div class="bs-sidebar hidden-print" role="complementary">
-    <div class="sidebar-top">
-        <img class="hidden-xs hidden-sm logo-small" src="/img/logo.svg" alt="MyNewt" title="MyNewt">
-        <div class="small" role="search">
-            <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
-                <div class="form-group">
-                    <input type="text" name="q" placeholder="Search documentation" />
-                    <button class="search-button" type="submit"><i class="fa fa-search"></i></button>
-                </div>
-            </form>
-        </div>
-    </div>
-    <ul class="nav bs-sidenav">
-      
-        
-      
-        
-      
-        
-      
-        
-      
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../get_started/newt_concepts/
-">Chapter 1 - Get Started</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../get_acclimated/vocabulary/
-">Chapter 2 - Get Acclimated</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../newt/newt_ops/
-">Chapter 3 - Newt Tool</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../os/mynewt_os/
-">Chapter 4 - Mynewt OS</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  
-  
-  ../console/console/
-
-">Chapter 5 - Modules</a>
-    
-      <ul class="current-toc">
-          
-              
-  
-  <li><a href="
-  ../console/console/
-">Console</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../shell/shell/
-">Shell</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../bootloader/bootloader/
-">Bootloader</a>
-    
-  </li>
-
-          
-              
-  
-    <li class="active">
-      File System Abstraction
-    </li>
-  
-
-          
-              
-  
-    <li>
-      <a href="../nffs/">Newtron Flash File System</a>
-    </li>
-  
-
-          
-              
-  
-  <li><a href="
-  ../testutil/testutil/
-">Test Utilities</a>
-    
-  </li>
-
-          
-              
-  
-  <li><a href="
-  ../imgmgr/imgmgr/
-">Image Manager</a>
-    
-  </li>
-
-          
-              
-  
-    <li>
-      <a href="../baselibc/">Baselibc library</a>
-    </li>
-  
-
-          
-              
-  
-    <li>
-      <a href="../elua/">Embedded Lua</a>
-    </li>
-  
-
-          
-              
-  
-  <li><a href="
-  ../json/json/
-">JSON</a>
-    
-  </li>
-
-          
-      </ul>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../newtmgr/overview/
-">Chapter 6 - Newt Manager</a>
-    
-  </li>
-
-        
-      
-        
-          
-  
-  <li><a href="
-  ../../packaging/dist/
-">Chapter 7 - Packaging it</a>
-    
-  </li>
-
-        
-      
-    </ul>
-</div></div>
-                    
-                    <div class="show-sidebar-container">
-                        <button class="show-sidebar">Docs Menu</button>
-                    </div>
-                    
-                    <div class="col-md-9 documentation-viewer" role="main">
-                        <div role="navigation" aria-label="breadcrumbs navigation">
-  <ul class="wy-breadcrumbs">
-    <li><a href="../..">Docs</a> &raquo;</li>
-    
-      
-        
-          <li>Chapter 5 - Modules &raquo;</li>
-        
-      
-    
-    <li>File System Abstraction</li>
-    <li class="wy-breadcrumbs-aside">
-      
-    </li>
-  </ul>
-  <hr/>
-</div>
-                        
-                            <h1 id="filesystem">Filesystem<a class="headerlink" href="#filesystem" title="Permanent link">&para;</a></h1>
-<p>Mynewt provides a Flash File System abstraction layer (fs) to allow you to swap out the default Newtron File System (nffs) with a different file system of your choice. </p>
-<h2 id="description">Description<a class="headerlink" href="#description" title="Permanent link">&para;</a></h2>
-<p>The default file system used in the Mynewt OS is the Newtron Flash File System (nffs). Hence the <code>nffs</code> egg description lists <code>libs/fs</code> as a dependency. </p>
-<pre><code class="no-highlight">egg.name: libs/nffs
-egg.vers: 0.1
-egg.identities: NFFS
-egg.deps:
-    - libs/os
-    - libs/fs
-    - libs/testutil
-    - hw/hal
-</code></pre>
-
-<p>If the user wishes to use a different flash file system (say, "ownffs"), the directory containing "ownffs" code must include the <code>egg.yml</code> file stating the dependency on <code>libs/fs</code> listed as shown above. "ownffs" uses the <code>libs/fs</code> API available in mynewt, thus minimizing changes to other parts of the project.</p>
-<p>Note that this generic file system (<code>fs</code>) API does not expose any file system detection, initialization, and formatting functions. These function calls remain specific to the chosen file system. For example, Project Slinky uses the default Newtron File System (nffs) and therefore calls nffs_init() to initialize the nffs memory and data structures before any other file system operations are attempted. As shown below, the egg for Project Slinky includes the <code>libs/imgmgr</code> egg which in turn includes the <code>libs/bootutil</code> egg. The egg description for <code>libs/bootutil</code> specifies <code>fs/nffs</code> as a dependency.</p>
-<pre><code class="no-highlight">
-    egg.name: project/slinky
-    egg.vers: 0.1
-    egg.deps:
-        - libs/os
-        - libs/console/full
-        - libs/shell
-        - libs/newtmgr
-        - libs/imgmgr
-        - sys/config
-        - sys/log
-        - sys/stats
-</code></pre>
-
-<pre><code class="no-highlight">
-    egg.name: libs/imgmgr
-    egg.vers: 0.1
-    egg.deps:
-        - libs/newtmgr
-        - libs/bootutil
-    egg.deps.FS:
-        - fs/fs
-    egg.cflags.FS: -DFS_PRESENT
-</code></pre>
-
-<pre><code class="no-highlight">
-    egg.name: libs/bootutil
-    egg.vers: 0.1 
-    egg.deps: 
-        - fs/nffs
-        - libs/os 
-        - libs/testutil
-        - hw/hal
-</code></pre>
-
-<h2 id="data-structures">Data Structures<a class="headerlink" href="#data-structures" title="Permanent link">&para;</a></h2>
-<h2 id="api">API<a class="headerlink" href="#api" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   struct fs_file;
-</code></pre>
-
-<p>The functions available in this OS feature are:</p>
-<ul>
-<li><a href="#fs_open">fs_open</a></li>
-<li><a href="#fs_close">fs_close</a></li>
-<li><a href="#fs_read">fs_read</a></li>
-<li><a href="#fs_write">fs_write</a></li>
-<li><a href="#fs_seek">fs_seek</a></li>
-<li><a href="#fs_getpos">fs_getpos</a></li>
-<li><a href="#fs_filelen">fs_filelen</a></li>
-<li><a href="#fs_unlink">fs_unlink</a></li>
-<li><a href="#fs_rename">fs_rename</a></li>
-<li><a href="#fs_mkdir">fs_mkdir</a></li>
-<li><a href="#fs_opendir">fs_opendir</a></li>
-<li><a href="#fs_readdir">fs_readdir</a></li>
-<li><a href="#fs_closedir">fs_closedir</a></li>
-<li><a href="#fs_dirent_name">fs_dirent_name</a></li>
-<li><a href="#fs_dirent_is_dir">fs_dirent_is_dir</a></li>
-</ul>
-<p>Additional file system utilities that bundle some of the basic functions above are:</p>
-<ul>
-<li><a href="#fsutil_read_file">fsutil_read_file</a></li>
-<li><a href="#fsutil_write_file">fsutil_write_file</a></li>
-</ul>
-<h2 id="api-reference">API Reference<a class="headerlink" href="#api-reference" title="Permanent link">&para;</a></h2>
-<hr />
-<h2 id="fs_open"><font color="F2853F" style="font-size:24pt"> fs_open </font><a class="headerlink" href="#fs_open" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">    int
-    fs_open(const char *filename, uint8_t access_flags, struct fs_file **out_file);
-</code></pre>
-
-<p>Opens a file at the specified path.  The result of opening a nonexistent file depends on the access flags specified.  All intermediate directories must already exist.</p>
-<p>The mode strings passed to fopen() map to fs_open()'s access flags as follows:</p>
-<pre><code class="no-highlight">    &quot;r&quot;  -  FS_ACCESS_READ
-    &quot;r+&quot; -  FS_ACCESS_READ | FS_ACCESS_WRITE
-    &quot;w&quot;  -  FS_ACCESS_WRITE | FS_ACCESS_TRUNCATE
-    &quot;w+&quot; -  FS_ACCESS_READ | FS_ACCESS_WRITE | FS_ACCESS_TRUNCATE
-    &quot;a&quot;  -  FS_ACCESS_WRITE | FS_ACCESS_APPEND
-    &quot;a+&quot; -  FS_ACCESS_READ | FS_ACCESS_WRITE | FS_ACCESS_APPEND
-</code></pre>
-
-<h4 id="arguments">Arguments<a class="headerlink" href="#arguments" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>filename</td>
-<td>Pointer to the file created at the path of the specified filename</td>
-</tr>
-<tr>
-<td>access_flags</td>
-<td>Flags controlling file access; see above table</td>
-</tr>
-<tr>
-<td>out_file</td>
-<td>On success, a pointer to the newly-created file handle gets written here</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values">Returned values<a class="headerlink" href="#returned-values" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes">Notes<a class="headerlink" href="#notes" title="Permanent link">&para;</a></h4>
-<p>There is no concept of current working directory. Therefore all file names should start with '/'.</p>
-<h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">
-&lt;Insert the code snippet here&gt;
-
-</code></pre>
-
-<hr />
-<h2 id="fs_close"><font color="#F2853F" style="font-size:24pt"> fs_close </font><a class="headerlink" href="#fs_close" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_close(struct fs_file *file)
-</code></pre>
-
-<p>Closes the specified file and invalidates the file handle.  If the file has already been unlinked, and this is the last open handle to the file, this operation causes the file to be deleted from disk.</p>
-<h4 id="arguments_1">Arguments<a class="headerlink" href="#arguments_1" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the file to close</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_1">Returned values<a class="headerlink" href="#returned-values_1" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_1">Notes<a class="headerlink" href="#notes_1" title="Permanent link">&para;</a></h4>
-<p>Don't use file handle after closing the file.</p>
-<h4 id="example_1">Example<a class="headerlink" href="#example_1" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">
-&lt;Insert the code snippet here&gt;
-
-</code></pre>
-
-<hr />
-<h2 id="fs_read"><font color="#F2853F" style="font-size:24pt"> fs_read </font><a class="headerlink" href="#fs_read" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_read(struct fs_file *file, uint32_t len, void *out_data, uint32_t *out_len);
-</code></pre>
-
-<p>Reads data from the specified file.  If more data is requested than remains in the file, all available data is retrieved. Function returns in <code>out_len</code> the actual number of bytes read (less or equal to <code>len</code>).</p>
-<h4 id="arguments_2">Arguments<a class="headerlink" href="#arguments_2" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the the file to read from</td>
-</tr>
-<tr>
-<td>len</td>
-<td>The number of bytes to attempt to read</td>
-</tr>
-<tr>
-<td>out_data</td>
-<td>The destination buffer to read into</td>
-</tr>
-<tr>
-<td>out_len</td>
-<td>On success, the number of bytes actually read gets written here.  Pass null if you don't care.</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_2">Returned values<a class="headerlink" href="#returned-values_2" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_2">Notes<a class="headerlink" href="#notes_2" title="Permanent link">&para;</a></h4>
-<p>This type of short read results in a success return code.</p>
-<h4 id="example_2">Example<a class="headerlink" href="#example_2" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-
-</code></pre>
-
-<hr />
-<h2 id="fs_write"><font color="#F2853F" style="font-size:24pt"> fs_write </font><a class="headerlink" href="#fs_write" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_write(struct fs_file *file, const void *data, int len);
-</code></pre>
-
-<p>Writes the supplied data to the current offset of the specified file handle.  </p>
-<h4 id="arguments_3">Arguments<a class="headerlink" href="#arguments_3" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the file to write to</td>
-</tr>
-<tr>
-<td>data</td>
-<td>The data to write</td>
-</tr>
-<tr>
-<td>len</td>
-<td>The number of bytes to write</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_3">Returned values<a class="headerlink" href="#returned-values_3" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_3">Notes<a class="headerlink" href="#notes_3" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_3">Example<a class="headerlink" href="#example_3" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_seek"><font color="#F2853F" style="font-size:24pt"> fs_seek </font><a class="headerlink" href="#fs_seek" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_seek(struct fs_file *file, uint32_t offset);
-</code></pre>
-
-<p>Positions a file's read and write pointer at the specified offset.  The offset is expressed as the number of bytes from the start of the file (i.e., seeking to offset 0 places the pointer at the first byte in the file). </p>
-<h4 id="arguments_4">Arguments<a class="headerlink" href="#arguments_4" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the file to reposition</td>
-</tr>
-<tr>
-<td>offset</td>
-<td>The 0-based file offset to seek to</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_4">Returned values<a class="headerlink" href="#returned-values_4" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_4">Notes<a class="headerlink" href="#notes_4" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_4">Example<a class="headerlink" href="#example_4" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_getpos"><font color="#F2853F" style="font-size:24pt"> fs_getpos </font><a class="headerlink" href="#fs_getpos" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   uint32_t
-   fs_getpos(const struct fs_file *file);
-</code></pre>
-
-<p>Retrieves the current read and write position of the specified open file. </p>
-<h4 id="arguments_5">Arguments<a class="headerlink" href="#arguments_5" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the file to query</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_5">Returned values<a class="headerlink" href="#returned-values_5" title="Permanent link">&para;</a></h4>
-<ul>
-<li>The file offset, in bytes</li>
-</ul>
-<h4 id="notes_5">Notes<a class="headerlink" href="#notes_5" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_5">Example<a class="headerlink" href="#example_5" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_filelen"><font color="#F2853F" style="font-size:24pt"> fs_filelen </font><a class="headerlink" href="#fs_filelen" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_filelen(const struct fs_file *file, uint32_t *out_len);
-
-</code></pre>
-
-<p>Retrieves the current length of the specified open file.</p>
-<h4 id="arguments_6">Arguments<a class="headerlink" href="#arguments_6" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>file</td>
-<td>Pointer to the file to query</td>
-</tr>
-<tr>
-<td>out_len</td>
-<td>On success, the number of bytes in the file gets written here</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_6">Returned values<a class="headerlink" href="#returned-values_6" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_6">Notes<a class="headerlink" href="#notes_6" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_6">Example<a class="headerlink" href="#example_6" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_unlink"><font color="#F2853F" style="font-size:24pt"> fs_unlink </font><a class="headerlink" href="#fs_unlink" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_unlink(const char *filename);
-
-</code></pre>
-
-<p>Unlinks the file or directory at the specified path.  If the path refers to a directory, all the directory's descendants are recursively unlinked.  Any open file handles refering to an unlinked file remain valid, and can be read from and written to.</p>
-<h4 id="arguments_7">Arguments<a class="headerlink" href="#arguments_7" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>filename</td>
-<td>The path of the file or directory to unlink</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_7">Returned values<a class="headerlink" href="#returned-values_7" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_7">Notes<a class="headerlink" href="#notes_7" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_7">Example<a class="headerlink" href="#example_7" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_rename"><font color="#F2853F" style="font-size:24pt"> fs_rename </font><a class="headerlink" href="#fs_rename" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_rename(const char *from, const char *to);
-
-</code></pre>
-
-<p>Performs a rename and / or move of the specified source path to the specified destination.  </p>
-<h4 id="arguments_8">Arguments<a class="headerlink" href="#arguments_8" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>from</td>
-<td>The source path</td>
-</tr>
-<tr>
-<td>to</td>
-<td>The destination path</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_8">Returned values<a class="headerlink" href="#returned-values_8" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_8">Notes<a class="headerlink" href="#notes_8" title="Permanent link">&para;</a></h4>
-<p>The source path can refer to either a file or a directory.  All intermediate directories in the destination path must already exist.  If the source path refers to a file, the destination path must contain a full filename path, rather than just the new parent directory.  If an object already exists at the specified destination path, this function causes it to be unlinked prior to the rename (i.e., the destination gets clobbered).</p>
-<h4 id="example_8">Example<a class="headerlink" href="#example_8" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_mkdir"><font color="#F2853F" style="font-size:24pt"> fs_mkdir </font><a class="headerlink" href="#fs_mkdir" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_mkdir(const char *path);
-
-</code></pre>
-
-<p>Creates the directory represented by the specified path.  </p>
-<h4 id="arguments_9">Arguments<a class="headerlink" href="#arguments_9" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>path</td>
-<td>Pointer to the directory to create</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_9">Returned values<a class="headerlink" href="#returned-values_9" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure.</li>
-</ul>
-<h4 id="notes_9">Notes<a class="headerlink" href="#notes_9" title="Permanent link">&para;</a></h4>
-<p>All intermediate directories must already exist.  The specified path must start with a '/' character.</p>
-<h4 id="example_9">Example<a class="headerlink" href="#example_9" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_opendir"><font color="#F2853F" style="font-size:24pt"> fs_opendir </font><a class="headerlink" href="#fs_opendir" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">
-   int
-   fs_opendir(const char *path, struct fs_dir **out_dir);
-
-</code></pre>
-
-<p>Opens the directory at the specified path.  The directory's contents can be read with subsequent calls to fs_readdir().  When you are done with the directory handle, close it with fs_closedir(). </p>
-<h4 id="arguments_10">Arguments<a class="headerlink" href="#arguments_10" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>path</td>
-<td>Pointer to the directory to create</td>
-</tr>
-<tr>
-<td>out_dir</td>
-<td>On success, points to the directory handle</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_10">Returned values<a class="headerlink" href="#returned-values_10" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>FS_ENOENT if the specified directory does not exist (no such file)</li>
-<li>Other nonzero on error.</li>
-</ul>
-<h4 id="notes_10">Notes<a class="headerlink" href="#notes_10" title="Permanent link">&para;</a></h4>
-<p>Unlinking files from the directory while it is open may result in unpredictable behavior.  New files can be created inside the directory.</p>
-<h4 id="example_10">Example<a class="headerlink" href="#example_10" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_readdir"><font color="#F2853F" style="font-size:24pt"> fs_readdir </font><a class="headerlink" href="#fs_readdir" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_readdir(struct fs_dir *dir, struct fs_dirent **out_dirent);
-
-</code></pre>
-
-<p>Reads the next entry in an open directory. </p>
-<h4 id="arguments_11">Arguments<a class="headerlink" href="#arguments_11" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>dir</td>
-<td>The directory handle to read from</td>
-</tr>
-<tr>
-<td>out_dirent</td>
-<td>On success, points to the next child entry in the specified directory</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_11">Returned values<a class="headerlink" href="#returned-values_11" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>FS_ENOENT if there are no more entries in the parent directory</li>
-<li>Other nonzero on error.</li>
-</ul>
-<h4 id="notes_11">Notes<a class="headerlink" href="#notes_11" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_11">Example<a class="headerlink" href="#example_11" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_closedir"><font color="#F2853F" style="font-size:24pt"> fs_closedir </font><a class="headerlink" href="#fs_closedir" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_closedir(struct fs_dir *dir);
-
-</code></pre>
-
-<p>Closes the specified directory handle. </p>
-<h4 id="arguments_12">Arguments<a class="headerlink" href="#arguments_12" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>dir</td>
-<td>Pointer to the directory to close</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_12">Returned values<a class="headerlink" href="#returned-values_12" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_12">Notes<a class="headerlink" href="#notes_12" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_12">Example<a class="headerlink" href="#example_12" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_dirent_name"><font color="#F2853F" style="font-size:24pt"> fs_dirent_name </font><a class="headerlink" href="#fs_dirent_name" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_dirent_name(const struct fs_dirent *dirent, size_t max_len,
-     char *out_name, uint8_t *out_name_len);
-
-</code></pre>
-
-<p>Retrieves the filename of the specified directory entry. </p>
-<h4 id="arguments_13">Arguments<a class="headerlink" href="#arguments_13" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>dirent</td>
-<td>Pointer to the directory entry to query</td>
-</tr>
-<tr>
-<td>max_len</td>
-<td>Size of the "out_name" character buffer</td>
-</tr>
-<tr>
-<td>out_name</td>
-<td>On success, the entry's filename is written here; always null-terminated</td>
-</tr>
-<tr>
-<td>out_name_len</td>
-<td>On success, contains the actual length of the filename, NOT including the null-terminator</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_13">Returned values<a class="headerlink" href="#returned-values_13" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_13">Notes<a class="headerlink" href="#notes_13" title="Permanent link">&para;</a></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  (filename max length + 1) should be used.</p>
-<h4 id="example_13">Example<a class="headerlink" href="#example_13" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fs_dirent_is_dir"><font color="#F2853F" style="font-size:24pt"> fs_dirent_is_dir </font><a class="headerlink" href="#fs_dirent_is_dir" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fs_dirent_is_dir(const struct fs_dirent *dirent);
-
-</code></pre>
-
-<p>Tells you whether the specified directory entry is a sub-directory or a regular file. </p>
-<h4 id="arguments_14">Arguments<a class="headerlink" href="#arguments_14" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>dirent</td>
-<td>Pointer to the directory entry to query</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_14">Returned values<a class="headerlink" href="#returned-values_14" title="Permanent link">&para;</a></h4>
-<ul>
-<li>1: The entry is a directory</li>
-<li>0: The entry is a regular file.</li>
-</ul>
-<h4 id="notes_14">Notes<a class="headerlink" href="#notes_14" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_14">Example<a class="headerlink" href="#example_14" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fsutil_read_file"><font color="#F2853F" style="font-size:24pt"> fsutil_read_file </font><a class="headerlink" href="#fsutil_read_file" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fsutil_read_file(const char *path, uint32_t offset, uint32_t len, void *dst,
-                    uint32_t *out_len);
-</code></pre>
-
-<p>Calls fs_open(), fs_read(), and fs_close() to open a file at the specified path, retrieve data from the file starting from the specified offset, and close the file and invalidate the file handle.</p>
-<h4 id="arguments_15">Arguments<a class="headerlink" href="#arguments_15" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>path</td>
-<td>Pointer to the directory entry to query</td>
-</tr>
-<tr>
-<td>offset</td>
-<td>Position of the file's read pointer</td>
-</tr>
-<tr>
-<td>len</td>
-<td>Number of bytes to attempt to read</td>
-</tr>
-<tr>
-<td>dst</td>
-<td>Destination buffer to read into</td>
-</tr>
-<tr>
-<td>out_len</td>
-<td>On success, the number of bytes actually read gets written here.  Pass null if you don't care.</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_15">Returned values<a class="headerlink" href="#returned-values_15" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_15">Notes<a class="headerlink" href="#notes_15" title="Permanent link">&para;</a></h4>
-<p>This is a convenience function. You can use it if the file is small (caller has enough buffer space to hold all the file contents in memory).</p>
-<h4 id="example_15">Example<a class="headerlink" href="#example_15" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-<h2 id="fsutil_write_file"><font color="#F2853F" style="font-size:24pt"> fsutil_write_file </font><a class="headerlink" href="#fsutil_write_file" title="Permanent link">&para;</a></h2>
-<pre><code class="no-highlight">   int
-   fsutil_write_file(const char *path, const void *data, uint32_t len);
-</code></pre>
-
-<p>Calls fs_open(), fs_write(), and fs_close() to open a file at the specified path, write the supplied data to the current offset of the specified file handle, and close the file and invalidate the file handle.</p>
-<h4 id="arguments_16">Arguments<a class="headerlink" href="#arguments_16" title="Permanent link">&para;</a></h4>
-<table>
-<thead>
-<tr>
-<th>Arguments</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>path</td>
-<td>Pointer to the file to write to</td>
-</tr>
-<tr>
-<td>data</td>
-<td>The data to write</td>
-</tr>
-<tr>
-<td>len</td>
-<td>The number of bytes to write</td>
-</tr>
-</tbody>
-</table>
-<h4 id="returned-values_16">Returned values<a class="headerlink" href="#returned-values_16" title="Permanent link">&para;</a></h4>
-<ul>
-<li>0 on success</li>
-<li>nonzero on failure</li>
-</ul>
-<h4 id="notes_16">Notes<a class="headerlink" href="#notes_16" title="Permanent link">&para;</a></h4>
-<p><any notes?></p>
-<h4 id="example_16">Example<a class="headerlink" href="#example_16" title="Permanent link">&para;</a></h4>
-<p><Add text to set up the context for the example here></p>
-<pre><code class="no-highlight">&lt;Insert the code snippet here&gt;
-</code></pre>
-
-<hr />
-                        
-                    </div>
-                </div>
-            
-            <div class="row">    
-                <footer>
-    <div class="row">
-        <div class="col-md-12">
-            
-                <p class="copyright">Copyright &copy; 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 Apache and the Apache feather logo are trademarks of The Apache Software Foundation.<br>The Apache Software Foundation Apache Incubator</p>
-            
-        </div>
-    </div>
-    <div class="copyright-logos">
-        <div class="row">
-            <div class="col-xs-6 text-right">
-                <img src="/img/apache-feather.png" alt="Apache" title="Apache">
-            </div>
-            <div class="col-xs-6 text-left">
-                <img src="/img/apache-logo.png" alt="Apache Incubator" title="Apache Incubator">
-            </div>
-        </div>
-    </div>
-    <div class="row">
-        <div class="col-md-12">
-            <small class="footnote">
-                MyNewt is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-            </small>
-        </div>
-    </div>
-</footer>
-            </div>
-        </div>
-
-        <script src="../../js/jquery-1.10.2.min.js"></script>
-        <script src="../../js/bootstrap-3.0.3.min.js"></script>
-        <script src="../../js/highlight.pack.js"></script>
-        <script src="../../js/base.js"></script>
-        <script src="../../js/custom.js"></script>
-
-    </body>
-</html>
\ No newline at end of file