man-pages/man3/addseverity.3

69 lines
1.6 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\" adapted glibc info page
.\"
.\" polished a little, aeb
2008-06-11 13:43:34 +00:00
.TH ADDSEVERITY 3 2008-06-14 "GNU" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
addseverity \- introduce new severity classes
.SH SYNOPSIS
.nf
.sp
.B #include <fmtmsg.h>
.sp
.BI "int addseverity(int " severity ", const char *" s );
.fi
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.BR addseverity ():
_SVID_SOURCE
2004-11-03 13:51:07 +00:00
.SH DESCRIPTION
This function allows the introduction of new severity classes
which can be addressed by the
.I severity
argument of the
2004-11-03 13:51:07 +00:00
.BR fmtmsg (3)
function.
By default that latter function only knows how to
2004-11-03 13:51:07 +00:00
print messages for severity 0-4 (with strings (none), HALT,
ERROR, WARNING, INFO).
This call attaches the given string
2004-11-03 13:51:07 +00:00
.I s
to the given value
.IR severity .
If
.I s
is NULL, the severity class with the numeric value
.I severity
is removed.
It is not possible to overwrite or remove one of the default
severity classes.
2007-04-24 19:11:01 +00:00
The severity value must be non-negative.
2004-11-03 13:51:07 +00:00
.SH "RETURN VALUE"
Upon success, the value
.B MM_OK
is returned.
Upon error, the return value is
2004-11-03 13:51:07 +00:00
.BR MM_NOTOK .
Possible errors include: out of memory, attempt to remove a
nonexistent or default severity class.
2008-06-11 13:43:34 +00:00
.SH VERSIONS
.BR addseverity ()
is provided in glibc since version 2.1.
2004-11-03 13:51:07 +00:00
.SH "CONFORMING TO"
This function is not specified in the X/Open Portability Guide
although the
.BR fmtmsg (3)
function is.
It is available on System V
2004-11-03 13:51:07 +00:00
systems.
.SH NOTES
New severity classes can also be added by setting the environment variable
.BR SEV_LEVEL .
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
.BR fmtmsg (3)