diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-05-04 09:06:03 +0200 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-05-04 09:06:03 +0200 |
commit | b41df538c72c7e9a26f9ff08f2668769c8d1a1d1 (patch) | |
tree | 59820cae6b9edb014520487f5d2b0c9f91bc6b17 /src/term.c | |
parent | fdf62fe6c4125d29b3097e49566b2bbe1f650382 (diff) | |
download | luasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.tar.gz luasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.tar.bz2 luasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.zip |
switch "has" to "has_all_of" and "has_any_of"
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -386,7 +386,7 @@ local system = require('system') | |||
386 | local flags = system.getconsoleflags(io.stdout) | 386 | local flags = system.getconsoleflags(io.stdout) |
387 | print("Current stdout flags:", tostring(flags)) | 387 | print("Current stdout flags:", tostring(flags)) |
388 | 388 | ||
389 | if flags:has(system.COF_VIRTUAL_TERMINAL_PROCESSING + system.COF_PROCESSED_OUTPUT) then | 389 | if flags:has_all_of(system.COF_VIRTUAL_TERMINAL_PROCESSING + system.COF_PROCESSED_OUTPUT) then |
390 | print("Both flags are set") | 390 | print("Both flags are set") |
391 | else | 391 | else |
392 | print("At least one flag is not set") | 392 | print("At least one flag is not set") |
@@ -445,7 +445,7 @@ The terminal attributes is a table with the following fields: | |||
445 | local system = require('system') | 445 | local system = require('system') |
446 | 446 | ||
447 | local status = assert(tcgetattr(io.stdin)) | 447 | local status = assert(tcgetattr(io.stdin)) |
448 | if status.iflag:has(system.I_IGNBRK) then | 448 | if status.iflag:has_all_of(system.I_IGNBRK) then |
449 | print("Ignoring break condition") | 449 | print("Ignoring break condition") |
450 | end | 450 | end |
451 | */ | 451 | */ |
@@ -539,7 +539,7 @@ _Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The othe | |||
539 | local system = require('system') | 539 | local system = require('system') |
540 | 540 | ||
541 | local status = assert(tcgetattr(io.stdin)) | 541 | local status = assert(tcgetattr(io.stdin)) |
542 | if not status.lflag:has(system.L_ECHO) then | 542 | if not status.lflag:has_all_of(system.L_ECHO) then |
543 | -- if echo is off, turn echoing newlines on | 543 | -- if echo is off, turn echoing newlines on |
544 | tcsetattr(io.stdin, system.TCSANOW, { lflag = status.lflag + system.L_ECHONL })) | 544 | tcsetattr(io.stdin, system.TCSANOW, { lflag = status.lflag + system.L_ECHONL })) |
545 | end | 545 | end |