aboutsummaryrefslogtreecommitdiff
path: root/docs/modules/system.html
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2025-03-02 19:45:04 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2025-03-02 19:50:39 +0100
commit9318a7dc9f7def35a2e9d85ccffe63c06950be09 (patch)
tree945278ce1ce56e225289204f13ac8528264bbb92 /docs/modules/system.html
parent2981db32130b30c9b12e7347bfdbe2e7584e9274 (diff)
downloadluasystem-0.5.0.tar.gz
luasystem-0.5.0.tar.bz2
luasystem-0.5.0.zip
Release v0.5.0v0.5.0
Diffstat (limited to 'docs/modules/system.html')
-rw-r--r--docs/modules/system.html31
1 files changed, 21 insertions, 10 deletions
diff --git a/docs/modules/system.html b/docs/modules/system.html
index ec077d8..093fd8b 100644
--- a/docs/modules/system.html
+++ b/docs/modules/system.html
@@ -152,12 +152,12 @@
152 <td class="summary">Debug function for terminal flags (Posix).</td> 152 <td class="summary">Debug function for terminal flags (Posix).</td>
153 </tr> 153 </tr>
154 <tr> 154 <tr>
155 <td class="name" nowrap><a href="#readansi">readansi (timeout)</a></td> 155 <td class="name" nowrap><a href="#readansi">readansi (timeout[, fsleep=system.sleep])</a></td>
156 <td class="summary">Reads a single key, if it is the start of ansi escape sequence then it reads 156 <td class="summary">Reads a single key, if it is the start of ansi escape sequence then it reads
157 the full sequence.</td> 157 the full sequence.</td>
158 </tr> 158 </tr>
159 <tr> 159 <tr>
160 <td class="name" nowrap><a href="#readkey">readkey (timeout)</a></td> 160 <td class="name" nowrap><a href="#readkey">readkey (timeout[, fsleep=system.sleep])</a></td>
161 <td class="summary">Reads a single byte from the console, with a timeout.</td> 161 <td class="summary">Reads a single byte from the console, with a timeout.</td>
162 </tr> 162 </tr>
163 <tr> 163 <tr>
@@ -353,7 +353,8 @@ Windows, setting an empty string, will also delete the variable)
353 </dt> 353 </dt>
354 <dd> 354 <dd>
355 Generate random bytes. 355 Generate random bytes.
356This uses <code>CryptGenRandom()</code> on Windows, and <code>/dev/urandom</code> on other platforms. It will return the 356This uses <code>BCryptGenRandom()</code> on Windows, <code>getrandom()</code> on Linux, <code>arc4random_buf</code> on BSD,
357and <code>/dev/urandom</code> on other platforms. It will return the
357requested number of bytes, or an error, never a partial result. 358requested number of bytes, or an error, never a partial result.
358 359
359 360
@@ -728,12 +729,12 @@ system.<span class="function-name">listconsoleflags</span>(<span class="global">
728</dd> 729</dd>
729 <dt> 730 <dt>
730 <a name = "readansi"></a> 731 <a name = "readansi"></a>
731 <strong>readansi (timeout)</strong> 732 <strong>readansi (timeout[, fsleep=system.sleep])</strong>
732 </dt> 733 </dt>
733 <dd> 734 <dd>
734 Reads a single key, if it is the start of ansi escape sequence then it reads 735 Reads a single key, if it is the start of ansi escape sequence then it reads
735 the full sequence. The key can be a multi-byte string in case of multibyte UTF-8 character. 736 the full sequence. The key can be a multi-byte string in case of multibyte UTF-8 character.
736 This function uses <a href="../modules/system.html#readkey">system.readkey</a>, and hence <a href="../modules/system.html#sleep">system.sleep</a> to wait until either a key is 737 This function uses <a href="../modules/system.html#readkey">system.readkey</a>, and hence <code>fsleep</code> to wait until either a key is
737 available or the timeout is reached. 738 available or the timeout is reached.
738 It returns immediately if a key is available or if <code>timeout</code> is less than or equal to <code>0</code>. 739 It returns immediately if a key is available or if <code>timeout</code> is less than or equal to <code>0</code>.
739 In case of an ANSI sequence, it will return the full sequence as a string. 740 In case of an ANSI sequence, it will return the full sequence as a string.
@@ -745,6 +746,11 @@ system.<span class="function-name">listconsoleflags</span>(<span class="global">
745 <span class="types"><span class="type">number</span></span> 746 <span class="types"><span class="type">number</span></span>
746 the timeout in seconds. 747 the timeout in seconds.
747 </li> 748 </li>
749 <li><span class="parameter">fsleep</span>
750 <span class="types"><span class="type">function</span></span>
751 the function to call for sleeping.
752 (<em>default</em> system.sleep)
753 </li>
748 </ul> 754 </ul>
749 755
750 <h3>Returns:</h3> 756 <h3>Returns:</h3>
@@ -775,11 +781,11 @@ system.<span class="function-name">listconsoleflags</span>(<span class="global">
775</dd> 781</dd>
776 <dt> 782 <dt>
777 <a name = "readkey"></a> 783 <a name = "readkey"></a>
778 <strong>readkey (timeout)</strong> 784 <strong>readkey (timeout[, fsleep=system.sleep])</strong>
779 </dt> 785 </dt>
780 <dd> 786 <dd>
781 Reads a single byte from the console, with a timeout. 787 Reads a single byte from the console, with a timeout.
782 This function uses <a href="../modules/system.html#sleep">system.sleep</a> to wait until either a byte is available or the timeout is reached. 788 This function uses <code>fsleep</code> to wait until either a byte is available or the timeout is reached.
783 The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.2 seconds. 789 The sleep period is exponentially backing off, starting at 0.0125 seconds, with a maximum of 0.2 seconds.
784 It returns immediately if a byte is available or if <code>timeout</code> is less than or equal to <code>0</code>.</p> 790 It returns immediately if a byte is available or if <code>timeout</code> is less than or equal to <code>0</code>.</p>
785 791
@@ -793,6 +799,11 @@ system.<span class="function-name">listconsoleflags</span>(<span class="global">
793 <span class="types"><span class="type">number</span></span> 799 <span class="types"><span class="type">number</span></span>
794 the timeout in seconds. 800 the timeout in seconds.
795 </li> 801 </li>
802 <li><span class="parameter">fsleep</span>
803 <span class="types"><span class="type">function</span></span>
804 the function to call for sleeping.
805 (<em>default</em> system.sleep)
806 </li>
796 </ul> 807 </ul>
797 808
798 <h3>Returns:</h3> 809 <h3>Returns:</h3>
@@ -1261,8 +1272,8 @@ flags for the <code>iflags</code>, <code>oflags</code>, and <code>lflags</code>
1261 <h3>Parameters:</h3> 1272 <h3>Parameters:</h3>
1262 <ul> 1273 <ul>
1263 <li><span class="parameter">utf8_char</span> 1274 <li><span class="parameter">utf8_char</span>
1264 <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span> 1275 <span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a> or <span class="type">int</span></span>
1265 the utf8 character to check, only the width of the first character will be returned 1276 the utf8 character, or unicode codepoint, to check, only the width of the first character will be returned
1266 </li> 1277 </li>
1267 </ul> 1278 </ul>
1268 1279
@@ -1411,7 +1422,7 @@ This function will sleep, without doing a busy-loop and wasting CPU cycles.
1411</div> <!-- id="main" --> 1422</div> <!-- id="main" -->
1412<div id="about"> 1423<div id="about">
1413<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> 1424<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
1414<i style="float:right;">Last updated 2024-12-18 02:50:03 </i> 1425<i style="float:right;">Last updated 2025-03-02 19:43:40 </i>
1415</div> <!-- id="about" --> 1426</div> <!-- id="about" -->
1416</div> <!-- id="container" --> 1427</div> <!-- id="container" -->
1417</body> 1428</body>