//
// $Id: Util.cc 72 2005-07-12 00:46:02Z amackenz $
// 

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

#include "Util.h"
#include "config.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);
}

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


