*/
#include "curses.nit.h"
-#include <time.h>
-#include <poll.h>
/*
C implementation of curses::Window::init
{
endwin();
}
-
-/*
-C implementation of curses::Sys::nanosleep
-*/
-void Sys_nanosleep___impl( Sys recv, bigint sec, bigint nanosec ) {
- const struct timespec req = {sec, nanosec};
- nanosleep(&req, NULL);
-}
-
-/*
-C implementation of curses::Stdin::poll_in
-*/
-int Stdin_poll_in___impl( Stdin recv ) {
- struct pollfd fd = {0, POLLIN, 0};
- int res = poll(&fd, 1, 0);
- if (res == -1) {
- endwin();
- perror("Error poll stdin");
- exit(EXIT_FAILURE);
- }
- return res > 0;
-}