#include #include #include "eat.h" void stupid_test(void) { if (initscr() == NULL) { perror("initscr"); return; } printw("This is a a curses window\n"); refresh(); sleep(3); printw("Going bye-bye now\n"); refresh(); sleep(3); endwin(); } /* Allocate and initialize a new screen */ screen_t* create_screen(void) { screen_t* s = malloc(sizeof(screen_t)); if (s == NULL) return NULL; s->c_win = initscr(); if (s->c_win == NULL) {free(s); return NULL;} s->size = 0; s->wins = NULL; return s; } /* Destroy the screen */ int destroy_screen(screen_t* s) { win_t* w; if (s == NULL) return 0; if (s->wins != NULL) { for (w = *s->wins; *w != NULL; w++) { switch (w->type) { case TERMINAL: case INPUT: case STATUS: } } free(s->wins); } free(s); return 1; }