diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-07-07 17:43:50 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-07-07 17:43:50 -0300 |
commit | 2260209d3b09f728f0cbb891f5498a9f0f8e38eb (patch) | |
tree | e3f886518b49bc09eadbb7aa94cee1b37f6cc894 /jet.cpp | |
parent | c801730eda827ea2662ef703f694a2abde33f4c0 (diff) | |
download | jet-2260209d3b09f728f0cbb891f5498a9f0f8e38eb.tar.gz jet-2260209d3b09f728f0cbb891f5498a9f0f8e38eb.zip |
Implement tui for client
Diffstat (limited to 'jet.cpp')
-rw-r--r-- | jet.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 (;;) { |