NetBSD-5.0.2/lib/libc/nls/catgets.3

Compare this file to the similar file:
Show the results in this format:

.\"	$NetBSD: catgets.3,v 1.16 2003/07/26 19:24:49 salo Exp $
.\"
.\" Written by J.T. Conklin <jtc@NetBSD.org>.
.\" Public domain.
.\"
.Dd February 12, 2003
.Dt CATGETS 3
.Os
.Sh NAME
.Nm catgets
.Nd retrieve string from message catalog
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In nl_types.h
.Ft char *
.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s"
.Sh DESCRIPTION
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 .
The argument
.Fa s
points to a default message which is returned if the function
is unable to retrieve the specified message.
.Sh RETURN VALUES
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
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
is not in the message catalog.
.El
.Sh SEE ALSO
.Xr gencat 1 ,
.Xr catclose 3 ,
.Xr catopen 3 ,
.Xr nls 7
.Sh STANDARDS
The
.Fn catgets
function conforms to
.St -xpg4.2 .
.Pp
Major Unix vendors are split over the adoption of the two most
important message catalog specifications: catgets or
.Xr gettext 3 .
The primary concern with the catgets interface is that every
translatable string has to define a number (or a symbolic constant)
which must correspond to the message in the catalog.
Duplicate message IDs are not allowed.
Constructing message catalogs is difficult.