diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-05-23 20:46:18 +0200 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-05-23 20:57:20 +0200 |
commit | 56db1511baeb0376a12915c69c1552b04010c26f (patch) | |
tree | d03aa6b4c33a6de39371e9be336c471bfd2cafc5 /src | |
parent | 8f8d34f03428dbaa6cac229bbe36efc6d80d186d (diff) | |
download | luasystem-56db1511baeb0376a12915c69c1552b04010c26f.tar.gz luasystem-56db1511baeb0376a12915c69c1552b04010c26f.tar.bz2 luasystem-56db1511baeb0376a12915c69c1552b04010c26f.zip |
cleanup and documentation
Diffstat (limited to 'src')
-rw-r--r-- | src/term.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -337,7 +337,7 @@ To see flag status and constant names check `listconsoleflags`. | |||
337 | Note: not all combinations of flags are allowed, as some are mutually exclusive or mutually required. | 337 | Note: not all combinations of flags are allowed, as some are mutually exclusive or mutually required. |
338 | See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode) | 338 | See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode) |
339 | @function setconsoleflags | 339 | @function setconsoleflags |
340 | @tparam file file the file-handle to set the flags on | 340 | @tparam file file file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr` |
341 | @tparam bitflags bitflags the flags to set/unset | 341 | @tparam bitflags bitflags the flags to set/unset |
342 | @treturn[1] boolean `true` on success | 342 | @treturn[1] boolean `true` on success |
343 | @treturn[2] nil | 343 | @treturn[2] nil |
@@ -378,8 +378,17 @@ static int lst_setconsoleflags(lua_State *L) | |||
378 | 378 | ||
379 | /*** | 379 | /*** |
380 | Gets console flags (Windows). | 380 | Gets console flags (Windows). |
381 | The `CIF_` and `COF_` constants are available on the module table. Where `CIF` are the | ||
382 | input flags (for use with `io.stdin`) and `COF` are the output flags (for use with | ||
383 | `io.stdout`/`io.stderr`). | ||
384 | |||
385 | _Note_: See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode) | ||
386 | for more information on the flags. | ||
387 | |||
388 | |||
389 | |||
381 | @function getconsoleflags | 390 | @function getconsoleflags |
382 | @tparam file file the file-handle to get the flags from. | 391 | @tparam file file file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr` |
383 | @treturn[1] bitflags the current console flags. | 392 | @treturn[1] bitflags the current console flags. |
384 | @treturn[2] nil | 393 | @treturn[2] nil |
385 | @treturn[2] string error message | 394 | @treturn[2] string error message |
@@ -433,8 +442,8 @@ The terminal attributes is a table with the following fields: | |||
433 | 442 | ||
434 | - `iflag` input flags | 443 | - `iflag` input flags |
435 | - `oflag` output flags | 444 | - `oflag` output flags |
436 | - `cflag` control flags | ||
437 | - `lflag` local flags | 445 | - `lflag` local flags |
446 | - `cflag` control flags | ||
438 | - `ispeed` input speed | 447 | - `ispeed` input speed |
439 | - `ospeed` output speed | 448 | - `ospeed` output speed |
440 | - `cc` control characters | 449 | - `cc` control characters |
@@ -528,9 +537,6 @@ flags for the `iflags`, `oflags`, and `lflags` bitmasks. | |||
528 | To see flag status and constant names check `listtermflags`. For their meaning check | 537 | To see flag status and constant names check `listtermflags`. For their meaning check |
529 | [the manpage](https://www.man7.org/linux/man-pages/man3/termios.3.html). | 538 | [the manpage](https://www.man7.org/linux/man-pages/man3/termios.3.html). |
530 | 539 | ||
531 | _Note_: not all combinations of flags are allowed, as some are mutually exclusive or mutually required. | ||
532 | See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode) | ||
533 | |||
534 | _Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The other fields are ignored. | 540 | _Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The other fields are ignored. |
535 | @function tcsetattr | 541 | @function tcsetattr |
536 | @tparam file fd file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr` | 542 | @tparam file fd file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr` |
@@ -722,6 +728,7 @@ directly, but through the `system.readkey` or `system.readansi` functions. It | |||
722 | will return the next byte from the input stream, or `nil` if no key was pressed. | 728 | will return the next byte from the input stream, or `nil` if no key was pressed. |
723 | 729 | ||
724 | On Posix, `io.stdin` must be set to non-blocking mode using `setnonblock` | 730 | On Posix, `io.stdin` must be set to non-blocking mode using `setnonblock` |
731 | and canonical mode must be turned off using `tcsetattr`, | ||
725 | before calling this function. Otherwise it will block. No conversions are | 732 | before calling this function. Otherwise it will block. No conversions are |
726 | done on Posix, so the byte read is returned as-is. | 733 | done on Posix, so the byte read is returned as-is. |
727 | 734 | ||