OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / fmtmsg.3
1 .\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"  Distributed under GPL
3 .\"  adapted glibc info page
4 .\"
5 .\"  This should run as 'Guru Meditation' (amiga joke :)
6 .\"  The function is quite complex and deserves an example
7 .\"
8 .\"  Polished, aeb, 2003-11-01
9 .\"
10 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
11 .\"         all rights reserved.
12 .\" Translated Sat Jul 24 20:19:54 JST 2004
13 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
14 .\"
15 .TH FMTMSG 3 2008-06-14 "" "Linux Programmer's Manual"
16 .\"O .SH NAME
17 .SH Ì¾Á°
18 .\"O fmtmsg \- print formatted error messages
19 fmtmsg \- À°·Á¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë
20 .\"O .SH SYNOPSIS
21 .SH ½ñ¼°
22 .nf
23 .B #include <fmtmsg.h>
24 .sp
25 .BI "int fmtmsg(long " classification ", const char *" label ,
26 .br
27 .BI "           int " severity ", const char *" text ,
28 .br
29 .BI "           const char *" action ", const char *" tag );
30 .fi
31 .\"O .SH DESCRIPTION
32 .SH ÀâÌÀ
33 .\"O This function displays a message described by its arguments on the device(s)
34 .\"O specified in the
35 .\"O .I classification
36 .\"O argument.
37 .\"O For messages written to
38 .\"O .IR stderr ,
39 .\"O the format depends on the
40 .\"O .B MSGVERB
41 .\"O environment variable.
42 ¤³¤Î´Ø¿ô¤Ï¡¢°ú¤­¿ô¤Çµ­½Ò¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤ò¡¢
43 .I classification
44 °ú¤­¿ô¤Ç»ØÄꤵ¤ì¤¿¥Ç¥Ð¥¤¥¹¾å¤Ëɽ¼¨¤¹¤ë¡£
45 .I stderr
46 ¤Ë½ñ¤­½Ð¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢
47 .B MSGVERB
48 ´Ä¶­ÊÑ¿ô¤Ë°Í¸¤¹¤ë¡£
49 .LP
50 .\"O The
51 .\"O .I label
52 .\"O argument identifies the source of the message.
53 .\"O The string must consist
54 .\"O of two colon separated parts where the first part has not more
55 .\"O than 10 and the second part not more than 14 characters.
56 .I label
57 °ú¤­¿ô¤Ï¥á¥Ã¥»¡¼¥¸¤ÎȯÀ¸¸»¤ò¼±Ê̤¹¤ë¡£
58 ¤³¤Îʸ»úÎó¤Ï¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿ 2 ¤Ä¤ÎÉôʬ¤«¤é¹½À®¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
59 1 ¤ÄÌܤÎÉôʬ¤Ï 10 Ê¸»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢
60 2 ¤ÄÌܤÎÉôʬ¤Ï 14 Ê¸»ú°ÊÆâ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
61 .LP
62 .\"O The
63 .\"O .I text
64 .\"O argument describes the condition of the error.
65 .I text
66 °ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¾ò·ï¤òµ­½Ò¤¹¤ë¡£
67 .LP
68 .\"O The
69 .\"O .I action
70 .\"O argument describes possible steps to recover from the error.
71 .\"O If it is printed, it is prefixed by "TO FIX: ".
72 .I action
73 °ú¤­¿ô¤Ë¤Ï¥¨¥é¡¼¤«¤é²óÉü¤¹¤ë¤¿¤á¤ËÍøÍѲÄǽ¤Ê¥¹¥Æ¥Ã¥×¤òµ­½Ò¤¹¤ë¡£
74 ¤³¤ì¤¬É½¼¨¤µ¤ì¤ë¾ì¹ç¡¢"TO FIX: " ¤¬Á°¤ËÉÕ¤¯¡£
75 .LP
76 .\"O The
77 .\"O .I tag
78 .\"O argument is a reference to the online documentation where more
79 .\"O information can be found.
80 .\"O It should contain the
81 .\"O .I label
82 .\"O value and a unique identification number.
83 .I tag
84 °ú¤­¿ô¤Ï¤è¤ê¿¤¯¤Î¾ðÊó¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¥ª¥ó¥é¥¤¥ó¥É¥­¥å¥á¥ó¥È¤Ø¤Î»²¾È¤Ç¤¢¤ë¡£
85 ¤³¤ì¤Ï
86 .I label
87 Ãͤȥæ¥Ë¡¼¥¯¤Ê¼±ÊÌÈÖ¹æ¤ò´Þ¤ó¤Ç¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£
88 .\"O .SS "Dummy arguments"
89 .SS ¥À¥ß¡¼°ú¤­¿ô
90 .\"O Each of the arguments can have a dummy value.
91 .\"O The dummy classification value
92 .\"O .B MM_NULLMC
93 .\"O (0L) does not specify any output, so nothing is printed.
94 ³Æ°ú¤­¿ô¤Ë¤Ï¥À¥ß¡¼¤ÎÃͤòÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
95 ¥À¥ß¡¼¤Î
96 .I classification
97 ÃÍ
98 .B MM_NULLMC
99 (0L) ¤Ï½ÐÎϤò²¿¤â»ØÄꤷ¤Ê¤¤¡£¤½¤Î¤¿¤á²¿¤âɽ¼¨¤µ¤ì¤Ê¤¤¡£
100 .\"O The dummy severity value
101 .\"O .B NO_SEV
102 .\"O (0) says that no severity is supplied.
103 ¥À¥ß¡¼¤Î
104 .I severity
105 ÃÍ
106 .B NO_SEV
107 (0) ¤Ï½ÅÂçÅÙ (severity) ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤òɽ¤¹¡£
108 .\"O The values
109 .\"O .BR MM_NULLLBL ,
110 .\"O .BR MM_NULLTXT ,
111 .\"O .BR MM_NULLACT ,
112 .\"O .B MM_NULLTAG
113 .\"O are synonyms for
114 .\"O .IR "((char *) 0)" ,
115 .\"O the empty string, and
116 .\"O .B MM_NULLSEV
117 .\"O is a synonym for
118 .\"O .BR NO_SEV .
119 ÃÍ
120 .BR MM_NULLLBL ,
121 .BR MM_NULLTXT ,
122 .BR MM_NULLACT ,
123 .B MM_NULLTAG
124 ¤Ï
125 .I "((char *) 0)"
126 ¤È¶õʸ»úÎó¤ÎÊÌ̾¤Ç¤¢¤ê¡¢
127 .B MM_NULLSEV
128 ¤Ï
129 .B NO_SEV
130 ¤ÎÊÌ̾¤Ç¤¢¤ë¡£
131 .\"O .SS "The classification argument"
132 .SS "classification °ú¤­¿ô"
133 .\"O The
134 .\"O .I classification
135 .\"O argument is the sum of values describing 4 types of information.
136 .I classification
137 °ú¤­¿ô¤Ï 4 ¼ïÎà¤Î¾ðÊó¤òµ­½Ò¤¹¤ëÃͤÎϤǤ¢¤ë¡£
138 .br
139 .sp
140 .\"O The first value defines the output channel.
141 ºÇ½é¤ÎÃͤϽÐÎÏ¥Á¥ã¥ó¥Í¥ë¤òÄêµÁ¤¹¤ë¡£
142 .TP 12n
143 .B MM_PRINT
144 .\"O Output to
145 .\"O .IR stderr .
146 .I stderr
147 ¤Ë½ÐÎϤ¹¤ë¡£
148 .TP
149 .B MM_CONSOLE
150 .\"O Output to the system console.
151 ¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë½ÐÎϤ¹¤ë¡£
152 .TP
153 .B "MM_PRINT | MM_CONSOLE"
154 .\"O Output to both.
155 ξÊý¤Ë½ÐÎϤ¹¤ë¡£
156 .PP
157 .\"O The second value is the source of the error:
158 2 ÈÖÌܤÎÃͤϥ¨¥é¡¼¤ÎȯÀ¸¸»¤Ç¤¢¤ë:
159 .TP 12n
160 .B MM_HARD
161 .\"O A hardware error occurred.
162 ¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
163 .TP
164 .B MM_FIRM
165 .\"O A firmware error occurred.
166 ¥Õ¥¡¡¼¥à¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
167 .TP
168 .B MM_SOFT
169 .\"O A software error occurred.
170 ¥½¥Õ¥È¥¦¥§¥¢¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
171 .PP
172 .\"O The third value encodes the detector of the problem:
173 3 ÈÖÌܤÎÃͤÏÌäÂê¤Î¸¡ÃΤò¹Ô¤Ã¤¿¤â¤Î¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë:
174 .TP 12n
175 .B MM_APPL
176 .\"O It is detected by an application.
177 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£
178 .TP
179 .B MM_UTIL
180 .\"O It is detected by a utility.
181 ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£
182 .TP
183 .B MM_OPSYS
184 .\"O It is detected by the operating system.
185 ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¸¡ÃΤµ¤ì¤¿¡£
186 .PP
187 .\"O The fourth value shows the severity of the incident:
188 4 ÈÖÌܤÎÃͤÏÌäÂê¤Î½ÅÂçÅÙ¤òɽ¤¹:
189 .TP 12n
190 .B MM_RECOVER
191 .\"O It is a recoverable error.
192 ²óÉü²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£
193 .TP
194 .B MM_NRECOV
195 .\"O It is a nonrecoverable error.
196 ²óÉüÉÔ²Äǽ¤Ê¥¨¥é¡¼¤Ç¤¢¤ë¡£
197 .\"O .SS "The severity argument"
198 .SS "severity °ú¤­¿ô"
199 .\"O The
200 .\"O .I severity
201 .\"O argument can take one of the following values:
202 .I severity
203 °ú¤­¿ô¤Ï°Ê²¼¤Î 1 ¤Ä¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
204 .TP 12n
205 .B MM_NOSEV
206 .\"O No severity is printed.
207 ½ÅÂçÅÙ¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£
208 .TP
209 .B MM_HALT
210 .\"O This value is printed as HALT.
211 ¤³¤ÎÃͤϠHALT ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£
212 .TP
213 .B MM_ERROR
214 .\"O This value is printed as ERROR.
215 ¤³¤ÎÃͤϠERROR ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£
216 .TP
217 .B MM_WARNING
218 .\"O This value is printed as WARNING.
219 ¤³¤ÎÃͤϠWARNING ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£
220 .TP
221 .B MM_INFO
222 .\"O This value is printed as INFO.
223 ¤³¤ÎÃͤϠINFO ¤È¤·¤Æɽ¼¨¤µ¤ì¤ë¡£
224 .PP
225 .\"O The numeric values are between 0 and 4.
226 .\"O Using
227 .\"O .BR addseverity (3)
228 .\"O or the environment variable
229 .\"O .B SEV_LEVEL
230 .\"O you can add more levels and strings to print.
231 ¿ôÃͤξì¹ç¤Ï 0 ¤«¤é 4 ¤Ç¤¢¤ë¡£
232 .BR addseverity (3)
233 ¤Þ¤¿¤Ï´Ä¶­ÊÑ¿ô
234 .B SEV_LEVEL
235 ¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢É½¼¨¤¹¤ë¥ì¥Ù¥ë¤Èʸ»úÎó¤ò¹¹¤ËÄɲäǤ­¤ë¡£
236 .\"O .SH "RETURN VALUE"
237 .SH ÊÖ¤êÃÍ
238 .\"O The function can return 4 values:
239 ´Ø¿ô¤Ï 4 ¤Ä¤ÎÃͤòÊÖ¤¹:
240 .TP 12n
241 .B MM_OK
242 .\"O Everything went smooth.
243 Á´¤Æ¤¬¤¦¤Þ¤¯¤¤¤Ã¤¿¡£
244 .TP
245 .B MM_NOTOK
246 .\"O Complete failure.
247 ´°Á´¤Ë¼ºÇÔ¤·¤¿¡£
248 .TP
249 .B MM_NOMSG
250 .\"O Error writing to
251 .\"O .IR stderr .
252 .I stderr
253 ¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
254 .TP
255 .B MM_NOCON
256 .\"O Error writing to the console.
257 ¥³¥ó¥½¡¼¥ë¤Ë½ñ¤­¹þ¤à¤È¤­¤Ë¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¡£
258 .\"O .SH ENVIRONMENT
259 .SH ´Ä¶­ÊÑ¿ô
260 .\"O The environment variable
261 .\"O .B MSGVERB
262 .\"O ("message verbosity") can be used to suppress parts of
263 .\"O the output to
264 .\"O .IR stderr .
265 ´Ä¶­ÊÑ¿ô
266 .B MSGVERB
267 ("message verbosity") ¤Ï
268 .I stderr
269 ¤Ø¤Î½ÐÎϤΰìÉô¤òÍÞÀ©¤¹¤ë¤Î¤Ë»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
270 .\"O (It does not influence output to the console.)
271 (¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤˤϱƶÁ¤·¤Ê¤¤¡£)
272 .\"O When this variable is defined, is non-NULL, and is a colon-separated
273 .\"O list of valid keywords, then only the parts of the message corresponding
274 .\"O to these keywords is printed.
275 ¤³¤ÎÊÑ¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¡¢NULL ¤Ç¤Ê¤¯¡¢
276 ¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Î¥ê¥¹¥È¤Ç¤¢¤ë¾ì¹ç¡¢
277 ¥­¡¼¥ï¡¼¥É¤ËÂбþ¤¹¤ë¥á¥Ã¥»¡¼¥¸¤Î°ìÉô¤Î¤ß¤¬É½¼¨¤µ¤ì¤ë¡£
278 .\"O Valid keywords are "label", "severity", "text", "action" and "tag".
279 Í­¸ú¤Ê¥­¡¼¥ï¡¼¥É¤Ï "label", "severity", "text", "action", "tag" ¤Ç¤¢¤ë¡£
280 .PP
281 .\"O The environment variable
282 .\"O .B SEV_LEVEL
283 .\"O can be used to introduce new severity levels.
284 ´Ä¶­ÊÑ¿ô
285 .B SEV_LEVEL
286 ¤Ï¿·¤·¤¤½ÅÂçÅÙ¥ì¥Ù¥ë¤òƳÆþ¤¹¤ë¤Î¤Ë»ÈÍѤǤ­¤ë¡£
287 .\"O By default, only the five severity levels described
288 .\"O above are available.
289 .\"O Any other numeric value would make
290 .\"O .BR fmtmsg ()
291 .\"O print nothing.
292 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¾åµ­¤Î 5 ¤Ä¤Î½ÅÂçÅÙ¥ì¥Ù¥ë¤Î¤ß¤¬ÍøÍѲÄǽ¤Ç¤¢¤ë¡£
293 ¾¤Î¿ôÃͤξì¹ç¡¢
294 .BR fmtmsg ()
295 ¤Ï²¿¤âɽ¼¨¤·¤Ê¤¤¡£
296 .\"O If the user puts
297 .\"O .B SEV_LEVEL
298 .\"O with a format like
299 .\"O .sp
300 .\"O .RS
301 .\"O SEV_LEVEL=[description[:description[:...]]]
302 .\"O .RE
303 .\"O .sp
304 .\"O in the environment of the process before the first call to
305 .\"O .BR fmtmsg (),
306 .\"O where each description is of the form
307 .\"O .sp
308 .\"O .RS
309 .\"O severity-keyword,level,printstring
310 .\"O .RE
311 .\"O .sp
312 .\"O then
313 .\"O .BR fmtmsg ()
314 .\"O will also accept the indicated values for the level (in addition to
315 .\"O the standard levels 0-4), and use the indicated printstring when
316 .\"O such a level occurs.
317 .BR fmtmsg ()
318 ¤ò½é¤á¤Æ¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢¥æ¡¼¥¶¤¬
319 .B SEV_LEVEL
320 ¤ò
321 .sp
322 .RS
323 SEV_LEVEL=[description[:description[:...]]]
324 .RE
325 .sp
326 ¤Î¤è¤¦¤Ê·Á¼°¤Ç¥×¥í¥»¥¹¤Î´Ä¶­¤ËÀßÄꤹ¤ë¤È¡¢
327 .BR fmtmsg ()
328 ¤Ï (ɸ½à¤Î¥ì¥Ù¥ë 0-4 ¤Ë²Ã¤¨¤Æ) level ¤Ë»ØÄꤵ¤ì¤¿Ãͤâ¼õ¤±ÉÕ¤±¡¢
329 ¤½¤Î¤è¤¦¤Ê¥ì¥Ù¥ë¤ÎÌäÂ꤬ȯÀ¸¤¹¤ë¤È»ØÄꤵ¤ì¤¿ printstring ¤òɽ¼¨¤¹¤ë¡£
330 ³Æ description ¤Ï
331 .sp
332 .RS
333 severity-keyword,level,printstring
334 .RE
335 .sp
336 ¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£
337 .LP
338 .\"O The severity-keyword part is not used by
339 .\"O .BR fmtmsg ()
340 .\"O but it has to be present.
341 severity-keyword Éô¤Ï
342 .BR fmtmsg ()
343 ¤Ë»ÈÍѤµ¤ì¤Ê¤¤¤¬¡¢Â¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
344 .\"O The level part is a string representation of a number.
345 level Éô¤Ï¿ôÃͤòʸ»úÎó¤Çɽ¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
346 .\"O The numeric value must be a number greater than 4.
347 ¿ôÃͤϠ4 ¤è¤êÂ礭¤¤ÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
348 .\"O This value must be used in the severity argument of
349 .\"O .BR fmtmsg ()
350 .\"O to select this class.
351 .\"O It is not possible to overwrite
352 .\"O any of the predefined classes.
353 .\"O The printstring
354 .\"O is the string printed when a message of this class is processed by
355 .\"O .BR fmtmsg ().
356 ¤³¤ÎÃͤÏ
357 .BR fmtmsg ()
358 ¤Î severity °ú¤­¿ô¤Ç»ÈÍѤµ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤³¤Î½ÅÂçÅÙ¤òÁªÂò¤¹¤ë¡£
359 Á°¤â¤Ã¤ÆÀë¸À¤µ¤ì¤¿½ÅÂçÅÙ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
360 printstring ¤Ï¡¢
361 ¤³¤Î½ÅÂçÅ٤Υá¥Ã¥»¡¼¥¸¤¬
362 .BR fmtmsg ()
363 ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¾ì¹ç¤Ëɽ¼¨¤µ¤ì¤ëʸ»úÎó¤Ç¤¢¤ë¡£
364 .\"O .SH VERSIONS
365 .SH ¥Ð¡¼¥¸¥ç¥ó
366 .\"O .BR fmtmsg ()
367 .\"O is provided in glibc since version 2.1.
368 .BR fmtmsg ()
369 ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
370 .\"O .SH "CONFORMING TO"
371 .SH ½àµò
372 .\"O The functions
373 .\"O .BR fmtmsg ()
374 .\"O and
375 .\"O .BR addseverity (3),
376 .\"O and environment variables
377 .\"O .B MSGVERB
378 .\"O and
379 .\"O .B SEV_LEVEL
380 .\"O come from System V.
381 ´Ø¿ô
382 .BR fmtmsg ()
383 ¤È
384 .BR addseverity (3)
385 ¤È´Ä¶­ÊÑ¿ô
386 .B MSGVERB
387 ¤È
388 .B SEV_LEVEL
389 ¤Ï System V ¤ËͳÍ褷¤Æ¤¤¤ë¡£
390 .\"O The function
391 .\"O .BR fmtmsg ()
392 .\"O and the environment variable
393 .\"O .B MSGVERB
394 .\"O are described in POSIX.1-2001.
395 ´Ø¿ô
396 .BR fmtmsg ()
397 ¤È´Ä¶­ÊÑ¿ô
398 .B MSGVERB
399 ¤Ï POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£
400 .\"O .SH NOTES
401 .SH Ãí°Õ
402 .\"O System V and UnixWare man pages tell us that these functions
403 .\"O have been replaced by "pfmt() and addsev()" or by "pfmt(),
404 .\"O vpfmt(), lfmt(), and vlfmt()", and will be removed later.
405 System V ¤È UnixWare ¤Î man ¥Ú¡¼¥¸¤Ë¤Ï¡¢
406 ¡Ö¤³¤ì¤é¤Î´Ø¿ô¤Ï "pfmt() ¤È addsev()"
407 ¤Þ¤¿¤Ï "pfmt(), vpfmt(), lfmt(), vlfmt()" ¤ÇÃÖ¤­´¹¤¨¤é¤ì¤Æ¤ª¤ê¡¢
408 ¾­Íè¤Ïºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¢¤ë¡×¤È½ñ¤«¤ì¤Æ¤¤¤ë¡£
409 .\"O .SH EXAMPLE
410 .SH Îã
411 .nf
412 #include <stdio.h>
413 #include <stdlib.h>
414 #include <fmtmsg.h>
415
416 int
417 main(void)
418 {
419     long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;
420     int err;
421
422     err = fmtmsg(class, "util\-linux:mount", MM_ERROR,
423                 "unknown mount option", "See mount(8).",
424                 "util\-linux:mount:017");
425     switch (err) {
426     case MM_OK:
427       break;
428     case MM_NOTOK:
429         printf("Nothing printed\en");
430         break;
431     case MM_NOMSG:
432         printf("Nothing printed to stderr\en");
433         break;
434     case MM_NOCON:
435         printf("No console output\en");
436         break;
437     default:
438         printf("Unknown error from fmtmsg()\en");
439     }
440     exit(EXIT_SUCCESS);
441 }
442 .fi
443 .PP
444 .\"O The output should be:
445 ½ÐÎϤÏ
446 .nf
447
448     util\-linux:mount: ERROR: unknown mount option
449     TO FIX: See mount(8).  util\-linux:mount:017
450
451 .fi
452 .\"O and after
453 ¤Î¤è¤¦¤Ë¤Ê¤ê¡¢
454 .nf
455
456     MSGVERB=text:action; export MSGVERB
457
458 .fi
459 .\"O the output becomes:
460 ¤ò¼Â¹Ô¤·¤¿¸å¤Ç¤Ï
461 .nf
462
463     unknown mount option
464     TO FIX: See mount(8).
465
466 .fi
467 ¤È¤Ê¤ë¡£
468 .\"O .SH "SEE ALSO"
469 .SH ´ØÏ¢¹àÌÜ
470 .BR addseverity (3),
471 .BR perror (3)