Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/fmtmsg.h
+++ new/usr/src/head/fmtmsg.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /* Copyright (c) 1988 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25
26 26 /*
27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 + *
27 29 * Copyright 1996-2003 Sun Microsystems, Inc. All rights reserved.
28 30 * Use is subject to license terms.
29 31 */
30 32
31 33 #ifndef _FMTMSG_H
32 34 #define _FMTMSG_H
33 35
34 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
35 -
36 36 #include <sys/feature_tests.h>
37 37
38 38 #ifdef __cplusplus
39 39 extern "C" {
40 40 #endif
41 41
42 42 /*
43 43 * fmtmsg.h
44 44 *
45 45 * The <fmtmsg.h> header file contains the definitions needed
46 46 * to use the fmtmsg() function. This function writes messages
47 47 * in a standard format to the standard error stream (stderr)
48 48 * and to the system console.
49 49 */
50 50
51 51 /*
52 52 * Define the value "NULL" if it hasn't been defined already.
53 53 * NULL breaks namespace so we define _NULL
54 54 */
55 55 #if defined(_LP64)
56 56 #define _NULL 0L
57 57 #else
58 58 #define _NULL 0
59 59 #endif
60 60
61 61 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
62 62 #ifndef NULL
63 63 #define NULL _NULL
64 64 #endif
65 65 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
66 66
67 67
68 68 /*
69 69 * Constraint definitions:
70 70 * MM_MXLABELLN Maximum size of a "label" in a message
71 71 * MM_MXTAGLN Maximum size of a "tag" in a message
72 72 * MM_MXTXTLN Maximum size of a text string
73 73 * MM_MXACTLN Maximum size of an action string
74 74 */
75 75
76 76 #define MM_MXLABELLN 25
77 77 #define MM_MXTAGLN 32
78 78 #define MM_MXTXTLN 512
79 79 #define MM_MXACTLN 512
80 80
81 81 /*
82 82 * Environment variable names used by fmtmsg():
83 83 * MSGVERB Tells fmtmsg() which components it is to write
84 84 * to the standard error stream
85 85 */
86 86
87 87 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
88 88 #define MSGVERB "MSGVERB"
89 89 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
90 90
91 91 /*
92 92 * Classification information
93 93 * - Definition of classifications
94 94 * - Definition of recoverability
95 95 * - Definition of source classifications
96 96 */
97 97
98 98 /*
99 99 * Definition of the "null" classification
100 100 * MM_NULL Indicates that the classification has been omitted
101 101 */
102 102
103 103 #define MM_NULL 0L
104 104
105 105 /*
106 106 * Definitions of type classifications:
107 107 * MM_HARD Hardware
108 108 * MM_SOFT Software
109 109 * MM_FIRM Firmware
110 110 */
111 111
112 112 #define MM_HARD 0x00000001L
113 113 #define MM_SOFT 0x00000002L
114 114 #define MM_FIRM 0x00000004L
115 115
116 116 /*
117 117 * Definitions of recoverability subclassification
118 118 * MM_RECOVER Recoverable
119 119 * MM_NRECOV Non-recoverable
120 120 */
121 121
122 122 #define MM_RECOVER 0x00000100L
123 123 #define MM_NRECOV 0x00000200L
124 124
125 125 /*
126 126 * Definitions of source subclassification
127 127 * MM_APPL Application
128 128 * MM_UTIL Utility
129 129 * MM_OPSYS Kernel
130 130 */
131 131
132 132 #define MM_APPL 0x00000008L
133 133 #define MM_UTIL 0x00000010L
134 134 #define MM_OPSYS 0x00000020L
135 135
136 136 /*
137 137 * Definitions for the action to take with the message:
138 138 * MM_PRINT Write to the standard error stream
139 139 * MM_CONSOLE Treat the message as a console message
140 140 */
141 141
142 142 #define MM_PRINT 0x00000040L
143 143 #define MM_CONSOLE 0x00000080L
144 144
145 145 /*
146 146 * Constants for severity values
147 147 *
148 148 * SEV_LEVEL Names the env variable that defines severities
149 149 *
150 150 * MM_NOSEV Message has no severity
151 151 * MM_HALT Message describes a severe error condition
152 152 * MM_ERROR Message describes an error condition
153 153 * MM_WARNING Message tells of probable error condition
154 154 * MM_INFO Message informs, not in error
155 155 */
156 156
157 157 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
158 158 #define SEV_LEVEL "SEV_LEVEL"
159 159 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
160 160
161 161 #define MM_NOSEV 0
162 162 #define MM_HALT 1
163 163 #define MM_ERROR 2
164 164 #define MM_WARNING 3
165 165 #define MM_INFO 4
166 166
167 167 /*
168 168 * Null values for message components
169 169 * MM_NULLLBL Null value for the label-component
170 170 * MM_NULLSEV Null value for the severity-component
171 171 * MM_NULLMC Null value for the classification-component
172 172 * MM_NULLTXT Null value for the text-component
173 173 * MM_NULLACT Null value for the action-component
174 174 * MM_NULLTAG Null value for the tag-component
175 175 */
176 176
177 177 #define MM_NULLLBL ((char *)_NULL)
178 178 #define MM_NULLSEV MM_NOSEV
179 179 #define MM_NULLMC MM_NULL
180 180 #define MM_NULLTXT ((char *)_NULL)
181 181 #define MM_NULLACT ((char *)_NULL)
182 182 #define MM_NULLTAG ((char *)_NULL)
183 183
184 184 /*
185 185 * Values returned by fmtmsg()
186 186 *
187 187 * MM_NOTOK None of the requested messages were generated
188 188 * MM_NOMSG No message was written to stderr
189 189 * MM_NOCON No console message was generated
↓ open down ↓ |
144 lines elided |
↑ open up ↑ |
190 190 */
191 191
192 192 #define MM_NOTOK -1
193 193 #define MM_OK 0x00
194 194 #define MM_NOMSG 0x01
195 195 #define MM_NOCON 0x04
196 196
197 197 /* Function definition */
198 198
199 199 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
200 -#if defined(__STDC__)
201 200 int addseverity(int, const char *);
202 -#else /* __STDC__ */
203 -int addseverity();
204 -#endif /* __STDC__ */
205 201 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
206 202
207 -#if defined(__STDC__)
208 203 int fmtmsg(long, const char *, int, const char *, const char *,
209 204 const char *);
210 -#else /* __STDC__ */
211 -int fmtmsg();
212 -#endif /* __STDC__ */
213 205
214 206 #ifdef __cplusplus
215 207 }
216 208 #endif
217 209
218 210 #endif /* _FMTMSG_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX