]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdlib/fmtmsg.h
hurd: Fix build
[thirdparty/glibc.git] / stdlib / fmtmsg.h
CommitLineData
0501d603 1/* Message display handling.
688903eb 2 Copyright (C) 1997-2018 Free Software Foundation, Inc.
0501d603
UD
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
0501d603
UD
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 13 Lesser General Public License for more details.
0501d603 14
41bdb6e2 15 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
0501d603
UD
18
19#ifndef __FMTMSG_H
0501d603 20#define __FMTMSG_H 1
5107cf1d 21
0501d603
UD
22#include <features.h>
23
0501d603
UD
24
25__BEGIN_DECLS
26
27/* Values to control `fmtmsg' function. */
28enum
29{
30 MM_HARD = 0x001, /* Source of the condition is hardware. */
31#define MM_HARD MM_HARD
32 MM_SOFT = 0x002, /* Source of the condition is software. */
33#define MM_SOFT MM_SOFT
34 MM_FIRM = 0x004, /* Source of the condition is firmware. */
35#define MM_FIRM MM_FIRM
36 MM_APPL = 0x008, /* Condition detected by application. */
37#define MM_APPL MM_APPL
38 MM_UTIL = 0x010, /* Condition detected by utility. */
39#define MM_UTIL MM_UTIL
40 MM_OPSYS = 0x020, /* Condition detected by operating system. */
41#define MM_OPSYS MM_OPSYS
42 MM_RECOVER = 0x040, /* Recoverable error. */
43#define MM_RECOVER MM_RECOVER
44 MM_NRECOV = 0x080, /* Non-recoverable error. */
45#define MM_NRECOV MM_NRECOV
46 MM_PRINT = 0x100, /* Display message in standard error. */
47#define MM_PRINT MM_PRINT
48 MM_CONSOLE = 0x200 /* Display message on system console. */
49#define MM_CONSOLE MM_CONSOLE
50};
51
52/* Values to be for SEVERITY parameter of `fmtmsg'. */
53enum
54{
55 MM_NOSEV = 0, /* No severity level provided for the message. */
56#define MM_NOSEV MM_NOSEV
57 MM_HALT, /* Error causing application to halt. */
58#define MM_HALT MM_HALT
59 MM_ERROR, /* Application has encountered a non-fatal fault. */
60#define MM_ERROR MM_ERROR
61 MM_WARNING, /* Application has detected unusual non-error
62 condition. */
63#define MM_WARNING MM_WARNING
64 MM_INFO /* Informative message. */
65#define MM_INFO MM_INFO
66};
67
68
69/* Macros which can be used as null values for the arguments of `fmtmsg'. */
fd292f70 70#define MM_NULLLBL ((char *) 0)
0501d603
UD
71#define MM_NULLSEV 0
72#define MM_NULLMC ((long int) 0)
fd292f70
UD
73#define MM_NULLTXT ((char *) 0)
74#define MM_NULLACT ((char *) 0)
75#define MM_NULLTAG ((char *) 0)
0501d603
UD
76
77
78/* Possible return values of `fmtmsg'. */
79enum
80{
81 MM_NOTOK = -1,
82#define MM_NOTOK MM_NOTOK
83 MM_OK = 0,
84#define MM_OK MM_OK
85 MM_NOMSG = 1,
86#define MM_NOMSG MM_NOMSG
87 MM_NOCON = 4
88#define MM_NOCON MM_NOCON
89};
90
91
92/* Print message with given CLASSIFICATION, LABEL, SEVERITY, TEXT, ACTION
93 and TAG to console or standard error. */
a784e502
UD
94extern int fmtmsg (long int __classification, const char *__label,
95 int __severity, const char *__text,
96 const char *__action, const char *__tag);
0501d603 97
498afc54 98#ifdef __USE_MISC
0501d603 99/* Add or remove severity level. */
a784e502 100extern int addseverity (int __severity, const char *__string) __THROW;
b13927da 101#endif
0501d603
UD
102
103__END_DECLS
104
105#endif /* fmtmsg.h */