dict exists: Improve performance when when key not found
[jimtcl.git] / jim-nosignal.c
blobbc3971297a8c03ab822b69e88c203299f74f61f2
1 #include <stdio.h>
2 #include <signal.h>
4 #include <jim-signal.h>
5 #include <jim.h>
7 /* Implement trivial Jim_SignalId() just good enough for JimMakeErrorCode() in [exec] */
10 /* This works for mingw, but is not really portable */
11 #ifndef SIGPIPE
12 #define SIGPIPE 13
13 #endif
14 #ifndef SIGINT
15 #define SIGINT 2
16 #endif
18 const char *Jim_SignalId(int sig)
20 static char buf[10];
21 switch (sig) {
22 case SIGINT: return "SIGINT";
23 case SIGPIPE: return "SIGPIPE";
26 snprintf(buf, sizeof(buf), "%d", sig);
27 return buf;