Lookup node in dispatching tree.</td>
</tr>
- <tr>
- <td class="name" nowrap><a href="#modifier">modifier</a> (func, order)</td>
- <td class="summary">
-
-Register a tree modifier.</td>
- </tr>
-
<tr>
<td class="name" nowrap><a href="#node">node</a> (...)</td>
<td class="summary">
<td class="name" nowrap><a href="#node_childs">node_childs</a> (node)</td>
<td class="summary">
-Return a sorted table of visible childs within a given node
+Return a sorted table of visible children within a given node
</td>
</tr>
-</dd>
-
-
-
-
-<dt><a name="modifier"></a><strong>modifier</strong> (func, order)</dt>
-<dd>
-
-
-Register a tree modifier.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- func: Modifier function
- </li>
-
- <li>
- order: Modifier order value (optional)
- </li>
-
-</ul>
-
-
-
-
-
-
-
-
</dd>
<dd>
-Return a sorted table of visible childs within a given node
+Return a sorted table of visible children within a given node
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</title>
+ <link rel="stylesheet" href="../luadoc.css" type="text/css" />
+ <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
+</head>
+
+<body>
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.html">luci.http</a>
+ </li>
+
+ <li><strong>luci.http.conditionals</strong></li>
+
+ <li>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.i18n.html">luci.i18n</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.html">luci.ip</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.json.html">luci.json</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.html">luci.jsonc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.uci.html">luci.model.uci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.html">luci.rpcc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.html">luci.sys</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.init.html">luci.sys.init</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.net.html">luci.sys.net</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.process.html">luci.sys.process</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.user.html">luci.sys.user</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.util.html">luci.util</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.html">nixio</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.File.html">nixio.File</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.README.html">nixio.README</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.Socket.html">nixio.Socket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bin.html">nixio.bin</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bit.html">nixio.bit</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.crypto.html">nixio.crypto</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.fs.html">nixio.fs</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Class <code>luci.http.conditionals</code></h1>
+
+<p></p>
+
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+ <tr>
+ <td class="name" nowrap><a href="#if_match">if_match</a> (req, stat)</td>
+ <td class="summary">
+
+14.24 / If-Match
+
+Test whether the given message object contains an "If-Match" header and
+compare it against the given stat object.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#if_modified_since">if_modified_since</a> (req, stat)</td>
+ <td class="summary">
+
+14.25 / If-Modified-Since
+
+Test whether the given message object contains an "If-Modified-Since" header
+and compare it against the given stat object.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#if_none_match">if_none_match</a> (req, stat)</td>
+ <td class="summary">
+
+14.26 / If-None-Match
+
+Test whether the given message object contains an "If-None-Match" header and
+compare it against the given stat object.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#if_range">if_range</a> (req, stat)</td>
+ <td class="summary">
+
+14.27 / If-Range
+
+The If-Range header is currently not implemented due to the lack of general
+byte range stuff in luci.http.protocol .</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#if_unmodified_since">if_unmodified_since</a> (req, stat)</td>
+ <td class="summary">
+
+14.28 / If-Unmodified-Since
+
+Test whether the given message object contains an "If-Unmodified-Since"
+header and compare it against the given stat object.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#mk_etag">mk_etag</a> (stat)</td>
+ <td class="summary">
+
+Implement 14.19 / ETag.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+
+<br/>
+<br/>
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="if_match"></a><strong>if_match</strong> (req, stat)</dt>
+<dd>
+
+
+14.24 / If-Match
+
+Test whether the given message object contains an "If-Match" header and
+compare it against the given stat object.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ req: HTTP request message object
+ </li>
+
+ <li>
+ stat: A file.stat object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean indicating whether the precondition is ok
+
+ <li>Alternative status code if the precondition failed
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="if_modified_since"></a><strong>if_modified_since</strong> (req, stat)</dt>
+<dd>
+
+
+14.25 / If-Modified-Since
+
+Test whether the given message object contains an "If-Modified-Since" header
+and compare it against the given stat object.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ req: HTTP request message object
+ </li>
+
+ <li>
+ stat: A file.stat object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean indicating whether the precondition is ok
+
+ <li>Alternative status code if the precondition failed
+
+ <li>Table containing extra HTTP headers if the precondition failed
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="if_none_match"></a><strong>if_none_match</strong> (req, stat)</dt>
+<dd>
+
+
+14.26 / If-None-Match
+
+Test whether the given message object contains an "If-None-Match" header and
+compare it against the given stat object.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ req: HTTP request message object
+ </li>
+
+ <li>
+ stat: A file.stat object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean indicating whether the precondition is ok
+
+ <li>Alternative status code if the precondition failed
+
+ <li>Table containing extra HTTP headers if the precondition failed
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="if_range"></a><strong>if_range</strong> (req, stat)</dt>
+<dd>
+
+
+14.27 / If-Range
+
+The If-Range header is currently not implemented due to the lack of general
+byte range stuff in luci.http.protocol . This function will always return
+false, 412 to indicate a failed precondition.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ req: HTTP request message object
+ </li>
+
+ <li>
+ stat: A file.stat object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean indicating whether the precondition is ok
+
+ <li>Alternative status code if the precondition failed
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="if_unmodified_since"></a><strong>if_unmodified_since</strong> (req, stat)</dt>
+<dd>
+
+
+14.28 / If-Unmodified-Since
+
+Test whether the given message object contains an "If-Unmodified-Since"
+header and compare it against the given stat object.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ req: HTTP request message object
+ </li>
+
+ <li>
+ stat: A file.stat object
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean indicating whether the precondition is ok
+
+ <li>Alternative status code if the precondition failed
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="mk_etag"></a><strong>mk_etag</strong> (stat)</dt>
+<dd>
+
+
+Implement 14.19 / ETag.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ stat: A file.stat structure
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containing the generated tag suitable for ETag headers
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</title>
+ <link rel="stylesheet" href="../luadoc.css" type="text/css" />
+ <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
+</head>
+
+<body>
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.html">luci.http</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
+ </li>
+
+ <li><strong>luci.http.date</strong></li>
+
+ <li>
+ <a href="../modules/luci.http.mime.html">luci.http.mime</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.i18n.html">luci.i18n</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.html">luci.ip</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.json.html">luci.json</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.html">luci.jsonc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.uci.html">luci.model.uci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.html">luci.rpcc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.html">luci.sys</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.init.html">luci.sys.init</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.net.html">luci.sys.net</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.process.html">luci.sys.process</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.user.html">luci.sys.user</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.util.html">luci.util</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.html">nixio</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.File.html">nixio.File</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.README.html">nixio.README</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.Socket.html">nixio.Socket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bin.html">nixio.bin</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bit.html">nixio.bit</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.crypto.html">nixio.crypto</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.fs.html">nixio.fs</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Class <code>luci.http.date</code></h1>
+
+<p></p>
+
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+ <tr>
+ <td class="name" nowrap><a href="#compare">compare</a> (d1, d2)</td>
+ <td class="summary">
+
+Compare two dates which can either be unix epoch times or HTTP date strings.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#to_http">to_http</a> (time)</td>
+ <td class="summary">
+
+Convert the given unix epoch time to valid HTTP date string.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#to_unix">to_unix</a> (data)</td>
+ <td class="summary">
+
+Parse given HTTP date string and convert it to unix epoch time.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#tz_offset">tz_offset</a> (tz)</td>
+ <td class="summary">
+
+Return the time offset in seconds between the UTC and given time zone.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+
+<br/>
+<br/>
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="compare"></a><strong>compare</strong> (d1, d2)</dt>
+<dd>
+
+
+Compare two dates which can either be unix epoch times or HTTP date strings.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ d1: The first date or epoch time to compare
+ </li>
+
+ <li>
+ d2: The first date or epoch time to compare
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>-1 - if d1 is lower then d2
+
+ <li>0 - if both dates are equal
+
+ <li>1 - if d1 is higher then d2
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="to_http"></a><strong>to_http</strong> (time)</dt>
+<dd>
+
+
+Convert the given unix epoch time to valid HTTP date string.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ time: Unix epoch time
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containing the formatted date
+
+
+
+</dd>
+
+
+
+
+<dt><a name="to_unix"></a><strong>to_unix</strong> (data)</dt>
+<dd>
+
+
+Parse given HTTP date string and convert it to unix epoch time.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ data: String containing the date
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Unix epoch time
+
+
+
+</dd>
+
+
+
+
+<dt><a name="tz_offset"></a><strong>tz_offset</strong> (tz)</dt>
+<dd>
+
+
+Return the time offset in seconds between the UTC and given time zone.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ tz: Symbolic or numeric timezone specifier
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Time offset to UTC in seconds
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+</body>
+</html>
in the params table within the given message object. Multiple parameter
values are stored as tables, ordinary ones as strings.
-If an optional file callback function is given then it is feeded with the
+If an optional file callback function is given then it is fed with the
file contents chunk by chunk and only the extracted file name is stored
within the params table. The callback function will be called subsequently
with three arguments:
o Table containing decoded (name, file) and raw (headers) mime header data
o String value containing a chunk of the file data
- o Boolean which indicates wheather the current chunk is the last one (eof)
+ o Boolean which indicates whether the current chunk is the last one (eof)
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</title>
+ <link rel="stylesheet" href="../luadoc.css" type="text/css" />
+ <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
+</head>
+
+<body>
+<div id="container">
+
+<div id="product">
+ <div id="product_logo"></div>
+ <div id="product_name"><big><b></b></big></div>
+ <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.html">luci.http</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.http.date.html">luci.http.date</a>
+ </li>
+
+ <li><strong>luci.http.mime</strong></li>
+
+ <li>
+ <a href="../modules/luci.i18n.html">luci.i18n</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.html">luci.ip</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.json.html">luci.json</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.html">luci.jsonc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.model.uci.html">luci.model.uci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.html">luci.rpcc</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.html">luci.sys</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.init.html">luci.sys.init</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.net.html">luci.sys.net</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.process.html">luci.sys.process</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.user.html">luci.sys.user</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
+ </li>
+
+ <li>
+ <a href="../modules/luci.util.html">luci.util</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.html">nixio</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.File.html">nixio.File</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.README.html">nixio.README</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.Socket.html">nixio.Socket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bin.html">nixio.bin</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.bit.html">nixio.bit</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.crypto.html">nixio.crypto</a>
+ </li>
+
+ <li>
+ <a href="../modules/nixio.fs.html">nixio.fs</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Class <code>luci.http.mime</code></h1>
+
+<p></p>
+
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+ <tr>
+ <td class="name" nowrap><a href="#to_ext">to_ext</a> (mimetype)</td>
+ <td class="summary">
+
+Return corresponding extension for a given mime type or nil if the
+
+given mime-type is unknown.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#to_mime">to_mime</a> (filename)</td>
+ <td class="summary">
+
+Extract extension from a filename and return corresponding mime-type or
+
+"application/octet-stream" if the extension is unknown.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+
+<br/>
+<br/>
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="to_ext"></a><strong>to_ext</strong> (mimetype)</dt>
+<dd>
+
+
+Return corresponding extension for a given mime type or nil if the
+
+given mime-type is unknown.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ mimetype: The mimetype to retrieve the extension from
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String with the extension or nil for unknown type
+
+
+
+</dd>
+
+
+
+
+<dt><a name="to_mime"></a><strong>to_mime</strong> (filename)</dt>
+<dd>
+
+
+Extract extension from a filename and return corresponding mime-type or
+
+"application/octet-stream" if the extension is unknown.
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ filename: The filename for which the mime type is guessed
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String containign the determined mime type
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+</body>
+</html>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
- <title>Reference</title>
- <link rel="stylesheet" href="../luadoc.css" type="text/css" />
- <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
-</head>
-
-<body>
-<div id="container">
-
-<div id="product">
- <div id="product_logo"></div>
- <div id="product_name"><big><b></b></big></div>
- <div id="product_description"></div>
-</div> <!-- id="product" -->
-
-<div id="main">
-
-<div id="navigation">
-
-
-<h1>LuaDoc</h1>
-<ul>
-
- <li><a href="../index.html">Index</a></li>
-
-</ul>
-
-
-<!-- Module list -->
-
-<h1>Modules</h1>
-<ul>
-
- <li>
- <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.html">luci.http</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
- </li>
-
- <li><strong>luci.http.protocol.conditionals</strong></li>
-
- <li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
- </li>
-
- <li>
- <a href="../modules/luci.i18n.html">luci.i18n</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.html">luci.ip</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
- </li>
-
- <li>
- <a href="../modules/luci.json.html">luci.json</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.html">luci.jsonc</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.uci.html">luci.model.uci</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.html">luci.rpcc</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.html">luci.sys</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.init.html">luci.sys.init</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.net.html">luci.sys.net</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.process.html">luci.sys.process</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.user.html">luci.sys.user</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
- </li>
-
- <li>
- <a href="../modules/luci.util.html">luci.util</a>
- </li>
-
- <li>
- <a href="../modules/nixio.html">nixio</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
- </li>
-
- <li>
- <a href="../modules/nixio.File.html">nixio.File</a>
- </li>
-
- <li>
- <a href="../modules/nixio.README.html">nixio.README</a>
- </li>
-
- <li>
- <a href="../modules/nixio.Socket.html">nixio.Socket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bin.html">nixio.bin</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bit.html">nixio.bit</a>
- </li>
-
- <li>
- <a href="../modules/nixio.crypto.html">nixio.crypto</a>
- </li>
-
- <li>
- <a href="../modules/nixio.fs.html">nixio.fs</a>
- </li>
-
-</ul>
-
-
-
-<!-- File list -->
-
-
-
-
-
-
-
-</div><!-- id="navigation" -->
-
-<div id="content">
-
-<h1>Class <code>luci.http.protocol.conditionals</code></h1>
-
-<p></p>
-
-
-
-
-
-
-
-<h2>Functions</h2>
-<table class="function_list">
-
- <tr>
- <td class="name" nowrap><a href="#if_match">if_match</a> (req, stat)</td>
- <td class="summary">
-
-14.24 / If-Match
-
-Test whether the given message object contains an "If-Match" header and
-compare it against the given stat object.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#if_modified_since">if_modified_since</a> (req, stat)</td>
- <td class="summary">
-
-14.25 / If-Modified-Since
-
-Test whether the given message object contains an "If-Modified-Since" header
-and compare it against the given stat object.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#if_none_match">if_none_match</a> (req, stat)</td>
- <td class="summary">
-
-14.26 / If-None-Match
-
-Test whether the given message object contains an "If-None-Match" header and
-compare it against the given stat object.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#if_range">if_range</a> (req, stat)</td>
- <td class="summary">
-
-14.27 / If-Range
-
-The If-Range header is currently not implemented due to the lack of general
-byte range stuff in luci.http.protocol .</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#if_unmodified_since">if_unmodified_since</a> (req, stat)</td>
- <td class="summary">
-
-14.28 / If-Unmodified-Since
-
-Test whether the given message object contains an "If-Unmodified-Since"
-header and compare it against the given stat object.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#mk_etag">mk_etag</a> (stat)</td>
- <td class="summary">
-
-Implement 14.19 / ETag.</td>
- </tr>
-
-</table>
-
-
-
-
-
-
-<br/>
-<br/>
-
-
-<h2><a name="functions"></a>Functions</h2>
-<dl class="function">
-
-
-
-<dt><a name="if_match"></a><strong>if_match</strong> (req, stat)</dt>
-<dd>
-
-
-14.24 / If-Match
-
-Test whether the given message object contains an "If-Match" header and
-compare it against the given stat object.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- req: HTTP request message object
- </li>
-
- <li>
- stat: A file.stat object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Boolean indicating whether the precondition is ok
-
- <li>Alternative status code if the precondition failed
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="if_modified_since"></a><strong>if_modified_since</strong> (req, stat)</dt>
-<dd>
-
-
-14.25 / If-Modified-Since
-
-Test whether the given message object contains an "If-Modified-Since" header
-and compare it against the given stat object.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- req: HTTP request message object
- </li>
-
- <li>
- stat: A file.stat object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Boolean indicating whether the precondition is ok
-
- <li>Alternative status code if the precondition failed
-
- <li>Table containing extra HTTP headers if the precondition failed
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="if_none_match"></a><strong>if_none_match</strong> (req, stat)</dt>
-<dd>
-
-
-14.26 / If-None-Match
-
-Test whether the given message object contains an "If-None-Match" header and
-compare it against the given stat object.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- req: HTTP request message object
- </li>
-
- <li>
- stat: A file.stat object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Boolean indicating whether the precondition is ok
-
- <li>Alternative status code if the precondition failed
-
- <li>Table containing extra HTTP headers if the precondition failed
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="if_range"></a><strong>if_range</strong> (req, stat)</dt>
-<dd>
-
-
-14.27 / If-Range
-
-The If-Range header is currently not implemented due to the lack of general
-byte range stuff in luci.http.protocol . This function will always return
-false, 412 to indicate a failed precondition.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- req: HTTP request message object
- </li>
-
- <li>
- stat: A file.stat object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Boolean indicating whether the precondition is ok
-
- <li>Alternative status code if the precondition failed
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="if_unmodified_since"></a><strong>if_unmodified_since</strong> (req, stat)</dt>
-<dd>
-
-
-14.28 / If-Unmodified-Since
-
-Test whether the given message object contains an "If-Unmodified-Since"
-header and compare it against the given stat object.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- req: HTTP request message object
- </li>
-
- <li>
- stat: A file.stat object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Boolean indicating whether the precondition is ok
-
- <li>Alternative status code if the precondition failed
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="mk_etag"></a><strong>mk_etag</strong> (stat)</dt>
-<dd>
-
-
-Implement 14.19 / ETag.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- stat: A file.stat structure
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String containing the generated tag suitable for ETag headers
-
-
-
-</dd>
-
-
-</dl>
-
-
-
-
-
-</div> <!-- id="content" -->
-
-</div> <!-- id="main" -->
-
-<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
-</div> <!-- id="about" -->
-
-</div> <!-- id="container" -->
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
- <title>Reference</title>
- <link rel="stylesheet" href="../luadoc.css" type="text/css" />
- <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
-</head>
-
-<body>
-<div id="container">
-
-<div id="product">
- <div id="product_logo"></div>
- <div id="product_name"><big><b></b></big></div>
- <div id="product_description"></div>
-</div> <!-- id="product" -->
-
-<div id="main">
-
-<div id="navigation">
-
-
-<h1>LuaDoc</h1>
-<ul>
-
- <li><a href="../index.html">Index</a></li>
-
-</ul>
-
-
-<!-- Module list -->
-
-<h1>Modules</h1>
-<ul>
-
- <li>
- <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.html">luci.http</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
- </li>
-
- <li><strong>luci.http.protocol.date</strong></li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
- </li>
-
- <li>
- <a href="../modules/luci.i18n.html">luci.i18n</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.html">luci.ip</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
- </li>
-
- <li>
- <a href="../modules/luci.json.html">luci.json</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.html">luci.jsonc</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.uci.html">luci.model.uci</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.html">luci.rpcc</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.html">luci.sys</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.init.html">luci.sys.init</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.net.html">luci.sys.net</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.process.html">luci.sys.process</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.user.html">luci.sys.user</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
- </li>
-
- <li>
- <a href="../modules/luci.util.html">luci.util</a>
- </li>
-
- <li>
- <a href="../modules/nixio.html">nixio</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
- </li>
-
- <li>
- <a href="../modules/nixio.File.html">nixio.File</a>
- </li>
-
- <li>
- <a href="../modules/nixio.README.html">nixio.README</a>
- </li>
-
- <li>
- <a href="../modules/nixio.Socket.html">nixio.Socket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bin.html">nixio.bin</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bit.html">nixio.bit</a>
- </li>
-
- <li>
- <a href="../modules/nixio.crypto.html">nixio.crypto</a>
- </li>
-
- <li>
- <a href="../modules/nixio.fs.html">nixio.fs</a>
- </li>
-
-</ul>
-
-
-
-<!-- File list -->
-
-
-
-
-
-
-
-</div><!-- id="navigation" -->
-
-<div id="content">
-
-<h1>Class <code>luci.http.protocol.date</code></h1>
-
-<p></p>
-
-
-
-
-
-
-
-<h2>Functions</h2>
-<table class="function_list">
-
- <tr>
- <td class="name" nowrap><a href="#compare">compare</a> (d1, d2)</td>
- <td class="summary">
-
-Compare two dates which can either be unix epoch times or HTTP date strings.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#to_http">to_http</a> (time)</td>
- <td class="summary">
-
-Convert the given unix epoch time to valid HTTP date string.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#to_unix">to_unix</a> (data)</td>
- <td class="summary">
-
-Parse given HTTP date string and convert it to unix epoch time.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#tz_offset">tz_offset</a> (tz)</td>
- <td class="summary">
-
-Return the time offset in seconds between the UTC and given time zone.</td>
- </tr>
-
-</table>
-
-
-
-
-
-
-<br/>
-<br/>
-
-
-<h2><a name="functions"></a>Functions</h2>
-<dl class="function">
-
-
-
-<dt><a name="compare"></a><strong>compare</strong> (d1, d2)</dt>
-<dd>
-
-
-Compare two dates which can either be unix epoch times or HTTP date strings.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- d1: The first date or epoch time to compare
- </li>
-
- <li>
- d2: The first date or epoch time to compare
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>-1 - if d1 is lower then d2
-
- <li>0 - if both dates are equal
-
- <li>1 - if d1 is higher then d2
-
-</ol>
-
-
-
-</dd>
-
-
-
-
-<dt><a name="to_http"></a><strong>to_http</strong> (time)</dt>
-<dd>
-
-
-Convert the given unix epoch time to valid HTTP date string.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- time: Unix epoch time
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String containing the formatted date
-
-
-
-</dd>
-
-
-
-
-<dt><a name="to_unix"></a><strong>to_unix</strong> (data)</dt>
-<dd>
-
-
-Parse given HTTP date string and convert it to unix epoch time.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- data: String containing the date
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-Unix epoch time
-
-
-
-</dd>
-
-
-
-
-<dt><a name="tz_offset"></a><strong>tz_offset</strong> (tz)</dt>
-<dd>
-
-
-Return the time offset in seconds between the UTC and given time zone.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- tz: Symbolic or numeric timezone specifier
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-Time offset to UTC in seconds
-
-
-
-</dd>
-
-
-</dl>
-
-
-
-
-
-</div> <!-- id="content" -->
-
-</div> <!-- id="main" -->
-
-<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
-</div> <!-- id="about" -->
-
-</div> <!-- id="container" -->
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
- <title>Reference</title>
- <link rel="stylesheet" href="../luadoc.css" type="text/css" />
- <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
-</head>
-
-<body>
-<div id="container">
-
-<div id="product">
- <div id="product_logo"></div>
- <div id="product_name"><big><b></b></big></div>
- <div id="product_description"></div>
-</div> <!-- id="product" -->
-
-<div id="main">
-
-<div id="navigation">
-
-
-<h1>LuaDoc</h1>
-<ul>
-
- <li><a href="../index.html">Index</a></li>
-
-</ul>
-
-
-<!-- Module list -->
-
-<h1>Modules</h1>
-<ul>
-
- <li>
- <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.html">luci.http</a>
- </li>
-
- <li><strong>luci.http.protocol</strong></li>
-
- <li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
- </li>
-
- <li>
- <a href="../modules/luci.i18n.html">luci.i18n</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.html">luci.ip</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
- </li>
-
- <li>
- <a href="../modules/luci.json.html">luci.json</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.html">luci.jsonc</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.uci.html">luci.model.uci</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.html">luci.rpcc</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.html">luci.sys</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.init.html">luci.sys.init</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.net.html">luci.sys.net</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.process.html">luci.sys.process</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.user.html">luci.sys.user</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
- </li>
-
- <li>
- <a href="../modules/luci.util.html">luci.util</a>
- </li>
-
- <li>
- <a href="../modules/nixio.html">nixio</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
- </li>
-
- <li>
- <a href="../modules/nixio.File.html">nixio.File</a>
- </li>
-
- <li>
- <a href="../modules/nixio.README.html">nixio.README</a>
- </li>
-
- <li>
- <a href="../modules/nixio.Socket.html">nixio.Socket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bin.html">nixio.bin</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bit.html">nixio.bit</a>
- </li>
-
- <li>
- <a href="../modules/nixio.crypto.html">nixio.crypto</a>
- </li>
-
- <li>
- <a href="../modules/nixio.fs.html">nixio.fs</a>
- </li>
-
-</ul>
-
-
-
-<!-- File list -->
-
-
-
-
-
-
-
-</div><!-- id="navigation" -->
-
-<div id="content">
-
-<h1>Class <code>luci.http.protocol</code></h1>
-
-<p></p>
-
-
-
-
-
-
-
-<h2>Functions</h2>
-<table class="function_list">
-
- <tr>
- <td class="name" nowrap><a href="#header_source">header_source</a> (sock)</td>
- <td class="summary">
-
-Creates a ltn12 source from the given socket.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#mimedecode_message_body">mimedecode_message_body</a> (src, msg, filecb)</td>
- <td class="summary">
-
-Decode a mime encoded http message body with multipart/form-data
-
-Content-Type.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#parse_message_body">parse_message_body</a> (src, msg, filecb)</td>
- <td class="summary">
-
-Try to extract and decode a http message body from the given ltn12 source.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#parse_message_header">parse_message_header</a> (src)</td>
- <td class="summary">
-
-Try to extract an http message header including information like protocol
-
-version, message headers and resulting CGI environment variables from the
-given ltn12 source.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#urldecode">urldecode</a> (str, no_plus)</td>
- <td class="summary">
-
-Decode an urlencoded string - optionally without decoding
-
-the "+" sign to " " - and return the decoded string.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#urldecode_message_body">urldecode_message_body</a> (src, msg)</td>
- <td class="summary">
-
-Decode an urlencoded http message body with application/x-www-urlencoded
-
-Content-Type.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#urldecode_params">urldecode_params</a> (url, tbl)</td>
- <td class="summary">
-
-Extract and split urlencoded data pairs, separated bei either "&" or ";"
-
-from given url or string.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#urlencode">urlencode</a> (str)</td>
- <td class="summary">
-
-Encode given string to x-www-urlencoded format.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#urlencode_params">urlencode_params</a> (tbl)</td>
- <td class="summary">
-
-Encode each key-value-pair in given table to x-www-urlencoded format,
-
-separated by "&".</td>
- </tr>
-
-</table>
-
-
-
-
-
-
-<br/>
-<br/>
-
-
-<h2><a name="functions"></a>Functions</h2>
-<dl class="function">
-
-
-
-<dt><a name="header_source"></a><strong>header_source</strong> (sock)</dt>
-<dd>
-
-
-Creates a ltn12 source from the given socket. The source will return it's
-
-data line by line with the trailing \r\n stripped of.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- sock: Readable network socket
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-Ltn12 source function
-
-
-
-</dd>
-
-
-
-
-<dt><a name="mimedecode_message_body"></a><strong>mimedecode_message_body</strong> (src, msg, filecb)</dt>
-<dd>
-
-
-Decode a mime encoded http message body with multipart/form-data
-
-Content-Type. Stores all extracted data associated with its parameter name
-in the params table within the given message object. Multiple parameter
-values are stored as tables, ordinary ones as strings.
-If an optional file callback function is given then it is feeded with the
-file contents chunk by chunk and only the extracted file name is stored
-within the params table. The callback function will be called subsequently
-with three arguments:
- o Table containing decoded (name, file) and raw (headers) mime header data
- o String value containing a chunk of the file data
- o Boolean which indicates wheather the current chunk is the last one (eof)
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- src: Ltn12 source function
- </li>
-
- <li>
- msg: HTTP message object
- </li>
-
- <li>
- filecb: File callback function (optional)
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Value indicating successful operation (not nil means "ok")
-
- <li>String containing the error if unsuccessful
-
-</ol>
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#parse_message_header">
- parse_message_header
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="parse_message_body"></a><strong>parse_message_body</strong> (src, msg, filecb)</dt>
-<dd>
-
-
-Try to extract and decode a http message body from the given ltn12 source.
-
-This function will examine the Content-Type within the given message object
-to select the appropriate content decoder.
-Currently the application/x-www-urlencoded and application/form-data
-mime types are supported. If the encountered content encoding can't be
-handled then the whole message body will be stored unaltered as "content"
-property within the given message object.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- src: Ltn12 source function
- </li>
-
- <li>
- msg: HTTP message object
- </li>
-
- <li>
- filecb: File data callback (optional, see mimedecode_message_body())
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Value indicating successful operation (not nil means "ok")
-
- <li>String containing the error if unsuccessful
-
-</ol>
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#parse_message_header">
- parse_message_header
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="parse_message_header"></a><strong>parse_message_header</strong> (src)</dt>
-<dd>
-
-
-Try to extract an http message header including information like protocol
-
-version, message headers and resulting CGI environment variables from the
-given ltn12 source.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- src: Ltn12 source function
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-HTTP message object
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#parse_message_body">
- parse_message_body
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="urldecode"></a><strong>urldecode</strong> (str, no_plus)</dt>
-<dd>
-
-
-Decode an urlencoded string - optionally without decoding
-
-the "+" sign to " " - and return the decoded string.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- str: Input string in x-www-urlencoded format
- </li>
-
- <li>
- no_plus: Don't decode "+" signs to spaces
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-The decoded string
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#urlencode">
- urlencode
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="urldecode_message_body"></a><strong>urldecode_message_body</strong> (src, msg)</dt>
-<dd>
-
-
-Decode an urlencoded http message body with application/x-www-urlencoded
-
-Content-Type. Stores all extracted data associated with its parameter name
-in the params table within the given message object. Multiple parameter
-values are stored as tables, ordinary ones as strings.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- src: Ltn12 source function
- </li>
-
- <li>
- msg: HTTP message object
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return values:</h3>
-<ol>
-
- <li>Value indicating successful operation (not nil means "ok")
-
- <li>String containing the error if unsuccessful
-
-</ol>
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#parse_message_header">
- parse_message_header
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="urldecode_params"></a><strong>urldecode_params</strong> (url, tbl)</dt>
-<dd>
-
-
-Extract and split urlencoded data pairs, separated bei either "&" or ";"
-
-from given url or string. Returns a table with urldecoded values.
-Simple parameters are stored as string values associated with the parameter
-name within the table. Parameters with multiple values are stored as array
-containing the corresponding values.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- url: The url or string which contains x-www-urlencoded form data
- </li>
-
- <li>
- tbl: Use the given table for storing values (optional)
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-Table containing the urldecoded parameters
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#urlencode_params">
- urlencode_params
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="urlencode"></a><strong>urlencode</strong> (str)</dt>
-<dd>
-
-
-Encode given string to x-www-urlencoded format.
-
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- str: String to encode
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String containing the encoded data
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#urldecode">
- urldecode
- </a>
-
-</ul>
-
-</dd>
-
-
-
-
-<dt><a name="urlencode_params"></a><strong>urlencode_params</strong> (tbl)</dt>
-<dd>
-
-
-Encode each key-value-pair in given table to x-www-urlencoded format,
-
-separated by "&". Tables are encoded as parameters with multiple values by
-repeating the parameter name with each value.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- tbl: Table with the values
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String containing encoded values
-
-
-
-<h3>See also:</h3>
-<ul>
-
- <li><a href="#urldecode_params">
- urldecode_params
- </a>
-
-</ul>
-
-</dd>
-
-
-</dl>
-
-
-
-
-
-</div> <!-- id="content" -->
-
-</div> <!-- id="main" -->
-
-<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
-</div> <!-- id="about" -->
-
-</div> <!-- id="container" -->
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
- <title>Reference</title>
- <link rel="stylesheet" href="../luadoc.css" type="text/css" />
- <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
-</head>
-
-<body>
-<div id="container">
-
-<div id="product">
- <div id="product_logo"></div>
- <div id="product_name"><big><b></b></big></div>
- <div id="product_description"></div>
-</div> <!-- id="product" -->
-
-<div id="main">
-
-<div id="navigation">
-
-
-<h1>LuaDoc</h1>
-<ul>
-
- <li><a href="../index.html">Index</a></li>
-
-</ul>
-
-
-<!-- Module list -->
-
-<h1>Modules</h1>
-<ul>
-
- <li>
- <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.html">luci.http</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
- </li>
-
- <li>
- <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
- </li>
-
- <li><strong>luci.http.protocol.mime</strong></li>
-
- <li>
- <a href="../modules/luci.i18n.html">luci.i18n</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.html">luci.ip</a>
- </li>
-
- <li>
- <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
- </li>
-
- <li>
- <a href="../modules/luci.json.html">luci.json</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.html">luci.jsonc</a>
- </li>
-
- <li>
- <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
- </li>
-
- <li>
- <a href="../modules/luci.model.uci.html">luci.model.uci</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.html">luci.rpcc</a>
- </li>
-
- <li>
- <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.html">luci.sys</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.init.html">luci.sys.init</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.net.html">luci.sys.net</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.process.html">luci.sys.process</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.user.html">luci.sys.user</a>
- </li>
-
- <li>
- <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
- </li>
-
- <li>
- <a href="../modules/luci.util.html">luci.util</a>
- </li>
-
- <li>
- <a href="../modules/nixio.html">nixio</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
- </li>
-
- <li>
- <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
- </li>
-
- <li>
- <a href="../modules/nixio.File.html">nixio.File</a>
- </li>
-
- <li>
- <a href="../modules/nixio.README.html">nixio.README</a>
- </li>
-
- <li>
- <a href="../modules/nixio.Socket.html">nixio.Socket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
- </li>
-
- <li>
- <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
- </li>
-
- <li>
- <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bin.html">nixio.bin</a>
- </li>
-
- <li>
- <a href="../modules/nixio.bit.html">nixio.bit</a>
- </li>
-
- <li>
- <a href="../modules/nixio.crypto.html">nixio.crypto</a>
- </li>
-
- <li>
- <a href="../modules/nixio.fs.html">nixio.fs</a>
- </li>
-
-</ul>
-
-
-
-<!-- File list -->
-
-
-
-
-
-
-
-</div><!-- id="navigation" -->
-
-<div id="content">
-
-<h1>Class <code>luci.http.protocol.mime</code></h1>
-
-<p></p>
-
-
-
-
-
-
-
-<h2>Functions</h2>
-<table class="function_list">
-
- <tr>
- <td class="name" nowrap><a href="#to_ext">to_ext</a> (mimetype)</td>
- <td class="summary">
-
-Return corresponding extension for a given mime type or nil if the
-
-given mime-type is unknown.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#to_mime">to_mime</a> (filename)</td>
- <td class="summary">
-
-Extract extension from a filename and return corresponding mime-type or
-
-"application/octet-stream" if the extension is unknown.</td>
- </tr>
-
-</table>
-
-
-
-
-
-
-<br/>
-<br/>
-
-
-<h2><a name="functions"></a>Functions</h2>
-<dl class="function">
-
-
-
-<dt><a name="to_ext"></a><strong>to_ext</strong> (mimetype)</dt>
-<dd>
-
-
-Return corresponding extension for a given mime type or nil if the
-
-given mime-type is unknown.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- mimetype: The mimetype to retrieve the extension from
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String with the extension or nil for unknown type
-
-
-
-</dd>
-
-
-
-
-<dt><a name="to_mime"></a><strong>to_mime</strong> (filename)</dt>
-<dd>
-
-
-Extract extension from a filename and return corresponding mime-type or
-
-"application/octet-stream" if the extension is unknown.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- filename: The filename for which the mime type is guessed
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String containign the determined mime type
-
-
-
-</dd>
-
-
-</dl>
-
-
-
-
-
-</div> <!-- id="content" -->
-
-</div> <!-- id="main" -->
-
-<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
-</div> <!-- id="about" -->
-
-</div> <!-- id="container" -->
-</body>
-</html>
<table class="function_list">
<tr>
- <td class="name" nowrap><a href="#clear">clear</a> ()</td>
+ <td class="name" nowrap><a href="#dump">dump</a> ()</td>
<td class="summary">
-Clear the translation table.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#load">load</a> (file, lang, force)</td>
- <td class="summary">
-
-Load a translation and copy its data into the translation table.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#loadc">loadc</a> (file, force)</td>
- <td class="summary">
-
-Load a translation file using the default translation language.</td>
+Return all currently loaded translation strings as a key-value table.</td>
</tr>
<tr>
Set the context default translation language.</td>
</tr>
- <tr>
- <td class="name" nowrap><a href="#string">string</a> (key)</td>
- <td class="summary">
-
-Return the translated value for a specific translation key
-
-and ensure that the returned value is a Lua string value.</td>
- </tr>
-
- <tr>
- <td class="name" nowrap><a href="#stringf">stringf</a> (key, ...)</td>
- <td class="summary">
-
-Return the translated value for a specific translation key and use it as sprintf pattern.</td>
- </tr>
-
<tr>
<td class="name" nowrap><a href="#translate">translate</a> (key)</td>
<td class="summary">
-<dt><a name="clear"></a><strong>clear</strong> ()</dt>
-<dd>
-
-
-Clear the translation table.
-
-
-
-
-
-
-
-
-
-
-
-</dd>
-
-
-
-
-<dt><a name="load"></a><strong>load</strong> (file, lang, force)</dt>
+<dt><a name="dump"></a><strong>dump</strong> ()</dt>
<dd>
-Load a translation and copy its data into the translation table.
+Return all currently loaded translation strings as a key-value table. The key is the
+hexadecimal representation of the translation key while the value is the translated
+text content.
-<h3>Parameters</h3>
-<ul>
-
- <li>
- file: Language file
- </li>
-
- <li>
- lang: Two-letter language code
- </li>
-
- <li>
- force: Force reload even if already loaded (optional)
- </li>
-
-</ul>
-
<h3>Return value:</h3>
-Success status
-
-
-
-</dd>
-
-
-
-
-<dt><a name="loadc"></a><strong>loadc</strong> (file, force)</dt>
-<dd>
-
-
-Load a translation file using the default translation language.
-
-Alternatively load the translation of the fallback language.
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- file: Language file
- </li>
-
- <li>
- force: Force reload even if already loaded (optional)
- </li>
-
-</ul>
-
-
-
-
-
+Key-value translation string table.
<ul>
<li>
- lang: Two-letter language code
- </li>
-
-</ul>
-
-
-
-
-
-
-
-
-</dd>
-
-
-
-
-<dt><a name="string"></a><strong>string</strong> (key)</dt>
-<dd>
-
-
-Return the translated value for a specific translation key
-
-and ensure that the returned value is a Lua string value.
-This is the same as calling <code>tostring(translate(...))</code>
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- key: Default translation text
+ lang: An IETF/BCP 47 language tag or ISO3166 country code, e.g. "en-US" or "de"
</li>
</ul>
<h3>Return value:</h3>
-Translated string
-
-
-
-</dd>
-
-
-
-
-<dt><a name="stringf"></a><strong>stringf</strong> (key, ...)</dt>
-<dd>
-
-
-Return the translated value for a specific translation key and use it as sprintf pattern.
-
-Ensure that the returned value is a Lua string value.
-This is the same as calling <code>tostring(translatef(...))</code>
-
-
-<h3>Parameters</h3>
-<ul>
-
- <li>
- key: Default translation text
- </li>
-
- <li>
- ...: Format parameters
- </li>
-
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-Translated and formatted string
+The effective loaded language, e.g. "en" for "en-US" - or nil on failure
<ul>
<li>
- addr: A <code>luci.ip.cidr</code> instance or a string convertable by
+ addr: A <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code> to compare against.
</li>
<ul>
<li>
- addr: A <code>luci.ip.cidr</code> instance or a string convertable by
+ addr: A <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code> to compare against.
</li>
<ul>
<li>
- addr: A <code>luci.ip.cidr</code> instance or a string convertable by
+ addr: A <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code> to compare against.
</li>
<ul>
<li>
- addr: A <code>luci.ip.cidr</code> instance or a string convertable by
+ addr: A <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code> to test.
</li>
<li>
amount: A numeric value between 0 and 0xFFFFFFFF, a
- <code>luci.ip.cidr</code> instance or a string convertable by
+ <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code>.
</li>
<h3>Return value:</h3>
<ul>
- <li>When adding inplace: Return <code>true</code> if the addition succeded
+ <li>When adding inplace: Return <code>true</code> if the addition succeeded
or <code>false</code> when the addition overflowed.</li>
<li>When deriving new CIDR: Return new instance representing the value of
this instance plus the added amount or the highest possible address if
<li>
amount: A numeric value between 0 and 0xFFFFFFFF, a
- <code>luci.ip.cidr</code> instance or a string convertable by
+ <code>luci.ip.cidr</code> instance or a string convertible by
<code>luci.ip.new()</code>.
</li>
</tr>
<tr>
- <td class="name" nowrap><a href="#route">route</a> (address)</td>
+ <td class="name" nowrap><a href="#route">route</a> (address, source)</td>
<td class="summary">
Determine the route leading to the given destination.</td>
-<dt><a name="route"></a><strong>route</strong> (address)</dt>
+<dt><a name="route"></a><strong>route</strong> (address, source)</dt>
<dd>
a valid IPv4 or IPv6 range as specified by <code>luci.ip.new()</code>.
</li>
+ <li>
+ source: A <code>luci.ip.cidr</code> instance or a string containing
+the preferred source address for route selection (optional).
+ </li>
+
</ul>
<li>
filter: <p>Table containing one or more of the possible filter
-critera described below (optional)</p><table>
+criteria described below (optional)</p><table>
<tr><th>Field</th><th>Description</th></tr>
<tr><td><code>family</code></td><td>
Number describing the address family to return - <code>4</code> selects
<li>
filter: <p>Table containing one or more of the possible filter
-critera described below (optional)</p><table>
+criteria described below (optional)</p><table>
<tr><th>Field</th><th>Description</th></tr>
<tr><td><code>family</code></td><td>
Number describing the address family to return - <code>4</code> selects
</tr>
<tr>
- <td class="name" nowrap><a href="#Cursor.apply">Cursor:apply</a> (configlist, command)</td>
+ <td class="name" nowrap><a href="#Cursor.apply">Cursor:apply</a> (rollback)</td>
<td class="summary">
-Applies UCI configuration changes
- </td>
+Applies UCI configuration changes.</td>
</tr>
<tr>
Commit saved changes.</td>
</tr>
+ <tr>
+ <td class="name" nowrap><a href="#Cursor.confirm">Cursor:confirm</a> ()</td>
+ <td class="summary">
+
+Confirms UCI apply process.</td>
+ </tr>
+
<tr>
<td class="name" nowrap><a href="#Cursor.delete">Cursor:delete</a> (config, section, option)</td>
<td class="summary">
Revert saved but uncommitted changes.</td>
</tr>
+ <tr>
+ <td class="name" nowrap><a href="#Cursor.rollback">Cursor:rollback</a> ()</td>
+ <td class="summary">
+
+Cancels UCI apply process.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#Cursor.rollback_pending">Cursor:rollback_pending</a> ()</td>
+ <td class="summary">
+
+Checks whether a pending rollback is scheduled.</td>
+ </tr>
+
<tr>
<td class="name" nowrap><a href="#Cursor.save">Cursor:save</a> (config)</td>
<td class="summary">
<td class="name" nowrap><a href="#Cursor.set_savedir">Cursor:set_savedir</a> (directory)</td>
<td class="summary">
-Set the directory for uncommited changes.</td>
+Set the directory for uncommitted changes.</td>
</tr>
<tr>
-<dt><a name="Cursor.apply"></a><strong>Cursor:apply</strong> (configlist, command)</dt>
+<dt><a name="Cursor.apply"></a><strong>Cursor:apply</strong> (rollback)</dt>
<dd>
-Applies UCI configuration changes
+Applies UCI configuration changes.
+
+If the rollback parameter is set to true, the apply function will invoke the
+rollback mechanism which causes the configuration to be automatically reverted
+if no confirm() call occurs within a certain timeout.
+
+The current default timeout is 30s and can be increased using the
+"luci.apply.timeout" uci configuration key.
<ul>
<li>
- configlist: List of UCI configurations
- </li>
-
- <li>
- command: Don't apply only return the command
+ rollback: Enable rollback mechanism
</li>
</ul>
+<h3>Return value:</h3>
+Boolean whether operation succeeded
+
</dd>
+<dt><a name="Cursor.confirm"></a><strong>Cursor:confirm</strong> ()</dt>
+<dd>
+
+
+Confirms UCI apply process.
+
+If a previous UCI apply with rollback has been invoked using apply(true),
+this function confirms the process and cancels the pending rollback timer.
+
+If no apply with rollback session is active, the function has no effect and
+returns with a "No data" error.
+
+
+
+
+
+
+
+
+<h3>Return value:</h3>
+Boolean whether operation succeeded
+
+
+
+</dd>
+
+
+
+
<dt><a name="Cursor.delete"></a><strong>Cursor:delete</strong> (config, section, option)</dt>
<dd>
+<dt><a name="Cursor.rollback"></a><strong>Cursor:rollback</strong> ()</dt>
+<dd>
+
+
+Cancels UCI apply process.
+
+If a previous UCI apply with rollback has been invoked using apply(true),
+this function cancels the process and rolls back the configuration to the
+pre-apply state.
+
+If no apply with rollback session is active, the function has no effect and
+returns with a "No data" error.
+
+
+
+
+
+
+
+
+<h3>Return value:</h3>
+Boolean whether operation succeeded
+
+
+
+</dd>
+
+
+
+
+<dt><a name="Cursor.rollback_pending"></a><strong>Cursor:rollback_pending</strong> ()</dt>
+<dd>
+
+
+Checks whether a pending rollback is scheduled.
+
+If a previous UCI apply with rollback has been invoked using apply(true),
+and has not been confirmed or rolled back yet, this function returns true
+and the remaining time until rollback in seconds. If no rollback is pending,
+the function returns false. On error, the function returns false and an
+additional string describing the error.
+
+
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>Boolean whether rollback is pending
+
+ <li>Remaining time in seconds
+
+</ol>
+
+
+
+</dd>
+
+
+
+
<dt><a name="Cursor.save"></a><strong>Cursor:save</strong> (config)</dt>
<dd>
<dd>
-Set the directory for uncommited changes.
+Set the directory for uncommitted changes.
Create a sub-state of this cursor.
-The sub-state is tied to the parent curser, means it the parent unloads or
+The sub-state is tied to the parent cursor, means it the parent unloads or
loads configs, the sub state will do so as well.
<h3>Return value:</h3>
-String containg the return the output of the command
+String containing the return the output of the command
<h3>Return values:</h3>
<ol>
- <li>String containg the value of the specified variable
+ <li>String containing the value of the specified variable
<li>Table containing all variables if no variable name is given
<h2>Functions</h2>
<table class="function_list">
+ <tr>
+ <td class="name" nowrap><a href="#process.exec">exec</a> (commend, stdout, stderr, nowait)</td>
+ <td class="summary">
+
+Execute a process, optionally capturing stdio.</td>
+ </tr>
+
<tr>
<td class="name" nowrap><a href="#process.info">info</a> ()</td>
<td class="summary">
+<dt><a name="process.exec"></a><strong>exec</strong> (commend, stdout, stderr, nowait)</dt>
+<dd>
+
+
+Execute a process, optionally capturing stdio.
+
+Executes the process specified by the given argv vector, e.g.
+<code>{ "/bin/sh", "-c", "echo 1" }</code> and waits for it to terminate unless a true
+value has been passed for the "nowait" parameter.
+
+When a function value is passed for the stdout or stderr arguments, the passed
+function is repeatedly called for each chunk read from the corresponding stdio
+stream. The read data is passed as string containing at most 4096 bytes at a
+time.
+
+When a true, non-function value is passed for the stdout or stderr arguments,
+the data of the corresponding stdio stream is read into an internal string
+buffer and returned as "stdout" or "stderr" field respectively in the result
+table.
+
+When a true value is passed to the nowait parameter, the function does not
+await process termination but returns as soon as all captured stdio streams
+have been closed or - if no streams are captured - immediately after launching
+the process.
+
+
+
+<h3>Parameters</h3>
+<ul>
+
+ <li>
+ commend: Table containing the argv vector to execute
+ </li>
+
+ <li>
+ stdout: Callback function or boolean to indicate capturing (optional)
+ </li>
+
+ <li>
+ stderr: Callback function or boolean to indicate capturing (optional)
+ </li>
+
+ <li>
+ nowait: Don't wait for process termination when true (optional)
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+Table containing at least the fields "code" which holds the exit
+ status of the invoked process or "-1" on error and "pid", which
+ contains the process id assigned to the spawned process. When
+ stdout and/or stderr capturing has been requested, it additionally
+ contains "stdout" and "stderr" fields respectively, holding the
+ captured stdio data as string.
+
+
+
+</dd>
+
+
+
+
<dt><a name="process.info"></a><strong>info</strong> ()</dt>
<dd>
<td class="name" nowrap><a href="#getuser">getuser</a> (uid)</td>
<td class="summary">
-Retrieve user informations for given uid.</td>
+Retrieve user information for given uid.</td>
</tr>
<tr>
<dd>
-Retrieve user informations for given uid.
+Retrieve user information for given uid.
<h3>Return value:</h3>
-Boolean indicating wheather the passwords are equal
+Boolean indicating whether the passwords are equal
<td class="name" nowrap><a href="#strip_bytecode">strip_bytecode</a> (code)</td>
<td class="summary">
-Strips unnescessary lua bytecode from given string.</td>
+Strips unnecessary lua bytecode from given string.</td>
</tr>
<tr>
The iterator will return one token per invocation, the tokens are separated by
whitespace. If the input value is a table, it is transformed into a string first.
-A nil value will result in a valid interator which aborts with the first invocation.
+A nil value will result in a valid iterator which aborts with the first invocation.
<dd>
-Strips unnescessary lua bytecode from given string.
+Strips unnecessary lua bytecode from given string.
Information like line numbers and debugging numbers will be discarded.
Original version by Peter Cawley (http://lua-users.org/lists/lua-l/2008-02/msg01158.html)
<li>Added support for x509 certificates in DER format.</li>
<li>Added support for splice() in UnifiedIO.copyz().</li>
<li>Added interface to inject chunks into UnifiedIO.linesource() buffer.</li>
- <li>Changed TLS behaviour to explicitely separate servers and clients.</li>
+ <li>Changed TLS behaviour to explicitly separate servers and clients.</li>
<li>Fixed usage of signed datatype breaking Base64 decoding.</li>
<li>Fixed namespace clashes for nixio.fs.</li>
<li>Fixed splice() support for some exotic C libraries.</li>
table <strong>nixio.const_sock</strong> for socket error codes. This might
be important if you are dealing with Windows applications, on POSIX however
const_sock is just an alias for const.</li>
- <li>With some exceptions - which are explicitely stated in the function
+ <li>With some exceptions - which are explicitly stated in the function
documentation - all blocking functions are signal-protected and will not fail
with EINTR.</li>
<li>On POSIX the SIGPIPE signal will be set to ignore upon initialization.
<tr>
<td class="name" nowrap><a href="#nixio.getproto">getproto</a> (proto)</td>
<td class="summary">
- Get all or a specifc proto entry.</td>
+ Get all or a specific proto entry.</td>
</tr>
<tr>
<dt><a name="nixio.getproto"></a><strong>getproto</strong> (proto)</dt>
<dd>
- Get all or a specifc proto entry.
+ Get all or a specific proto entry.
<h3>Parameters</h3>