static int namesig(const char *p)
{
const static struct namesig tab[] = {
-/*
- ;;; The signal name table is very boring to type. To make life less awful,
- ;;; put the signal names in this list and evaluate the code to get Emacs to
- ;;; regenerate it. We use @bsearch@ on it, so it's important that it be
- ;;; sorted: Emacs does this for us.
- (let ((signals '(HUP INT QUIT ILL ABRT FPE KILL SEGV PIPE ALRM TERM
- USR1 USR2 CHLD CONT STOP TSTP TTIN TTOU BUS POLL
- PROF SYS TRAP URG VTALRM XCPU XFSZ IOT EMT STKFLT
- IO CLD PWR INFO LOST WINCH)))
- (save-excursion
- (goto-char (point-min))
- (let ((start (search-forward (concat "/" "* SIGLIST *" "/\n")))
- (end (search-forward (concat "/" "* END *" "/\n"))))
- (delete-region start end))
- (dolist (sig (sort (copy-list signals) #'string<))
- (insert (format "#ifdef SIG%s\n { \"%s\", SIG%s },\n#endif\n"
- sig sig sig)))
- (insert (concat "/" "* END *" "/\n"))))
-*/
-
-/* SIGLIST */
+ /*
+ ;;; The signal name table is very boring to type. To make life less
+ ;;; awful, put the signal names in this list and evaluate the code to
+ ;;; get Emacs to regenerate it. We use @bsearch@ on it, so it's
+ ;;; important that it be sorted: Emacs does this for us.
+
+ (let ((signals '(HUP INT QUIT ILL ABRT FPE KILL SEGV PIPE ALRM TERM
+ USR1 USR2 CHLD CONT STOP TSTP TTIN TTOU BUS POLL
+ PROF SYS TRAP URG VTALRM XCPU XFSZ IOT EMT STKFLT
+ IO CLD PWR INFO LOST WINCH)))
+ (save-excursion
+ (goto-char (point-min))
+ (search-forward (concat "***" "BEGIN siglist" "***"))
+ (beginning-of-line 2)
+ (delete-region (point)
+ (progn
+ (search-forward "***END***")
+ (beginning-of-line)
+ (point)))
+ (dolist (sig (sort (copy-list signals) #'string<))
+ (insert (format "#ifdef SIG%s\n { \"%s\", SIG%s },\n#endif\n"
+ sig sig sig)))))
+ */
+
+ /***BEGIN siglist***/
#ifdef SIGABRT
{ "ABRT", SIGABRT },
#endif
#ifdef SIGXFSZ
{ "XFSZ", SIGXFSZ },
#endif
-/* END */
+ /***END***/
};
const struct namesig *ns = bsearch(p, tab, N(tab), sizeof(tab[0]),