OSDN Git Service

d8ecf642ba0c572818c09182be71dff47a5a539d
[linuxjm/LDP_man-pages.git] / draft / man3 / catopen.3
1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Modified Thu Dec 13 22:51:19 2001 by Martin Schulze <joey@infodrom.org>
24 .\" Modified 2001-12-14 aeb
25 .\"
26 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
27 .\"     all rights reserved.
28 .\" Translated Tue Dec 16 19:43:18 JST 1997
29 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
30 .\" Updated & Modified Mon Jan 14 06:48:39 JST 2002
31 .\"     by Yuichi SATO <ysato@h4.dion.ne.jp>
32 .\"
33 .TH CATOPEN 3 2001-12-14 "GNU" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .SH 名前
36 .\"O catopen, catclose \- open/close a message catalog
37 catopen, catclose \- メッセージカタログのオープン/クローズ
38 .\"O .SH SYNOPSIS
39 .SH 書式
40 .B #include <nl_types.h>
41 .sp
42 .BI "nl_catd catopen(const char *" name ", int " flag );
43
44 .BI "int catclose(nl_catd " catalog );
45 .\"O .SH DESCRIPTION
46 .SH 説明
47 .\"O The function
48 .\"O .BR catopen ()
49 .\"O opens a message catalog and returns a catalog descriptor.
50 関数
51 .BR catopen ()
52 はメッセージカタログをオープンし、カタログディスクリプタを返す。
53 .\"O The descriptor remains valid until
54 .\"O .BR catclose ()
55 .\"O or
56 .\"O .BR execve (2).
57 .\"O If a file descriptor is used to implement catalog descriptors
58 .\"O then the
59 .\"O .B FD_CLOEXEC
60 .\"O flag will be set.
61 このディスクリプタは
62 .BR catclose ()
63 または
64 .BR execve (2)
65 が呼び出されるまで有効である。
66 カタログディスクリプタを実装するために
67 ファイルディスクリプタを使用すると、
68 .B FD_CLOEXEC
69 フラグが設定される。
70 .LP
71 .\"O The argument
72 .\"O .I name
73 .\"O specifies the name of the message catalog to be opened.
74 引き数
75 .I name
76 はオープンするメッセージカタログの名前を指定する。
77 .\"O If
78 .\"O .I name
79 .\"O specifies and absolute path (i.e., contains a \(aq/\(aq),
80 .\"O then
81 .\"O .I name
82 .\"O specifies a pathname for the message catalog.
83 .I name
84 が絶対パスで指定されている場合 (すなわち \(aq/\(aq を含んでいる場合)、
85 .I name
86 はメッセージカタログへのパス名である。
87 .\"O Otherwise, the environment variable
88 .\"O .B NLSPATH
89 .\"O is used with
90 .\"O .I name
91 .\"O substituted for
92 .\"O .B %N
93 .\"O (see
94 .\"O .BR locale (7)).
95 それ以外の場合、環境変数
96 .B NLSPATH
97
98 .I name
99 とともに使用され
100 .B %N
101 を置き換える
102 .RB ( locale (7)
103 参照)。
104 .\"O It is unspecified whether
105 .\"O .B NLSPATH
106 .\"O will be used when the process has root privileges.
107 プロセスが root 権限を持っているときに
108 .B NLSPATH
109 が使われるかどうかは指定されていない。
110 .\"O If
111 .\"O .B NLSPATH
112 .\"O does not exist in the environment,
113 .\"O or if a message catalog cannot be opened
114 .\"O in any of the paths specified by it,
115 .\"O then an implementation defined path is used.
116 .B NLSPATH
117 環境変数が存在しないか、
118 .B NLSPATH
119 で指定されたパスの中の
120 どのパスにおいてもメッセージカタログをオープンできない場合、
121 実装で定義されているパスが使われる。
122 .\"O This latter default path may depend on the
123 .\"O .B LC_MESSAGES
124 .\"O locale setting when the
125 .\"O .I flag
126 .\"O argument is
127 .\"O .B NL_CAT_LOCALE
128 .\"O and on the
129 .\"O .B LANG
130 .\"O environment variable when the
131 .\"O .I flag
132 .\"O argument is 0.
133 後者のデフォルトパスは、
134 .I flag
135 引き数が
136 .B NL_CAT_LOCALE
137 の場合には
138 .B LC_MESSAGES
139 のロケール設定に依存し、
140 .I flag
141 引き数が 0 の場合には
142 .B LANG
143 環境変数に依存する。
144 .\"O Changing the
145 .\"O .B LC_MESSAGES
146 .\"O part of the locale may invalidate
147 .\"O open catalog descriptors.
148 ロケールの
149 .B LC_MESSAGES
150 を変更すると、
151 オープンされているカタログディスクリプタが無効になるかもしれない。
152 .LP
153 .\"O The
154 .\"O .I flag
155 .\"O argument to
156 .\"O .BR catopen ()
157 .\"O is used to indicate the source for the language to use.
158 .BR catopen ()
159
160 .I flag
161 引き数は、使用される言語のソースを示すために使われる。
162 .\"O If it is set to
163 .\"O .B NL_CAT_LOCALE
164 .\"O then it will use the current locale setting for
165 .\"O .BR LC_MESSAGES .
166 .B NL_CAT_LOCALE
167 に設定されると、
168 .B LC_MESSAGES
169 の現在のロケール設定が使われる。
170 .\"O Otherwise it will use the
171 .\"O .B LANG
172 .\"O environment variable.
173 それ以外の場合は
174 .B LANG
175 環境変数が使われる。
176 .LP
177 .\"O The function
178 .\"O .BR catclose ()
179 .\"O closes the message catalog identified by
180 .\"O .IR catalog .
181 関数
182 .BR catclose ()
183
184 .I catalog
185 で指定されたメッセージカタログをクローズする。
186 .\"O It invalidates any subsequent references to the message catalog
187 .\"O defined by
188 .\"O .IR catalog .
189 これは、以降の
190 .I catalog
191 で指定されるメッセージカタログへの全ての参照を無効にする。
192 .\"O .SH "RETURN VALUE"
193 .SH 返り値
194 .\"O The function
195 .\"O .BR catopen ()
196 .\"O returns a message catalog descriptor of type
197 .\"O .I nl_catd
198 .\"O on success.
199 関数
200 .BR catopen ()
201 が成功すると、
202 .I nl_catd
203 型のメッセージカタログディスクリプタを返す。
204 .\"O On failure, it returns \fI(nl_catd)\ \-1\fP
205 .\"O and sets
206 .\"O .I errno
207 .\"O to indicate the error.
208 .\"O The possible error values include all
209 .\"O possible values for the
210 .\"O .BR open (2)
211 .\"O call.
212 失敗した場合は \fI(nl_catdv) \-1\fP を返し、
213 .I errno
214 を設定してエラーを示す。
215 ここで起こり得るエラーの値には、
216 .BR open (2)
217 の呼び出しの際に起こり得る全てのエラーの値が含まれる。
218 .LP
219 .\"O The function
220 .\"O .BR catclose ()
221 .\"O returns 0 on success, or \-1 on failure.
222 関数
223 .BR catclose ()
224 は、成功した場合 0 を、失敗した場合 \-1 を返す。
225 .\"O .SH ENVIRONMENT
226 .SH 環境変数
227 .TP
228 .B LC_MESSAGES
229 .\"O May be the source of the
230 .\"O .B LC_MESSAGES
231 .\"O locale setting, and thus
232 .\"O determine the language to use if
233 .\"O .I flag
234 .\"O is set to
235 .\"O .BR NL_CAT_LOCALE .
236 .B LC_MESSAGES
237 ロケール設定のソースになることも可能なので、
238 .I flag
239
240 .B NL_CAT_LOCALE
241 に設定されている場合は、使用する言語を決定するのに使われる。
242 .TP
243 .B LANG
244 .\"O The language to use if
245 .\"O .I flag
246 .\"O is 0.
247 .I flag
248 が 0 の場合、使用する言語を決定する。
249 .\"O .SH "CONFORMING TO"
250 .SH 準拠
251 POSIX.1-2001.
252 .\"O .\" In XPG 1987, Vol. 3 it says:
253 .\"O .\" .I "The flag argument of catopen is reserved for future use"
254 .\"O .\" .IR "and should be set to 0" .
255 .\"O It is unclear what the source was for the constants
256 .\"O .B MCLoadBySet
257 .\"O and
258 .\"O .B MCLoadAll
259 .\"O (see below).
260 .\" XPG 1987, Vol. 3 には、「\fIcatopen の flag 引き数は
261 .\" 将来使用するために予約されているので、
262 .\" 0 に設定しておくべきである。\fR」と書かれている。
263 定数
264 .B MCLoadBySet
265
266 .B MCLoadAll
267 に対応するソースが何であるのかがはっきりしていない (下記参照)。
268 .\"O .SH NOTES
269 .SH 注意
270 .\"O The above is the POSIX.1-2001 description.
271 .\"O The glibc value for
272 .\"O .B NL_CAT_LOCALE
273 .\"O is 1.
274 .\"O (Compare
275 .\"O .B MCLoadAll
276 .\"O below.)
277 .\"O The default path varies, but usually looks at a number of places below
278 .\"O .IR /usr/share/locale .
279 以上は POSIX.1-2001 における説明である。
280 glibc では
281 .B NL_CAT_LOCALE
282 の値は 1 である
283 (以下の
284 .B MCLoadAll
285 と比較のこと)。
286 デフォルトのパスは場合によって様々であるが、通常は
287 .I /usr/share/locale
288 以下のファイルが調べられる。
289 .\"O .SS Linux Notes
290 .SS Linux における注意
291 .\"O These functions are available for Linux since libc 4.4.4c.
292 これらの関数は libc.so.4.4.4c 以降で使用可能である。
293 .\"O In the case of linux libc4 and libc5, the catalog descriptor
294 .\"O .I nl_catd
295 .\"O is a
296 .\"O .BR mmap (2)'ed
297 .\"O area of memory and not a file descriptor.
298 linux の libc4 と libc5 においては、カタログディスクリプタ
299 .I nl_catd
300
301 .BR mmap (2)
302 されたメモリの領域であってファイルディスクリプタではない。
303 .\"O The
304 .\"O .I flag
305 .\"O argument to
306 .\"O .BR catopen ()
307 .\"O should be either
308 .\"O .B MCLoadBySet
309 .\"O (=0) or
310 .\"O .B MCLoadAll
311 .\"O (=1).
312 .BR catopen ()
313
314 .I flag
315 は、
316 .B MCLoadBySet
317 (=0) か
318 .B MCLoadAll
319 (=1) のどちらかである。
320 .\"O The former value indicates that a set from the catalog is to be
321 .\"O loaded when needed, whereas the latter causes the initial call to
322 .\"O .BR catopen ()
323 .\"O to load the entire catalog into memory.
324 前者の場合、カタログのセットは必要時にロードされる。
325 後者の場合、最初の
326 .BR catopen ()
327 の呼び出しのときに全てのカタログがメモリ内にロードされる。
328 .\"O The default search path varies, but usually looks at a number of places below
329 .\"O .I /etc/locale
330 .\"O and
331 .\"O .IR /usr/lib/locale .
332 デフォルトのパスは場合によって様々であるが、通常は
333 .I /etc/locale
334
335 .I /usr/share/locale
336 以下のファイルが調べられる。
337 .\"O .SH "SEE ALSO"
338 .SH 関連項目
339 .BR catgets (3),
340 .BR setlocale (3)