Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/libiberty/strsignal.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    1818   declare it ourselves.  With luck, this will always work.  */
    1919#define sys_siglist no_such_symbol
     20#define sys_nsig sys_nsig__no_such_symbol
    2021
    2122#include <stdio.h>
     
    3940   found in the system header files.  */
    4041#undef sys_siglist
     42#undef sys_nsig
    4143
    4244#ifndef NULL
    43 #  ifdef __STDC__
     45#  ifdef ANSI_PROTOTYPES
    4446#    define NULL (void *) 0
    4547#  else
     
    6668struct signal_info
    6769{
    68   int value;            /* The numeric value from <signal.h> */
    69   const char *name;     /* The equivalent symbolic value */
     70  const int value;              /* The numeric value from <signal.h> */
     71  const char *const name;       /* The equivalent symbolic value */
    7072#ifndef HAVE_SYS_SIGLIST
    71   const char *msg;      /* Short message about this value */
     73  const char *const msg;        /* Short message about this value */
    7274#endif
    7375};
     
    349351/*
    350352
    351 NAME
    352 
    353         signo_max -- return the max signo value
    354 
    355 SYNOPSIS
    356 
    357         int signo_max ();
    358 
    359 DESCRIPTION
    360 
    361         Returns the maximum signo value for which a corresponding symbolic
    362         name or message is available.  Note that in the case where
    363         we use the sys_siglist supplied by the system, it is possible for
    364         there to be more symbolic names than messages, or vice versa.
    365         In fact, the manual page for psignal(3b) explicitly warns that one
    366         should check the size of the table (NSIG) before indexing it,
    367         since new signal codes may be added to the system before they are
    368         added to the table.  Thus NSIG might be smaller than value
    369         implied by the largest signo value defined in <signal.h>.
    370 
    371         We return the maximum value that can be used to obtain a meaningful
    372         symbolic name or message.
     353@deftypefn Extension int signo_max (void)
     354
     355Returns the maximum signal value for which a corresponding symbolic
     356name or message is available.  Note that in the case where we use the
     357@code{sys_siglist} supplied by the system, it is possible for there to
     358be more symbolic names than messages, or vice versa.  In fact, the
     359manual page for @code{psignal(3b)} explicitly warns that one should
     360check the size of the table (@code{NSIG}) before indexing it, since
     361new signal codes may be added to the system before they are added to
     362the table.  Thus @code{NSIG} might be smaller than value implied by
     363the largest signo value defined in @code{<signal.h>}.
     364
     365We return the maximum value that can be used to obtain a meaningful
     366symbolic name or message.
     367
     368@end deftypefn
    373369
    374370*/
     
    390386/*
    391387
    392 NAME
    393 
    394         strsignal -- map a signal number to a signal message string
    395 
    396 SYNOPSIS
    397 
    398         const char *strsignal (int signo)
    399 
    400 DESCRIPTION
    401 
    402         Maps an signal number to an signal message string, the contents of
    403         which are implementation defined.  On systems which have the external
    404         variable sys_siglist, these strings will be the same as the ones used
    405         by psignal().
    406 
    407         If the supplied signal number is within the valid range of indices
    408         for the sys_siglist, but no message is available for the particular
    409         signal number, then returns the string "Signal NUM", where NUM is the
    410         signal number.
    411 
    412         If the supplied signal number is not a valid index into sys_siglist,
    413         returns NULL.
    414 
    415         The returned string is only guaranteed to be valid only until the
    416         next call to strsignal.
     388@deftypefn Supplemental {const char *} strsignal (int @var{signo})
     389
     390Maps an signal number to an signal message string, the contents of
     391which are implementation defined.  On systems which have the external
     392variable @code{sys_siglist}, these strings will be the same as the
     393ones used by @code{psignal()}.
     394
     395If the supplied signal number is within the valid range of indices for
     396the @code{sys_siglist}, but no message is available for the particular
     397signal number, then returns the string @samp{Signal @var{num}}, where
     398@var{num} is the signal number.
     399
     400If the supplied signal number is not a valid index into
     401@code{sys_siglist}, returns @code{NULL}.
     402
     403The returned string is only guaranteed to be valid only until the next
     404call to @code{strsignal}.
     405
     406@end deftypefn
    417407
    418408*/
     
    460450/*
    461451
    462 NAME
    463 
    464         strsigno -- map an signal number to a symbolic name string
    465 
    466 SYNOPSIS
    467 
    468         const char *strsigno (int signo)
    469 
    470 DESCRIPTION
    471 
    472         Given an signal number, returns a pointer to a string containing
    473         the symbolic name of that signal number, as found in <signal.h>.
    474 
    475         If the supplied signal number is within the valid range of indices
    476         for symbolic names, but no name is available for the particular
    477         signal number, then returns the string "Signal NUM", where NUM is
    478         the signal number.
    479 
    480         If the supplied signal number is not within the range of valid
    481         indices, then returns NULL.
    482 
    483 BUGS
    484 
    485         The contents of the location pointed to are only guaranteed to be
    486         valid until the next call to strsigno.
     452@deftypefn Extension {const char*} strsigno (int @var{signo})
     453
     454Given an signal number, returns a pointer to a string containing the
     455symbolic name of that signal number, as found in @code{<signal.h>}.
     456
     457If the supplied signal number is within the valid range of indices for
     458symbolic names, but no name is available for the particular signal
     459number, then returns the string @samp{Signal @var{num}}, where
     460@var{num} is the signal number.
     461
     462If the supplied signal number is not within the range of valid
     463indices, then returns @code{NULL}.
     464
     465The contents of the location pointed to are only guaranteed to be
     466valid until the next call to @code{strsigno}.
     467
     468@end deftypefn
    487469
    488470*/
     
    523505/*
    524506
    525 NAME
    526 
    527         strtosigno -- map a symbolic signal name to a numeric value
    528 
    529 SYNOPSIS
    530 
    531         int strtosigno (char *name)
    532 
    533 DESCRIPTION
    534 
    535         Given the symbolic name of a signal, map it to a signal number.
    536         If no translation is found, returns 0.
     507@deftypefn Extension int strtosigno (const char *@var{name})
     508
     509Given the symbolic name of a signal, map it to a signal number.  If no
     510translation is found, returns 0.
     511
     512@end deftypefn
    537513
    538514*/
     
    569545/*
    570546
    571 NAME
    572 
    573         psignal -- print message about signal to stderr
    574 
    575 SYNOPSIS
    576 
    577         void psignal (unsigned signo, char *message);
    578 
    579 DESCRIPTION
    580 
    581         Print to the standard error the message, followed by a colon,
    582         followed by the description of the signal specified by signo,
    583         followed by a newline.
     547@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
     548
     549Print @var{message} to the standard error, followed by a colon,
     550followed by the description of the signal specified by @var{signo},
     551followed by a newline.
     552
     553@end deftypefn
     554
    584555*/
    585556
Note: See TracChangeset for help on using the changeset viewer.