diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-18 06:18:54 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-18 06:18:54 -0700 |
commit | 6ca427f995a76ed9c5bae2ab86f864ea5ae4d376 (patch) | |
tree | 144ba53e9636aec6418c37225a74359bc20ac626 /lisplib.c | |
parent | d2bc824b4f91f6aa462e27f8b5dde6dee1cc031f (diff) | |
download | txr-6ca427f995a76ed9c5bae2ab86f864ea5ae4d376.tar.gz txr-6ca427f995a76ed9c5bae2ab86f864ea5ae4d376.tar.bz2 txr-6ca427f995a76ed9c5bae2ab86f864ea5ae4d376.zip |
Adding termios support.
* Makefile (termios.o): New object file.
* lib.c (init): Call termios_init.
* lisplib.c (termios_set_entries, termios_instantiate): New
functions.
(lisplib_init): Register new functions in autoload table.
* share/txr/stdlib/termios.tl: New file.
* termios.c, termios.h: New files.
* txr.1: Documented termios.
Diffstat (limited to 'lisplib.c')
-rw-r--r-- | lisplib.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -281,7 +281,6 @@ static val yield_instantiate(val set_fun) } #if HAVE_SOCKETS - static val sock_set_entries(val dlt, val fun) { val name[] = { @@ -313,6 +312,30 @@ static val sock_instantiate(val set_fun) #endif +#if HAVE_TERMIOS + +static val termios_set_entries(val dlt, val fun) +{ + val name[] = { + lit("set-iflags"), lit("set-oflags"), lit("set-cflags"), lit("set-lflags"), + lit("clear-iflags"), lit("clear-oflags"), lit("clear-cflags"), lit("clear-lflags"), + lit("go-raw"), lit("go-cbreak"), lit("go-canon"), + lit("string-encode"), lit("string-decode"), nil + }; + set_dlt_entries(dlt, name, fun); + return nil; +} + +static val termios_instantiate(val set_fun) +{ + funcall1(set_fun, nil); + load(format(nil, lit("~a/termios.tl"), stdlib_path, nao)); + sock_load_init(); + return nil; +} + +#endif + val dlt_register(val dlt, val (*instantiate)(val), val (*set_entries)(val, val)) @@ -339,6 +362,9 @@ void lisplib_init(void) #if HAVE_SOCKETS dlt_register(dl_table, sock_instantiate, sock_set_entries); #endif +#if HAVE_TERMIOS + dlt_register(dl_table, termios_instantiate, termios_set_entries); +#endif } val lisplib_try_load(val sym) |