From 2260209d3b09f728f0cbb891f5498a9f0f8e38eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 7 Jul 2020 17:43:50 -0300 Subject: Implement tui for client --- jet.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'jet.cpp') diff --git a/jet.cpp b/jet.cpp index 50572c2..c4e997c 100644 --- a/jet.cpp +++ b/jet.cpp @@ -35,6 +35,10 @@ void parse_command(char *command, Client *client) { client->show(); } else if (strcmp(token, "move") == 0) { client->move(); + } else if (strcmp(token, "push") == 0) { + client->push(); + } else if (strcmp(token, "pop") == 0) { + client->pop(); } else { client->args.push(atoi(token)); } @@ -47,13 +51,15 @@ int main() { scratch.read("LICENSE"); int listener = create_listener(); + int epollfd = epoll_create1(0); - epoll_event events[MAX_EVENTS]; + epoll_event ev; ev.events = EPOLLIN; ev.data.fd = listener; epoll_ctl(epollfd, EPOLL_CTL_ADD, listener, &ev); + epoll_event events[MAX_EVENTS]; Client *clients[1024] = {}; for (;;) { -- cgit v1.2.3