diff options
Diffstat (limited to '')
| -rw-r--r-- | docs/ltn12.html | 38 |
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: | |||
| 55 | local ltn12 = require("ltn12") | 55 | local ltn12 = require("ltn12") |
| 56 | </pre> | 56 | </pre> |
| 57 | 57 | ||
| 58 | <!-- BLOCKSIZE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
| 59 | |||
| 60 | <p class="name" id="BLOCKSIZE"> | ||
| 61 | ltn12.<b>BLOCKSIZE</b> | ||
| 62 | </p> | ||
| 63 | |||
| 64 | <p class="description"> | ||
| 65 | The default chunk size, in bytes, used internally by the built-in sources | ||
| 66 | and 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 | ||
| 68 | natural chunk size of their own. Defaults to 2048. Changing it affects | ||
| 69 | only 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> | |||
| 415 | Creates 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. | 429 | Creates 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"> | ||
| 435 | ltn12.source.<b>rewind(</b>source<b>)</b> | ||
| 436 | </p> | ||
| 437 | |||
| 438 | <p class="description"> | ||
| 439 | Wraps a <em>fancy</em> <tt>source</tt> to add chunk pushback, so previously | ||
| 440 | produced 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"> | ||
| 448 | The function returns a new fancy source. Calling it with no arguments reads | ||
| 449 | the next chunk as usual: any chunks previously pushed back are returned | ||
| 450 | first (most recently pushed back, first), and once none remain it falls | ||
| 451 | through to <tt>source</tt>. Calling it <em>with</em> a chunk argument does | ||
| 452 | not read anything: it pushes that chunk back onto the internal stack for a | ||
| 453 | future no-argument call to return. | ||
| 454 | </p> | ||
| 455 | |||
| 418 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 456 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| 419 | 457 | ||
| 420 | <div class="footer"> | 458 | <div class="footer"> |
