OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man3 / catopen.3
1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Thu Dec 13 22:51:19 2001 by Martin Schulze <joey@infodrom.org>
26 .\" Modified 2001-12-14 aeb
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
35 .\"     all rights reserved.
36 .\" Translated Tue Dec 16 19:43:18 JST 1997
37 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
38 .\" Updated & Modified Mon Jan 14 06:48:39 JST 2002
39 .\"     by Yuichi SATO <ysato@h4.dion.ne.jp>
40 .\"
41 .TH CATOPEN 3 2014\-08\-19 GNU "Linux Programmer's Manual"
42 .SH 名前
43 catopen, catclose \- メッセージカタログのオープン/クローズ
44 .SH 書式
45 \fB#include <nl_types.h>\fP
46 .sp
47 \fBnl_catd catopen(const char *\fP\fIname\fP\fB, int \fP\fIflag\fP\fB);\fP
48
49 \fBint catclose(nl_catd \fP\fIcatalog\fP\fB);\fP
50 .SH 説明
51 関数 \fBcatopen\fP()  はメッセージカタログをオープンし、カタログディスクリプターを返す。 このディスクリプターは \fBcatclose\fP()
52 または \fBexecve\fP(2)  が呼び出されるまで有効である。 カタログディスクリプターを実装するために ファイルディスクリプターを使用すると、
53 \fBFD_CLOEXEC\fP フラグが設定される。
54 .LP
55 引き数 \fIname\fP はオープンするメッセージカタログの名前を指定する。 \fIname\fP が絶対パスで指定されている場合 (すなわち
56 \(aq/\(aq を含んでいる場合)、 \fIname\fP はメッセージカタログへのパス名である。 それ以外の場合、環境変数 \fBNLSPATH\fP が
57 \fIname\fP とともに使用され \fB%N\fP を置き換える (\fBlocale\fP(7)  参照)。 プロセスが root 権限を持っているときに
58 \fBNLSPATH\fP が使われるかどうかは指定されていない。 \fBNLSPATH\fP 環境変数が存在しないか、 \fBNLSPATH\fP
59 で指定されたパスの中の どのパスにおいてもメッセージカタログをオープンできない場合、 実装で定義されているパスが使われる。 後者のデフォルトパスは、
60 \fIflag\fP 引き数が \fBNL_CAT_LOCALE\fP の場合には \fBLC_MESSAGES\fP のロケール設定に依存し、 \fIflag\fP 引き数が
61 0 の場合には \fBLANG\fP 環境変数に依存する。 ロケールの \fBLC_MESSAGES\fP を変更すると、
62 オープンされているカタログディスクリプターが無効になるかもしれない。
63 .LP
64 \fBcatopen\fP()  の \fIflag\fP 引き数は、使用される言語のソースを示すために使われる。 \fBNL_CAT_LOCALE\fP
65 に設定されると、 \fBLC_MESSAGES\fP の現在のロケール設定が使われる。 それ以外の場合は \fBLANG\fP 環境変数が使われる。
66 .LP
67 関数 \fBcatclose\fP()  は \fIcatalog\fP で指定されたメッセージカタログをクローズする。 これは、以降の \fIcatalog\fP
68 で指定されるメッセージカタログへの全ての参照を無効にする。
69 .SH 返り値
70 関数 \fBcatopen\fP()  が成功すると、 \fInl_catd\fP 型のメッセージカタログディスクリプターを返す。 失敗した場合は
71 \fI(nl_catdv) \-1\fP を返し、 \fIerrno\fP を設定してエラーを示す。 ここで起こり得るエラーの値には、 \fBopen\fP(2)
72 の呼び出しの際に起こり得る全てのエラーの値が含まれる。
73 .LP
74 関数 \fBcatclose\fP()  は、成功した場合 0 を、失敗した場合 \-1 を返す。
75 .SH 環境変数
76 .TP 
77 \fBLC_MESSAGES\fP
78 \fBLC_MESSAGES\fP ロケール設定のソースになることも可能なので、 \fIflag\fP が \fBNL_CAT_LOCALE\fP
79 に設定されている場合は、使用する言語を決定するのに使われる。
80 .TP 
81 \fBLANG\fP
82 \fIflag\fP が 0 の場合、使用する言語を決定する。
83 .SH 準拠
84 .\" In XPG 1987, Vol. 3 it says:
85 .\" .I "The flag argument of catopen is reserved for future use"
86 .\" .IR "and should be set to 0" .
87 .\"
88 .\" It is unclear what the source was for the constants
89 .\" .B MCLoadBySet
90 .\" and
91 .\" .B MCLoadAll
92 .\" (see below).
93 POSIX.1\-2001.
94 .SH 注意
95 .\" (Compare
96 .\" .B MCLoadAll
97 .\" below.)
98 .\" .SS Linux notes
99 .\" These functions are available for Linux since libc 4.4.4c.
100 .\" In the case of linux libc4 and libc5, the catalog descriptor
101 .\" .I nl_catd
102 .\" is a
103 .\" .BR mmap (2)'ed
104 .\" area of memory and not a file descriptor.
105 .\" The
106 .\" .I flag
107 .\" argument to
108 .\" .BR catopen ()
109 .\" should be either
110 .\" .B MCLoadBySet
111 .\" (=0) or
112 .\" .B MCLoadAll
113 .\" (=1).
114 .\" The former value indicates that a set from the catalog is to be
115 .\" loaded when needed, whereas the latter causes the initial call to
116 .\" .BR catopen ()
117 .\" to load the entire catalog into memory.
118 .\" The default search path varies, but usually looks at a number of places below
119 .\" .I /etc/locale
120 .\" and
121 .\" .IR /usr/lib/locale .
122 以上は POSIX.1\-2001 における説明である。 glibc では \fBNL_CAT_LOCALE\fP の値は 1 である。
123 デフォルトのパスは場合によって様々であるが、通常は \fI/usr/share/locale\fP 以下のファイルが調べられる。
124 .SH 関連項目
125 \fBcatgets\fP(3), \fBsetlocale\fP(3)
126 .SH この文書について
127 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
128 である。プロジェクトの説明とバグ報告に関する情報は
129 http://www.kernel.org/doc/man\-pages/ に書かれている。