#include <stdlib.h>
#include <stdio.h>
#include <ncurses.h>

#include "Util.h"

#ifdef __DEBUG__
extern FILE*ferr;
#endif 

void clean_exit(int x, char *e)
{
    printf("%s\n",e);
#ifdef __DEBUG__
    if (ferr)
        fclose(ferr);
#endif
    endwin();
    exit(x);
}

void sig_int(int x)
{
    printf("Recieved signal SIGINT, exiting (%d)",x); 
    clean_exit(x);
}


