aboutsummaryrefslogtreecommitdiff
path: root/docs/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/index.html')
-rw-r--r--docs/index.html369
1 files changed, 76 insertions, 293 deletions
diff --git a/docs/index.html b/docs/index.html
index cd95fc2..52c93fe 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -27,339 +27,122 @@
27<h1>Lua-System</h1> 27<h1>Lua-System</h1>
28 28
29 29
30<h2>Contents</h2> 30
31<ul>
32<li><a href="#environment_Functions">environment Functions</a></li>
33<li><a href="#random_Functions">random Functions</a></li>
34<li><a href="#term_Functions">term Functions</a></li>
35<li><a href="#time_Functions">time Functions</a></li>
36</ul>
37 31
38 32
39<h2>Modules</h2> 33<h2>Modules</h2>
40<ul class="nowrap"> 34<ul class="nowrap">
41 <li><strong>system</strong></li> 35 <li><a href="modules/system.html">system</a></li>
36</ul>
37<h2>Classes</h2>
38<ul class="nowrap">
39 <li><a href="classes/bitflags.html">bitflags</a></li>
42</ul> 40</ul>
43<h2>Topics</h2> 41<h2>Topics</h2>
44<ul class=""> 42<ul class="">
45 <li><a href="topics/01-introduction.md.html">1. Introduction</a></li> 43 <li><a href="topics/01-introduction.md.html">1. Introduction</a></li>
44 <li><a href="topics/02-development.md.html">2. Development</a></li>
45 <li><a href="topics/03-terminal.md.html">3. Terminal functionality</a></li>
46 <li><a href="topics/CHANGELOG.md.html">CHANGELOG</a></li> 46 <li><a href="topics/CHANGELOG.md.html">CHANGELOG</a></li>
47 <li><a href="topics/LICENSE.md.html">MIT License</a></li> 47 <li><a href="topics/LICENSE.md.html">MIT License</a></li>
48</ul> 48</ul>
49<h2>Examples</h2>
50<ul class="nowrap">
51 <li><a href="examples/compat.lua.html">compat.lua</a></li>
52 <li><a href="examples/flag_debugging.lua.html">flag_debugging.lua</a></li>
53 <li><a href="examples/password_input.lua.html">password_input.lua</a></li>
54 <li><a href="examples/read.lua.html">read.lua</a></li>
55 <li><a href="examples/readline.lua.html">readline.lua</a></li>
56 <li><a href="examples/spinner.lua.html">spinner.lua</a></li>
57 <li><a href="examples/spiral_snake.lua.html">spiral_snake.lua</a></li>
58 <li><a href="examples/terminalsize.lua.html">terminalsize.lua</a></li>
59</ul>
49 60
50</div> 61</div>
51 62
52<div id="content"> 63<div id="content">
53 64
54<h1>Module <code>system</code></h1>
55<p>Platform independent system calls for Lua.</p>
56<p>
57
58</p>
59 65
66 <h2>Platform independent system calls for Lua</h2>
60 67
61<h2><a href="#environment_Functions">environment Functions</a></h2> 68<h2>Modules</h2>
62<table class="function_list"> 69<table class="module_list">
63 <tr> 70 <tr>
64 <td class="name" nowrap><a href="#getenv">getenv (name)</a></td> 71 <td class="name" nowrap><a href="modules/system.html">system</a></td>
65 <td class="summary">Gets the value of an environment variable.</td> 72 <td class="summary">Platform independent system calls for Lua.</td>
66 </tr> 73 </tr>
74</table>
75<h2>Classes</h2>
76<table class="module_list">
67 <tr> 77 <tr>
68 <td class="name" nowrap><a href="#getenvs">getenvs ()</a></td> 78 <td class="name" nowrap><a href="classes/bitflags.html">bitflags</a></td>
69 <td class="summary">Returns a table with all environment variables.</td> 79 <td class="summary">Bitflags module.</td>
70 </tr> 80 </tr>
81</table>
82<h2>Topics</h2>
83<table class="module_list">
71 <tr> 84 <tr>
72 <td class="name" nowrap><a href="#setenv">setenv (name[, value])</a></td> 85 <td class="name" nowrap><a href="topics/01-introduction.md.html">01-introduction.md</a></td>
73 <td class="summary">Sets an environment variable.</td> 86 <td class="summary"></td>
74 </tr> 87 </tr>
75</table>
76<h2><a href="#random_Functions">random Functions</a></h2>
77<table class="function_list">
78 <tr> 88 <tr>
79 <td class="name" nowrap><a href="#random">random ([length=1])</a></td> 89 <td class="name" nowrap><a href="topics/02-development.md.html">02-development.md</a></td>
80 <td class="summary">Generate random bytes.</td> 90 <td class="summary"></td>
81 </tr> 91 </tr>
82</table>
83<h2><a href="#term_Functions">term Functions</a></h2>
84<table class="function_list">
85 <tr> 92 <tr>
86 <td class="name" nowrap><a href="#isatty">isatty (file)</a></td> 93 <td class="name" nowrap><a href="topics/03-terminal.md.html">03-terminal.md</a></td>
87 <td class="summary">Checks if a file-handle is a TTY.</td> 94 <td class="summary"></td>
95 </tr>
96 <tr>
97 <td class="name" nowrap><a href="topics/CHANGELOG.md.html">CHANGELOG.md</a></td>
98 <td class="summary"></td>
99 </tr>
100 <tr>
101 <td class="name" nowrap><a href="topics/LICENSE.md.html">LICENSE.md</a></td>
102 <td class="summary"></td>
88 </tr> 103 </tr>
89</table> 104</table>
90<h2><a href="#time_Functions">time Functions</a></h2> 105<h2>Examples</h2>
91<table class="function_list"> 106<table class="module_list">
107 <tr>
108 <td class="name" nowrap><a href="examples/compat.lua.html">compat.lua</a></td>
109 <td class="summary"></td>
110 </tr>
111 <tr>
112 <td class="name" nowrap><a href="examples/flag_debugging.lua.html">flag_debugging.lua</a></td>
113 <td class="summary"></td>
114 </tr>
115 <tr>
116 <td class="name" nowrap><a href="examples/password_input.lua.html">password_input.lua</a></td>
117 <td class="summary"></td>
118 </tr>
119 <tr>
120 <td class="name" nowrap><a href="examples/read.lua.html">read.lua</a></td>
121 <td class="summary"></td>
122 </tr>
123 <tr>
124 <td class="name" nowrap><a href="examples/readline.lua.html">readline.lua</a></td>
125 <td class="summary"></td>
126 </tr>
92 <tr> 127 <tr>
93 <td class="name" nowrap><a href="#gettime">gettime ()</a></td> 128 <td class="name" nowrap><a href="examples/spinner.lua.html">spinner.lua</a></td>
94 <td class="summary">Get system time.</td> 129 <td class="summary"></td>
95 </tr> 130 </tr>
96 <tr> 131 <tr>
97 <td class="name" nowrap><a href="#monotime">monotime ()</a></td> 132 <td class="name" nowrap><a href="examples/spiral_snake.lua.html">spiral_snake.lua</a></td>
98 <td class="summary">Get monotonic time.</td> 133 <td class="summary"></td>
99 </tr> 134 </tr>
100 <tr> 135 <tr>
101 <td class="name" nowrap><a href="#sleep">sleep (seconds[, precision=16])</a></td> 136 <td class="name" nowrap><a href="examples/terminalsize.lua.html">terminalsize.lua</a></td>
102 <td class="summary">Sleep without a busy loop.</td> 137 <td class="summary"></td>
103 </tr> 138 </tr>
104</table> 139</table>
105 140
106<br/>
107<br/>
108
109
110 <h2 class="section-header "><a name="environment_Functions"></a>environment Functions</h2>
111
112 <dl class="function">
113 <dt>
114 <a name = "getenv"></a>
115 <strong>getenv (name)</strong>
116 </dt>
117 <dd>
118 Gets the value of an environment variable. </p>
119
120<p><strong>NOTE</strong>: Windows has multiple copies of environment variables. For this reason,
121the <a href="index.html#setenv">setenv</a> function will not work with Lua's <a href="https://www.lua.org/manual/5.1/manual.html#pdf-os.getenv">os.getenv</a> on Windows. If you want
122to use <a href="index.html#setenv">setenv</a> then consider patching <a href="https://www.lua.org/manual/5.1/manual.html#pdf-os.getenv">os.getenv</a> with this implementation of <a href="index.html#getenv">getenv</a>.
123
124
125 <h3>Parameters:</h3>
126 <ul>
127 <li><span class="parameter">name</span>
128 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
129 name of the environment variable
130 </li>
131 </ul>
132
133 <h3>Returns:</h3>
134 <ol>
135
136 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
137 value of the environment variable, or nil if the variable is not set
138 </ol>
139
140
141
142
143</dd>
144 <dt>
145 <a name = "getenvs"></a>
146 <strong>getenvs ()</strong>
147 </dt>
148 <dd>
149 Returns a table with all environment variables.
150
151
152
153 <h3>Returns:</h3>
154 <ol>
155
156 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
157 table with all environment variables and their values
158 </ol>
159
160
161
162
163</dd>
164 <dt>
165 <a name = "setenv"></a>
166 <strong>setenv (name[, value])</strong>
167 </dt>
168 <dd>
169 Sets an environment variable. </p>
170
171<p><strong>NOTE</strong>: Windows has multiple copies of environment variables. For this reason, the
172<a href="index.html#setenv">setenv</a> function will not work with Lua's <a href="https://www.lua.org/manual/5.1/manual.html#pdf-os.getenv">os.getenv</a> on Windows. If you want to use
173it then consider patching <a href="https://www.lua.org/manual/5.1/manual.html#pdf-os.getenv">os.getenv</a> with the implementation of <a href="index.html#getenv">system.getenv</a>.
174
175
176 <h3>Parameters:</h3>
177 <ul>
178 <li><span class="parameter">name</span>
179 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
180 name of the environment variable
181 </li>
182 <li><span class="parameter">value</span>
183 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
184 value of the environment variable, if <code>nil</code> the variable will be deleted (on
185Windows, setting an empty string, will also delete the variable)
186 (<em>optional</em>)
187 </li>
188 </ul>
189
190 <h3>Returns:</h3>
191 <ol>
192
193 <span class="types"><span class="type">boolean</span></span>
194 success
195 </ol>
196
197
198
199
200</dd>
201</dl>
202 <h2 class="section-header "><a name="random_Functions"></a>random Functions</h2>
203
204 <dl class="function">
205 <dt>
206 <a name = "random"></a>
207 <strong>random ([length=1])</strong>
208 </dt>
209 <dd>
210 Generate random bytes.
211This uses <code>CryptGenRandom()</code> on Windows, and <code>/dev/urandom</code> on other platforms. It will return the
212requested number of bytes, or an error, never a partial result.
213
214
215 <h3>Parameters:</h3>
216 <ul>
217 <li><span class="parameter">length</span>
218 <span class="types"><span class="type">int</span></span>
219 number of bytes to get
220 (<em>default</em> 1)
221 </li>
222 </ul>
223
224 <h3>Returns:</h3>
225 <ol>
226
227 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
228 string of random bytes
229 </ol>
230 <h3>Or</h3>
231 <ol>
232 <li>
233 <span class="types"><span class="type">nil</span></span>
234
235
236</li>
237 <li>
238 <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
239 error message</li>
240 </ol>
241
242
243
244
245</dd>
246</dl>
247 <h2 class="section-header "><a name="term_Functions"></a>term Functions</h2>
248
249 <dl class="function">
250 <dt>
251 <a name = "isatty"></a>
252 <strong>isatty (file)</strong>
253 </dt>
254 <dd>
255 Checks if a file-handle is a TTY.
256
257
258 <h3>Parameters:</h3>
259 <ul>
260 <li><span class="parameter">file</span>
261 <span class="types"><span class="type">file</span></span>
262 the file-handle to check
263 </li>
264 </ul>
265
266 <h3>Returns:</h3>
267 <ol>
268
269 <span class="types"><span class="type">boolean</span></span>
270 true if the file is a tty
271 </ol>
272
273
274
275
276</dd>
277</dl>
278 <h2 class="section-header "><a name="time_Functions"></a>time Functions</h2>
279
280 <dl class="function">
281 <dt>
282 <a name = "gettime"></a>
283 <strong>gettime ()</strong>
284 </dt>
285 <dd>
286 Get system time.
287The time is returned as the seconds since the epoch (1 January 1970 00:00:00).
288
289
290
291 <h3>Returns:</h3>
292 <ol>
293
294 <span class="types"><span class="type">number</span></span>
295 seconds (fractional)
296 </ol>
297
298
299
300
301</dd>
302 <dt>
303 <a name = "monotime"></a>
304 <strong>monotime ()</strong>
305 </dt>
306 <dd>
307 Get monotonic time.
308The time is returned as the seconds since system start.
309
310
311
312 <h3>Returns:</h3>
313 <ol>
314
315 <span class="types"><span class="type">number</span></span>
316 seconds (fractional)
317 </ol>
318
319
320
321
322</dd>
323 <dt>
324 <a name = "sleep"></a>
325 <strong>sleep (seconds[, precision=16])</strong>
326 </dt>
327 <dd>
328 Sleep without a busy loop.
329This function will sleep, without doing a busy-loop and wasting CPU cycles.
330
331
332 <h3>Parameters:</h3>
333 <ul>
334 <li><span class="parameter">seconds</span>
335 <span class="types"><span class="type">number</span></span>
336 seconds to sleep (fractional).
337 </li>
338 <li><span class="parameter">precision</span>
339 <span class="types"><span class="type">integer</span></span>
340 minimum stepsize in milliseconds (Windows only, ignored elsewhere)
341 (<em>default</em> 16)
342 </li>
343 </ul>
344
345 <h3>Returns:</h3>
346 <ol>
347
348 <code>true</code> on success, or <code>nil+err</code> on failure
349 </ol>
350
351
352
353
354</dd>
355</dl>
356
357
358</div> <!-- id="content" --> 141</div> <!-- id="content" -->
359</div> <!-- id="main" --> 142</div> <!-- id="main" -->
360<div id="about"> 143<div id="about">
361<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> 144<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
362<i style="float:right;">Last updated 2023-12-15 13:15:09 </i> 145<i style="float:right;">Last updated 2024-06-20 23:11:37 </i>
363</div> <!-- id="about" --> 146</div> <!-- id="about" -->
364</div> <!-- id="container" --> 147</div> <!-- id="container" -->
365</body> 148</body>