2003-07-26 23:24:24 +04:00
|
|
|
.\" $NetBSD: catgets.3,v 1.16 2003/07/26 19:24:49 salo Exp $
|
1995-02-27 16:06:20 +03:00
|
|
|
.\"
|
2003-07-26 23:24:24 +04:00
|
|
|
.\" Written by J.T. Conklin <jtc@NetBSD.org>.
|
1995-05-12 03:03:44 +04:00
|
|
|
.\" Public domain.
|
1994-05-30 04:53:56 +04:00
|
|
|
.\"
|
2003-02-12 21:58:50 +03:00
|
|
|
.Dd February 12, 2003
|
1994-05-30 04:53:56 +04:00
|
|
|
.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
|
1994-05-30 04:53:56 +04:00
|
|
|
.Sh SYNOPSIS
|
2003-04-16 17:34:34 +04:00
|
|
|
.In nl_types.h
|
1994-10-05 20:31:50 +03:00
|
|
|
.Ft char *
|
1998-02-08 22:54:54 +03:00
|
|
|
.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s"
|
1994-05-30 04:53:56 +04:00
|
|
|
.Sh DESCRIPTION
|
2001-09-16 06:21:00 +04:00
|
|
|
The
|
|
|
|
.Fn catgets
|
1994-05-30 04:53:56 +04:00
|
|
|
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
|
1994-05-30 04:53:56 +04:00
|
|
|
.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,
|
1994-05-30 04:53:56 +04:00
|
|
|
.Fn catgets
|
|
|
|
returns a pointer to an internal buffer containing the message string;
|
|
|
|
otherwise it returns
|
|
|
|
.Fa s .
|
1998-02-08 22:45:22 +03:00
|
|
|
.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.
|
1998-02-08 22:45:22 +03:00
|
|
|
.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.
|
1998-02-08 22:45:22 +03:00
|
|
|
.El
|
1994-05-30 04:53:56 +04:00
|
|
|
.Sh SEE ALSO
|
2003-02-05 08:05:50 +03:00
|
|
|
.Xr gencat 1 ,
|
1994-05-30 04:53:56 +04:00
|
|
|
.Xr catclose 3 ,
|
2003-02-12 05:50:52 +03:00
|
|
|
.Xr catopen 3 ,
|
|
|
|
.Xr nls 7
|
1994-11-18 18:36:11 +03:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Fn catgets
|
|
|
|
function conforms to
|
1998-02-08 22:45:22 +03:00
|
|
|
.St -xpg4.2 .
|
2003-02-12 05:50:52 +03:00
|
|
|
.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)
|
2003-02-12 21:58:50 +03:00
|
|
|
which must correspond to the message in the catalog.
|
|
|
|
Duplicate message IDs are not allowed.
|
|
|
|
Constructing message catalogs is difficult.
|