GNU Info

Info Node: (libc.info)Adding Severity Classes

(libc.info)Adding Severity Classes


Next: Example Prev: Printing Formatted Messages Up: Formatted Messages
Enter node , (file) or (file)node

Adding Severity Classes
-----------------------

   There is another possibility to introduce severity classes besides
using the environment variable `SEV_LEVEL'.  This simplifies the task of
introducing new classes in a running program.  One could use the
`setenv' or `putenv' function to set the environment variable, but this
is toilsome.

 - Function: int addseverity (int SEVERITY, const char *STRING)
     This function allows the introduction of new severity classes
     which can be addressed by the SEVERITY parameter of the `fmtmsg'
     function.  The SEVERITY parameter of `addseverity' must match the
     value for the parameter with the same name of `fmtmsg', and STRING
     is the string printed in the actual messages instead of the numeric
     value.

     If STRING is `NULL' the severity class with the numeric value
     according to SEVERITY is removed.

     It is not possible to overwrite or remove one of the default
     severity classes.  All calls to `addseverity' with SEVERITY set to
     one of the values for the default classes will fail.

     The return value is `MM_OK' if the task was successfully performed.
     If the return value is `MM_NOTOK' something went wrong.  This could
     mean that no more memory is available or a class is not available
     when it has to be removed.

     This function is not specified in the X/Open Portability Guide
     although the `fmtsmg' function is.  It is available on System V
     systems.


automatically generated by info2www version 1.2.2.9