aboutsummaryrefslogtreecommitdiff
path: root/docs/ltn12.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ltn12.html')
-rw-r--r--docs/ltn12.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/ltn12.html b/docs/ltn12.html
index 30bc564..76b3984 100644
--- a/docs/ltn12.html
+++ b/docs/ltn12.html
@@ -55,6 +55,20 @@ To obtain the <tt>ltn12</tt> namespace, run:
55local ltn12 = require("ltn12") 55local ltn12 = require("ltn12")
56</pre> 56</pre>
57 57
58<!-- BLOCKSIZE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59
60<p class="name" id="BLOCKSIZE">
61ltn12.<b>BLOCKSIZE</b>
62</p>
63
64<p class="description">
65The default chunk size, in bytes, used internally by the built-in sources
66and sinks (e.g. <a href="#source.string"><tt>source.string</tt></a>,
67<a href="#source.file"><tt>source.file</tt></a>) when they have no more
68natural chunk size of their own. Defaults to 2048. Changing it affects
69only sources/sinks created after the change.
70</p>
71
58<!-- filters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 72<!-- filters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59 73
60<h3 id="filter">Filters</h3> 74<h3 id="filter">Filters</h3>
@@ -415,6 +429,30 @@ ltn12.source.<b>table(</b>table<b>)</b>
415Creates and returns a source that produces the numerically-indexed values of a <tt>table</tt> successively beginning at 1. The source returns nil (end-of-stream) whenever a nil value is produced by the current index, which proceeds forward regardless. 429Creates and returns a source that produces the numerically-indexed values of a <tt>table</tt> successively beginning at 1. The source returns nil (end-of-stream) whenever a nil value is produced by the current index, which proceeds forward regardless.
416</p> 430</p>
417 431
432<!-- rewind +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
433
434<p class="name" id="source.rewind">
435ltn12.source.<b>rewind(</b>source<b>)</b>
436</p>
437
438<p class="description">
439Wraps a <em>fancy</em> <tt>source</tt> to add chunk pushback, so previously
440produced chunks can be fed back in for a later read to consume again.
441</p>
442
443<p class="parameters">
444<tt>Source</tt> is the fancy source being wrapped.
445</p>
446
447<p class="return">
448The function returns a new fancy source. Calling it with no arguments reads
449the next chunk as usual: any chunks previously pushed back are returned
450first (most recently pushed back, first), and once none remain it falls
451through to <tt>source</tt>. Calling it <em>with</em> a chunk argument does
452not read anything: it pushes that chunk back onto the internal stack for a
453future no-argument call to return.
454</p>
455
418<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 456<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
419 457
420<div class="footer"> 458<div class="footer">