NetBSD/lib/libc/nls/catgets.3

63 lines
1.3 KiB
Groff
Raw Normal View History

2002-02-07 10:00:09 +03:00
.\" $NetBSD: catgets.3,v 1.11 2002/02/07 07:00:22 ross Exp $
1995-02-27 16:06:20 +03:00
.\"
.\" Written by J.T. Conklin <jtc@netbsd.org>.
.\" Public domain.
.\"
.Dd February 8, 1998
.Dt CATGETS 3
.Os
.Sh NAME
.Nm catgets
2001-09-16 06:21:00 +04:00
.Nd retrieve string from message catalog
1998-02-05 21:45:17 +03:00
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
2002-02-07 10:00:09 +03:00
.Fd #include \*[Lt]nl_types.h\*[Gt]
1994-10-05 20:31:50 +03:00
.Ft char *
.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s"
.Sh DESCRIPTION
2001-09-16 06:21:00 +04:00
The
.Fn catgets
function attempts to retrieve message
.Fa msg_id
of set
.Fa set_id
from the message catalog referenced by the descriptor
.Fa catd .
2001-09-16 06:21:00 +04:00
The argument
.Fa s
points to a default message which is returned if the function
is unable to retrieve the specified message.
2001-09-16 06:22:27 +04:00
.Sh RETURN VALUES
2001-09-16 06:21:00 +04:00
If the specified message was retrieved successfully,
.Fn catgets
returns a pointer to an internal buffer containing the message string;
otherwise it returns
.Fa s .
.Sh ERRORS
The
.Fn catgets
function will fail if:
.Bl -tag -width Er
.It Bq Er EBADF
The
.Fa catd
2001-09-16 06:21:00 +04:00
argument is not a valid message catalog descriptor open for reading.
.It Bq Er EINTR
The operation was interrupted by a signal.
.It Bq Er ENOMSG
The message identified by
.Fa set_id
and
.Fa msg_id
2001-09-16 06:21:00 +04:00
is not in the message catalog.
.El
.Sh SEE ALSO
.Xr catclose 3 ,
.Xr catopen 3
.Sh STANDARDS
The
.Fn catgets
function conforms to
.St -xpg4.2 .