aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-13 01:14:26 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-13 01:14:26 -0400
commit282695a9e923f069da86486dd9b0cf79f20da76f (patch)
tree4d9cef80ec7a5bba2641e9cc48ec789e4077485a
parent0e5d55283a9adcc9b5ed071b4e18b74e55dbe0c4 (diff)
downloadrunes-282695a9e923f069da86486dd9b0cf79f20da76f.tar.gz
runes-282695a9e923f069da86486dd9b0cf79f20da76f.zip
this is an unnecessary level of abstraction
-rw-r--r--Makefile2
-rw-r--r--events.c21
-rw-r--r--events.h14
-rw-r--r--pty-unix.c4
-rw-r--r--runes.h5
-rw-r--r--window-xlib.c4
6 files changed, 9 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index cae9f45..e84d562 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
OUT = runes
-OBJ = runes.o display.o term.o events.o vt100.o window-xlib.o pty-unix.o
+OBJ = runes.o display.o term.o vt100.o window-xlib.o pty-unix.o
LIBS = cairo cairo-xlib libuv
CFLAGS ?= -g -Wall -Wextra -Werror
LDFLAGS ?= -g -Wall -Wextra -Werror
diff --git a/events.c b/events.c
deleted file mode 100644
index 32ca790..0000000
--- a/events.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "runes.h"
-
-void runes_handle_keyboard_event(RunesTerm *t, char *buf, size_t len)
-{
- runes_pty_backend_write(t, buf, len);
-}
-
-void runes_handle_pty_read(RunesTerm *t, char *buf, ssize_t len)
-{
- runes_vt100_process_string(t, buf, len);
-}
-
-void runes_handle_pty_close(RunesTerm *t)
-{
- runes_window_backend_request_close(t);
-}
-
-void runes_handle_close_window(RunesTerm *t)
-{
- runes_pty_backend_request_close(t);
-}
diff --git a/events.h b/events.h
deleted file mode 100644
index 4307b4f..0000000
--- a/events.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _RUNES_EVENTS_H
-#define _RUNES_EVENTS_H
-
-struct runes_loop_data {
- uv_work_t req;
- RunesTerm *t;
-};
-
-void runes_handle_keyboard_event(RunesTerm *t, char *buf, size_t len);
-void runes_handle_pty_read(RunesTerm *t, char *buf, ssize_t len);
-void runes_handle_pty_close(RunesTerm *t);
-void runes_handle_close_window(RunesTerm *t);
-
-#endif
diff --git a/pty-unix.c b/pty-unix.c
index bf66749..4664f16 100644
--- a/pty-unix.c
+++ b/pty-unix.c
@@ -116,12 +116,12 @@ static void runes_pty_backend_got_data(uv_work_t *req, int status)
t = data->data.t;
if (data->len > 0) {
- runes_handle_pty_read(t, data->buf, data->len);
+ runes_vt100_process_string(t, data->buf, data->len);
uv_queue_work(
t->loop, req, runes_pty_backend_read, runes_pty_backend_got_data);
}
else {
- runes_handle_pty_close(t);
+ runes_window_backend_request_close(t);
free(req);
}
}
diff --git a/runes.h b/runes.h
index 9233937..7ba6be2 100644
--- a/runes.h
+++ b/runes.h
@@ -14,7 +14,10 @@ typedef struct runes_window RunesWindowBackend;
typedef struct runes_pty RunesPtyBackend;
typedef struct runes_loop_data RunesLoopData;
-#include "events.h"
+struct runes_loop_data {
+ uv_work_t req;
+ RunesTerm *t;
+};
#include "window-xlib.h"
#include "pty-unix.h"
diff --git a/window-xlib.c b/window-xlib.c
index 76f97bf..958bb26 100644
--- a/window-xlib.c
+++ b/window-xlib.c
@@ -214,7 +214,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
break;
}
- runes_handle_keyboard_event(t, buf, chars);
+ runes_pty_backend_write(t, buf, chars);
free(buf);
break;
}
@@ -255,7 +255,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
runes_window_backend_process_event);
}
else {
- runes_handle_close_window(t);
+ runes_pty_backend_request_close(t);
free(req);
}
}