catgetsのヘルプ・マニュアル
日本語 英語
catgets --help
man catgets
CATGETS(3) Linux Programmer’s Manual CATGETS(3)
名前
catgets - メッセージカタログからメッセージを取り出す
書式
#include
char *catgets(nl_catd catalog, int set_number, int message_number,
const char *message);
説明
catgets() は catalog で 指 定 されたメッセージカタログから、セット
set_number のメッセージ message_number を読み 取 る 。 catalog は 、
catopen(3) の呼び出しによって得られたカタログディスクリプタを指定する。
4番目の引数 message は、指定のメッセージカタログが現在利用できない場 合
に catgets() が返すデフォルトのメッセージを指す。メッセージテキストは内
部のバッファ領域に格納されており、保存や変更を行う場合にはアプリケー シ
ョ ン側でコピーする必要がある。返される文字列は常にヌル文字で終端される
。
返り値
成功した場合、 catgets() は内部のバッファ領域へのポインタを返す。ここに
は ヌル文字で終端されたメッセージ文字列が格納されている。失敗した場合は
message を返す。
準拠
POSIX.1-2001.
注意
これらの関数は libc.so.4.4.4c 以降でしか使えな い 。 Jan 1987 X/Open
Portability Guide では、エラーの時に返される値により微妙な指定をしてい
る。 catalog で指定されたメッセージカタログが利用できない場合は message
を 返し、一方メッセージカタログはあるが指定したメッセージがない場合は空
の文字列が返される。 SUSv2 ではこの二種類のエラーリターンは廃止され、常
に message を返すことにしたようである。
関連項目
catopen(3), setlocale(3)
1998-08-09 CATGETS(3)
CATGETS(3) Linux Programmer’s Manual CATGETS(3)
NAME
catgets - get message from a message catalog
SYNOPSIS
#include
char *catgets(nl_catd catalog, int set_number, int message_number,
const char *message);
DESCRIPTION
catgets() reads the message message_number, in set set_number, from the
message catalog identified by catalog, where catalog is a catalog
descriptor returned from an earlier call to catopen(3). The fourth
argument message points to a default message string which will be
returned by catgets() if the identified message catalog is not cur-
rently available. The message-text is contained in an internal buffer
area and should be copied by the application if it is to be saved or
modified. The return string is always terminated with a null byte.
RETURN VALUE
On success, catgets() returns a pointer to an internal buffer area con-
taining the null-terminated message string. On failure, catgets()
returns the value message.
CONFORMING TO
POSIX.1-2001.
NOTES
These functions are only available in libc.so.4.4.4c and above. The
Jan 1987 X/Open Portability Guide specifies a more subtle error return:
message is returned if the message catalog specified by catalog is not
available, while an empty string is returned when the message catalog
is available but does not contain the specified message. These two
possible error returns seem to be discarded in SUSv2 in favor of always
returning message.
SEE ALSO
catopen(3), setlocale(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
1998-08-09 CATGETS(3)