1 .\" Copyright (C) 2006 Justin Pryzby <pryzbyj@justinpryzby.com>
2 .\" and Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" Permission is hereby granted, free of charge, to any person obtaining
5 .\" a copy of this software and associated documentation files (the
6 .\" "Software"), to deal in the Software without restriction, including
7 .\" without limitation the rights to use, copy, modify, merge, publish,
8 .\" distribute, sublicense, and/or sell copies of the Software, and to
9 .\" permit persons to whom the Software is furnished to do so, subject to
10 .\" the following conditions:
12 .\" The above copyright notice and this permission notice shall be
13 .\" included in all copies or substantial portions of the Software.
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 .\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 .\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 .\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 .\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 .\" glibc manual and source
26 .\" Japanese Version Copyright (c) 2006 Yuichi SATO
27 .\" all rights reserved.
28 .\" Translated 2006-08-04 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.36
30 .TH ERROR 3 2010-08-29 "GNU" "Linux Programmer's Manual"
33 .\"O error, error_at_line, error_message_count, error_on_per_line, \
34 .\"O error_print_progname \- glibc error reporting functions
35 error, error_at_line, error_message_count, error_on_per_line, error_print_progname \- glibc のエラー書き出し関数
41 \fBvoid error(int \fIstatus, \fBint\fI errnum, \
42 \fBconst char *\fIformat, \fB...);
44 \fBvoid error_at_line(int \fIstatus, \fBint \fIerrnum, \
45 \fBconst char *\fIfilename,
46 \fBunsigned int \fIlinenum, \
47 \fBconst char *\fIformat, \fB...);
49 \fBextern unsigned int \fIerror_message_count\fP;
51 \fBextern int \fIerror_one_per_line\fP;
53 \fBextern void (* \fIerror_print_progname\fB) (void);
58 .\"O is a general error-reporting function.
63 .\"O and then outputs to
65 .\"O the program name, a colon and a space, the message specified by the
66 .\"O .BR printf (3)-style
67 .\"O format string \fIformat\fP, and, if \fIerrnum\fP is
68 .\"O nonzero, a second colon and a space followed by the string given by
69 .\"O .IR strerror(errnum) .
75 書き出す内容は、プログラム名・コロン・スペース・
78 フォーマット文字列 \fIformat\fP で指定されたメッセージである。
79 \fIerrnum\fP が 0 以外の場合、2 つ目のコロンとスペースの後に
82 .\"O Any arguments required for
86 .\"O in the argument list.
91 .\"O The output is terminated by a newline character.
94 .\"O The program name printed by
96 .\"O is the value of the global variable
97 .\"O .BR program_invocation_name (3).
100 .BR program_invocation_name (3)
102 .\"O .I program_invocation_name
103 .\"O initially has the same value as
106 .I program_invocation_name
112 .\"O The value of this variable can be modified to change the output of
118 .\"O If \fIstatus\fP has a nonzero value, then
122 .\"O to terminate the program using the given value as the exit status.
123 \fIstatus\fP が 0 以外の場合、
127 を呼び出して、指定された終了ステータスでプログラムを終了させる。
130 .\"O .BR error_at_line ()
131 .\"O function is exactly the same as
133 .\"O except for the addition of the arguments
145 .\"O The output produced is as for
147 .\"O except that after the program name are written: a colon, the value of
149 .\"O a colon, and the value of
152 コロン・\fIfilename\fR の値・コロン・\fIlinenum\fR の値が書き出される以外は、
155 .\"O The preprocessor values \fB__LINE__\fP and
156 .\"O \fB__FILE__\fP may be useful when calling
157 .\"O .BR error_at_line (),
158 .\"O but other values can also be used.
159 .\"O For example, these arguments could refer to a location in an input file.
160 プリプロセッサの値 \fB__LINE__\fP と \fB__FILE__\fP は、
163 その他のプリプロセッサの値も使うことができる。
164 例えば、これらの引き数で入力ファイルにおける位置を参照できる。
166 .\"O If the global variable \fIerror_one_per_line\fP is set nonzero,
168 .\"O .BR error_at_line ()
170 .\"O same value of \fIfilename\fP and \fIlinenum\fP will result in only
171 .\"O one message (the first) being output.
172 大域変数 \fIerror_one_per_line\fP が 0 以外に設定されている場合、
173 \fIfilename\fP と \fIlinenum\fP の値が共に等しい
176 1 つの (最初の) メッセージの出力にまとめられる。
178 .\"O The global variable \fIerror_message_count\fP counts the number of
179 .\"O messages that have been output by
182 .\"O .BR error_at_line ().
183 大域変数 \fIerror_message_count\fP は、
189 .\"O If the global variable \fIerror_print_progname\fP
190 .\"O is assigned the address of a function
191 .\"O (i.e., is not NULL), then that function is called
192 .\"O instead of prefixing the message with the program name and colon.
193 .\"O The function should print a suitable string to
195 大域変数 \fIerror_print_progname\fP に
196 関数のアドレスが割り当てられている場合 (つまり NULL ではない場合)、
197 メッセージの前にプログラム名とコロンを書き出すのではなく、
201 に対しての適切な文字列を書き出さなければならない。
202 .\"O .SH "CONFORMING TO"
204 .\"O These functions and variables are GNU extensions, and should not be
205 .\"O used in programs intended to be portable.
206 これらの関数と変数は GNU による拡張であり、
207 移植性を考えたプログラムでは使用すべきではない。
214 .BR program_invocation_name (3),