diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-04-05 18:23:32 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-04-05 18:36:40 +0200 |
commit | c718109fc6288501062e4484de14f4a92af897a9 (patch) | |
tree | c17c52d922cc17e362df792a47db3bfbfc07434c | |
parent | Move termios bindings to scheme code. (diff) | |
download | calp-c718109fc6288501062e4484de14f4a92af897a9.tar.gz calp-c718109fc6288501062e4484de14f4a92af897a9.tar.xz |
Remove old termios bindings.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/termios.scm.c | 46 |
2 files changed, 1 insertions, 47 deletions
@@ -11,7 +11,7 @@ CFLAGS = -std=gnu11 -Wall -Wextra \ $(shell guile-config compile) LDFLAGS = -fPIC $(shell guile-config link) -LIBS = libguile-calendar.so libtermios.so +LIBS = libguile-calendar.so SO_FILES = $(addprefix $(LIBDIR)/, $(LIBS)) H_FILES = $(wildcard src/*.h) diff --git a/src/termios.scm.c b/src/termios.scm.c deleted file mode 100644 index 310bf058..00000000 --- a/src/termios.scm.c +++ /dev/null @@ -1,46 +0,0 @@ -#include <libguile.h> -#include <unistd.h> -#include <termios.h> -#include <stdio.h> - -#include "err.h" - -static struct termios *oldt, *newt; - -SCM_DEFINE(termios_lflags_and, "c-lflags-disable!", 2, 0, 0, - (SCM _fd, SCM _bits), - "") -{ - - int fd = scm_to_int (_fd); - int bits = scm_to_int (_bits); - - INFO_F("Setting bits [%x]", bits); - - tcgetattr(fd, oldt); - *newt = *oldt; - - // Make the terminal not echo back, - // along with enabling cononical mode - newt->c_lflag &= ~ bits; - tcsetattr(fd, TCSANOW, newt); - return SCM_UNSPECIFIED; -} - -SCM_DEFINE(termios_restore, "c-lflag-restore!", 1, 0, 0, - (SCM _fd), - "") -{ - int fd = scm_to_int (_fd); - tcsetattr(fd, TCSANOW, oldt); - return SCM_UNSPECIFIED; -} - -void init_termios (void) { - oldt = scm_gc_malloc(sizeof(*oldt), "Termios"); - newt = scm_gc_malloc(sizeof(*newt), "Termios"); - -#ifndef SCM_MAGIC_SNARFER -#include "termios.x" -#endif -} |