Back to index

glibc  2.9
fmtmsg.h
Go to the documentation of this file.
00001 /* Message display handling.
00002    Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef __FMTMSG_H
00021 #define __FMTMSG_H   1
00022 
00023 #include <features.h>
00024 
00025 
00026 __BEGIN_DECLS
00027 
00028 /* Values to control `fmtmsg' function.  */
00029 enum
00030 {
00031   MM_HARD = 0x001,   /* Source of the condition is hardware.  */
00032 #define MM_HARD MM_HARD
00033   MM_SOFT = 0x002,   /* Source of the condition is software.  */
00034 #define MM_SOFT MM_SOFT
00035   MM_FIRM = 0x004,   /* Source of the condition is firmware.  */
00036 #define MM_FIRM MM_FIRM
00037   MM_APPL = 0x008,   /* Condition detected by application.  */
00038 #define MM_APPL MM_APPL
00039   MM_UTIL = 0x010,   /* Condition detected by utility.  */
00040 #define MM_UTIL MM_UTIL
00041   MM_OPSYS = 0x020,  /* Condition detected by operating system.  */
00042 #define MM_OPSYS MM_OPSYS
00043   MM_RECOVER = 0x040,       /* Recoverable error.  */
00044 #define MM_RECOVER MM_RECOVER
00045   MM_NRECOV = 0x080, /* Non-recoverable error.  */
00046 #define MM_NRECOV MM_NRECOV
00047   MM_PRINT = 0x100,  /* Display message in standard error.  */
00048 #define MM_PRINT MM_PRINT
00049   MM_CONSOLE = 0x200 /* Display message on system console.  */
00050 #define MM_CONSOLE MM_CONSOLE
00051 };
00052 
00053 /* Values to be for SEVERITY parameter of `fmtmsg'.  */
00054 enum
00055 {
00056   MM_NOSEV = 0,             /* No severity level provided for the message.  */
00057 #define MM_NOSEV MM_NOSEV
00058   MM_HALT,           /* Error causing application to halt.  */
00059 #define MM_HALT MM_HALT
00060   MM_ERROR,          /* Application has encountered a non-fatal fault.  */
00061 #define MM_ERROR MM_ERROR
00062   MM_WARNING,        /* Application has detected unusual non-error
00063                         condition.  */
00064 #define MM_WARNING MM_WARNING
00065   MM_INFO            /* Informative message.  */
00066 #define MM_INFO MM_INFO
00067 };
00068 
00069 
00070 /* Macros which can be used as null values for the arguments of `fmtmsg'.  */
00071 #define MM_NULLLBL   ((char *) 0)
00072 #define MM_NULLSEV   0
00073 #define MM_NULLMC    ((long int) 0)
00074 #define MM_NULLTXT   ((char *) 0)
00075 #define MM_NULLACT   ((char *) 0)
00076 #define MM_NULLTAG   ((char *) 0)
00077 
00078 
00079 /* Possible return values of `fmtmsg'.  */
00080 enum
00081 {
00082   MM_NOTOK = -1,
00083 #define MM_NOTOK MM_NOTOK
00084   MM_OK = 0,
00085 #define MM_OK MM_OK
00086   MM_NOMSG = 1,
00087 #define MM_NOMSG MM_NOMSG
00088   MM_NOCON = 4
00089 #define MM_NOCON MM_NOCON
00090 };
00091 
00092 
00093 /* Print message with given CLASSIFICATION, LABEL, SEVERITY, TEXT, ACTION
00094    and TAG to console or standard error.  */
00095 extern int fmtmsg (long int __classification, __const char *__label,
00096                  int __severity, __const char *__text,
00097                  __const char *__action, __const char *__tag);
00098 
00099 #ifdef __USE_SVID
00100 /* Add or remove severity level.  */
00101 extern int addseverity (int __severity, __const char *__string) __THROW;
00102 #endif
00103 
00104 __END_DECLS
00105 
00106 #endif /* fmtmsg.h */