addseverity(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

addseverity(3c)

addseverity(3C)          Standard C Library Functions          addseverity(3C)

NAME
       addseverity  -  build  a list of severity levels for an application for
       use with fmtmsg

SYNOPSIS
       #include <fmtmsg.h>

       int addseverity(int severity, const char *string);

DESCRIPTION
       The addseverity() function builds a list of severity levels for an  ap‐
       plication to be used with the message formatting facility fmtmsg(). The
       severity argument is an integer value indicating the seriousness of the
       condition.  The string argument is a pointer to a string describing the
       condition (string is not limited to a specific size).


       If addseverity() is called with an integer value that has not been pre‐
       viously defined, the function adds that new severity  value  and  print
       string to the existing set of standard severity levels.


       If  addseverity()  is called with an integer value that has been previ‐
       ously defined, the function redefines that value  with  the  new  print
       string.  Previously defined severity levels may be removed by supplying
       the null string. If addseverity() is called with a negative  number  or
       an  integer  value  of 0, 1, 2, 3, or 4, the function fails and returns
       −1. The values 0−4 are reserved for the standard  severity  levels  and
       cannot  be  modified.  Identifiers  for the standard levels of severity
       are:

       MM_HALT       Indicates that the application has encountered  a  severe
                     fault and is halting. Produces the print string HALT.


       MM_ERROR      Indicates that the application has detected a fault. Pro‐
                     duces the print string ERROR.


       MM_WARNING    Indicates  a  condition that is out of the ordinary, that
                     might be a problem, and should be watched.  Produces  the
                     print string WARNING.


       MM_INFO       Provides information about a condition that is not in er‐
                     ror. Produces the print string INFO.


       MM_NOSEV      Indicates that no severity level is supplied for the mes‐
                     sage.



       Severity  levels may also be defined at runtime using the SEV_LEVEL en‐
       vironment variable (see fmtmsg(3C)).

RETURN VALUES
       Upon successful completion, addseverity() returns MM_OK.  Otherwise  it
       returns MM_NOTOK.

EXAMPLES
       Example 1 Example of addseverity() function.




       When the function call


         addseverity(7,"ALERT")




       is followed by the call


         fmtmsg(MM_PRINT, "UX:cat", 7, "invalid syntax", "refer to manual",
         "UX:cat:001")




       the resulting output is


         UX:cat: ALERT: invalid syntax
         TO FIX: refer to manual   UX:cat:001


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ MT-LevelSafe


SEE ALSO
       fmtmsg(1), fmtmsg(3C), gettxt(3C), printf(3C), attributes(7)

Oracle Solaris 11.4               11 May 2021                  addseverity(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3