2 * A List of Signal Names
4 * (c) 2012 Martin Mares <mj@ucw.cz>
8 #include <ucw/signames.h>
19 #define S(sig) { #sig, sig }
21 static const struct sig_name sig_names[] = {
124 sig_name_to_number(const char *name)
126 for (uns i=0; i < ARRAY_SIZE(sig_names); i++)
127 if (!strcmp(sig_names[i].name, name))
128 return sig_names[i].number;
133 sig_number_to_name(int number)
135 for (uns i=0; i < ARRAY_SIZE(sig_names); i++)
136 if (sig_names[i].number == number)
137 return sig_names[i].name;
148 while (fgets(c, sizeof(c), stdin))
150 char *e = strchr(c, '\n');
155 const char *name = sig_number_to_name(atoi(c+1));
160 int num = sig_name_to_number(c);