summaryrefslogtreecommitdiff
path: root/jet.cpp
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-07-07 17:43:50 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-07-07 17:43:50 -0300
commit2260209d3b09f728f0cbb891f5498a9f0f8e38eb (patch)
treee3f886518b49bc09eadbb7aa94cee1b37f6cc894 /jet.cpp
parentc801730eda827ea2662ef703f694a2abde33f4c0 (diff)
downloadjet-2260209d3b09f728f0cbb891f5498a9f0f8e38eb.tar.gz
jet-2260209d3b09f728f0cbb891f5498a9f0f8e38eb.zip
Implement tui for client
Diffstat (limited to 'jet.cpp')
-rw-r--r--jet.cpp8
1 files changed, 7 insertions, 1 deletions
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 (;;) {