.\" %Id: catopen.3,v 1.6 1998/04/30 16:11:50 ache Exp % .\" .\" Copyright (c) 1994 Winning Strategies, Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Winning Strategies, Inc. .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd May 29, 1994 .Dt CATOPEN 3 .Os .Sh 名称 .Nm catopen .Nd メッセージカタログのオープン .Sh 書式 .Fd #include .Ft nl_catd .Fn catopen "const char *name" "int oflag" .Sh 解説 .Fn catopen 関数は、 .Fa name によって指定されるメッセージカタログを開き、 メッセージカタログ記述子を返します。 .Fa name に .Sq / が 1 つ含まれる場合、 .Fa name はメッセージカタログの完全なパス名を指定します。そうでない場合は、 環境変数 .Ev NLSPATH の値が、 %N の代わりに置き換えられ .Fa name とともに 使用されます。 .Pp .Fa oflag 引数が .Dv NL_CAT_LOCALE 定数に設定されている場合、メッセージカタログを開くために .Dv LC_MESSAGES ロケールカテゴリが使用されます。 .Dv NL_CAT_LOCALE を使用することは .St -xpg4 規格に準拠しています。 .St -xpg3 との互換性を保つために 0 を指定することができます。 .Fa oflag が 0 に設定されている場合、 .Ev LANG 環境変数によってメッセージカタログのロケールが決定されます。 .Sh 戻り値 処理が正常に完了すると、 .Fn catopen は、メッセージカタログ記述子を返します。 そうでない場合は、 (nl_catd) -1 が返され、エラーを示す .Va errno が設定されます。 .Sh エラー .Bl -tag -width Er .It Bq Er ENOMEM 利用できるメモリが不十分です。 .El .Sh 関連項目 .Xr catclose 3 , .Xr catgets 3 , .Xr setlocale 3 .Sh 規格 .Fn catopen 関数は .St -xpg4 に準拠しています。