master xplshn/aruu / shared / sig.h
 1/* See LICENSE file for copyright and license details. */
 2#ifndef SIG_H_
 3#define SIG_H_
 4
 5#include <signal.h>
 6#include <sys/types.h>
 7
 8#ifndef SIG2STR_MAX
 9#define SIG2STR_MAX 32
10#endif
11
12#ifndef NSIG
13#ifdef _NSIG
14#define NSIG _NSIG
15#else
16#define NSIG 64
17#endif
18#endif
19
20extern const char *const aruu_sys_signame[NSIG];
21extern const int         aruu_sys_nsig;
22
23#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)  \
24    || defined(__APPLE__)
25/* system already provides sys_signame and sys_nsig */
26#else
27#define sys_signame aruu_sys_signame
28#define sys_nsig    aruu_sys_nsig
29#endif
30
31#define sig2str aruu_sig2str
32#define str2sig aruu_str2sig
33
34int aruu_sig2str(int signo, char *str);
35int aruu_str2sig(const char *str, int *signop);
36
37#endif /* !SIG_H_ */