* xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP.
[deliverable/binutils-gdb.git] / gdb / signame.c
index 740da408b8f8aad30f0d946579600e1419f9ca62..f0e88babcadea81e0c821ad6515c5e80ff6501c0 100755 (executable)
@@ -1,10 +1,12 @@
-/* Convert between signal names and numbers.
-   Copyright (C) 1990 Free Software Foundation, Inc.
+/* Convert between signal names and numbers, for GDB.
+   Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+
+   This file is part of GDB.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,26 +14,30 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include <stdio.h>
 #include <signal.h>
+/* GDB-specific, FIXME.  (This is for the SYS_SIGLIST_MISSING define).  */
+#include "defs.h"
 #include "signame.h"
 
-#ifdef __STDC__
-#define CONST const
-#else
-#define CONST
-#endif
+static void
+init_sig PARAMS ((int, const char *, const char *));
+
+static void
+init_sigs PARAMS ((void));
 
-#ifdef SYS_SIGLIST_MISSING
+#if SYS_SIGLIST_MISSING
 /* There is too much variation in Sys V signal numbers and names, so
    we must initialize them at runtime.  */
 
-static CONST char undoc[] = "unknown signal";
+static const char undoc[] = "unknown signal";
 
-CONST char *sys_siglist[NSIG];
+/* We'd like to make this const char*[], but whoever's using it might
+   want to assign from it to a char*.  */
+char *sys_siglist[NSIG];
 #endif /* SYS_SIGLIST_MISSING */
 
 /* Table of abbreviations for signals.  Note:  A given number can
@@ -39,21 +45,22 @@ CONST char *sys_siglist[NSIG];
 typedef struct
   {
     int number;
-    CONST char *abbrev;
+    const char *abbrev;
   } num_abbrev;
 static num_abbrev sig_table[NSIG*2];
 /* Number of elements of sig_table used.  */
 static int sig_table_nelts = 0;
 
 /* Enter signal number NUMBER into the tables with ABBREV and NAME.  */
+/* ARGSUSED */
 static void
 init_sig (number, abbrev, name)
      int number;
-     CONST char *abbrev;
-     CONST char *name;
+     const char *abbrev;
+     const char *name;
 {
-#ifdef SYS_SIGLIST_MISSING
-  sys_siglist[number] = name;
+#if SYS_SIGLIST_MISSING
+  sys_siglist[number] = (char *) name;
 #endif
   sig_table[sig_table_nelts].number = number;
   sig_table[sig_table_nelts++].abbrev = abbrev;
@@ -61,10 +68,12 @@ init_sig (number, abbrev, name)
 
 static void init_sigs ()
 {
-#ifdef SYS_SIGLIST_MISSING
+#if SYS_SIGLIST_MISSING
+  int i;
+
   /* Initialize signal names.  */
        for (i = 0; i < NSIG; i++)
-               sys_siglist[i] = undoc;
+               sys_siglist[i] = (char *) undoc;
 #endif /* SYS_SIGLIST_MISSING */
 
   /* Initialize signal names.  */
@@ -209,7 +218,7 @@ sig_abbrev (number)
    signal by that name.  */
 int
 sig_number (abbrev)
-     CONST char *abbrev;
+     const char *abbrev;
 {
   int i;
 
@@ -224,20 +233,20 @@ sig_number (abbrev)
   return -1;
 }
 
-#if defined (SYS_SIGLIST_MISSING)
+#if SYS_SIGLIST_MISSING
 /* Print to standard error the name of SIGNAL, preceded by MESSAGE and
    a colon, and followed by a newline.  */
 void
 psignal (signal, message)
      unsigned signal;
-     CONST char *message;
+     const char *message;
 {
   if (signal <= 0 || signal >= NSIG)
     fprintf (stderr, "%s: unknown signal", message);
   else
     fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
 }
-#endif
+#endif /* SYS_SIGLIST_MISSING */
 
 void
 _initialize_signame ()
This page took 0.025276 seconds and 4 git commands to generate.