#include "signalhandler.h"

#ifdef _WIN32
#include <windows.h>
#endif // _WIN32

#include "exitrequest.h"

#ifdef _WIN32
static BOOL Handler(int signal)
{
     if (signal == CTRL_C_EVENT)
        ExitRequest_Fire(EXITMODE_SYS_SIGNAL);

    return TRUE;
}
#endif // _WIN32

void SignalHandler_Init(void)
{
#ifdef _WIN32
    SetConsoleCtrlHandler((PHANDLER_ROUTINE)Handler, TRUE);
#endif // _WIN32
}

void SignalHandler_Cleanup(void) { }