diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2023-11-15 07:48:12 +0100 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2023-11-15 19:17:57 +0100 |
| commit | 048f3cec7a18e7a28146f03c3c9e5d89d9613028 (patch) | |
| tree | 41e8630938542fe1ec79ba4eff4304d85b45835e /docs/index.html | |
| parent | 5f3951a942fdc4bf489d8d590bfc891ac9548a23 (diff) | |
| download | luasystem-048f3cec7a18e7a28146f03c3c9e5d89d9613028.tar.gz luasystem-048f3cec7a18e7a28146f03c3c9e5d89d9613028.tar.bz2 luasystem-048f3cec7a18e7a28146f03c3c9e5d89d9613028.zip | |
chore(docs): render the documentation
Diffstat (limited to 'docs/index.html')
| -rw-r--r-- | docs/index.html | 366 |
1 files changed, 366 insertions, 0 deletions
diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..eb241c6 --- /dev/null +++ b/docs/index.html | |||
| @@ -0,0 +1,366 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 3 | <html> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
| 5 | <head> | ||
| 6 | <title>Lua-System docs</title> | ||
| 7 | <link rel="stylesheet" href="ldoc.css" type="text/css" /> | ||
| 8 | </head> | ||
| 9 | <body> | ||
| 10 | |||
| 11 | <div id="container"> | ||
| 12 | |||
| 13 | <div id="product"> | ||
| 14 | <div id="product_logo"></div> | ||
| 15 | <div id="product_name"><big><b></b></big></div> | ||
| 16 | <div id="product_description"></div> | ||
| 17 | </div> <!-- id="product" --> | ||
| 18 | |||
| 19 | |||
| 20 | <div id="main"> | ||
| 21 | |||
| 22 | |||
| 23 | <!-- Menu --> | ||
| 24 | |||
| 25 | <div id="navigation"> | ||
| 26 | <br/> | ||
| 27 | <h1>Lua-System</h1> | ||
| 28 | |||
| 29 | |||
| 30 | <h2>Contents</h2> | ||
| 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 | |||
| 38 | |||
| 39 | <h2>Modules</h2> | ||
| 40 | <ul class="nowrap"> | ||
| 41 | <li><strong>system</strong></li> | ||
| 42 | </ul> | ||
| 43 | <h2>Topics</h2> | ||
| 44 | <ul class=""> | ||
| 45 | <li><a href="topics/01-introduction.md.html">1. Introduction</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> | ||
| 48 | </ul> | ||
| 49 | |||
| 50 | </div> | ||
| 51 | |||
| 52 | <div id="content"> | ||
| 53 | |||
| 54 | <h1>Module <code>system</code></h1> | ||
| 55 | <p>Platform independent system calls for Lua.</p> | ||
| 56 | <p> | ||
| 57 | |||
| 58 | </p> | ||
| 59 | |||
| 60 | |||
| 61 | <h2><a href="#environment_Functions">environment Functions</a></h2> | ||
| 62 | <table class="function_list"> | ||
| 63 | <tr> | ||
| 64 | <td class="name" nowrap><a href="#getenv">getenv (name)</a></td> | ||
| 65 | <td class="summary">Gets the value of an environment variable.</td> | ||
| 66 | </tr> | ||
| 67 | <tr> | ||
| 68 | <td class="name" nowrap><a href="#getenvs">getenvs ()</a></td> | ||
| 69 | <td class="summary">Returns a table with all environment variables.</td> | ||
| 70 | </tr> | ||
| 71 | <tr> | ||
| 72 | <td class="name" nowrap><a href="#setenv">setenv (name[, value])</a></td> | ||
| 73 | <td class="summary">Sets an environment variable.</td> | ||
| 74 | </tr> | ||
| 75 | </table> | ||
| 76 | <h2><a href="#random_Functions">random Functions</a></h2> | ||
| 77 | <table class="function_list"> | ||
| 78 | <tr> | ||
| 79 | <td class="name" nowrap><a href="#random">random ([length=1])</a></td> | ||
| 80 | <td class="summary">Generate random bytes.</td> | ||
| 81 | </tr> | ||
| 82 | </table> | ||
| 83 | <h2><a href="#term_Functions">term Functions</a></h2> | ||
| 84 | <table class="function_list"> | ||
| 85 | <tr> | ||
| 86 | <td class="name" nowrap><a href="#isatty">isatty (file)</a></td> | ||
| 87 | <td class="summary">Checks if a file-handle is a TTY.</td> | ||
| 88 | </tr> | ||
| 89 | </table> | ||
| 90 | <h2><a href="#time_Functions">time Functions</a></h2> | ||
| 91 | <table class="function_list"> | ||
| 92 | <tr> | ||
| 93 | <td class="name" nowrap><a href="#gettime">gettime ()</a></td> | ||
| 94 | <td class="summary">Get system time.</td> | ||
| 95 | </tr> | ||
| 96 | <tr> | ||
| 97 | <td class="name" nowrap><a href="#monotime">monotime ()</a></td> | ||
| 98 | <td class="summary">Get monotonic time.</td> | ||
| 99 | </tr> | ||
| 100 | <tr> | ||
| 101 | <td class="name" nowrap><a href="#sleep">sleep (seconds[, precision=16])</a></td> | ||
| 102 | <td class="summary">Sleep without a busy loop.</td> | ||
| 103 | </tr> | ||
| 104 | </table> | ||
| 105 | |||
| 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, | ||
| 121 | the <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 | ||
| 122 | to 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 | ||
| 173 | it 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 | ||
| 185 | Windows, 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. | ||
| 211 | This uses <code>CryptGenRandom()</code> on Windows, and <code>/dev/urandom</code> on other platforms. It will return the | ||
| 212 | requested 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. | ||
| 287 | The 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. | ||
| 308 | The 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. | ||
| 329 | This 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" --> | ||
| 359 | </div> <!-- id="main" --> | ||
| 360 | <div id="about"> | ||
| 361 | <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | ||
| 362 | <i style="float:right;">Last updated 2023-11-15 07:42:18 </i> | ||
| 363 | </div> <!-- id="about" --> | ||
| 364 | </div> <!-- id="container" --> | ||
| 365 | </body> | ||
| 366 | </html> | ||
