ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
handle.h
Go to the documentation of this file.
1#ifndef _handle_h_INCLUDED
2#define _handle_h_INCLUDED
3
4#include <signal.h>
5
6#include "global.h"
8
9void kissat_init_signal_handler (void (*handler) (int));
11
12void kissat_init_alarm (void (*handler) (void));
14
15#ifdef __MINGW32__
16#define SIGNAL_SIGBUS
17#else
18#define SIGNAL_SIGBUS SIGNAL (SIGBUS)
19#endif
20
21#define SIGNALS \
22 SIGNAL (SIGABRT) \
23 SIGNAL_SIGBUS \
24 SIGNAL (SIGINT) \
25 SIGNAL (SIGSEGV) \
26 SIGNAL (SIGTERM)
27
28// clang-format off
29
30static inline const char *
31kissat_signal_name (int sig)
32{
33#define SIGNAL(SIG) \
34 if (sig == SIG) return #SIG;
36#undef SIGNAL
37#ifndef __MINGW32__
38 if (sig == SIGALRM)
39 return "SIGALRM";
40#endif
41 return "SIGUNKNOWN";
42}
43
44// clang-format on
45
47
48#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define SIGNALS
ABC_NAMESPACE_HEADER_START void kissat_init_signal_handler(void(*handler)(int))
void kissat_reset_alarm(void)
void kissat_init_alarm(void(*handler)(void))
void kissat_reset_signal_handler(void)