NAME
catgets() — get a program message
SYNOPSIS
#include <nl_types.h>
char *catgets(
nl_catd catd,
int set_num,
int msg_num,
const char *def_str
);
DESCRIPTION
The
catgets()
function reads message
msg_num
in set
set_num
from the message catalog identified by
catd,
a catalog descriptor returned from a previous call to
catopen()
(see
catopen(3C)).
If the call fails,
def_str
points to a default message string returned by
catgets().
A message longer than
NL_TEXTMAX
bytes is truncated.
The returned message string is always terminated with a null byte.
NL_TEXTMAX
is defined in
<limits.h>.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
If the call is successful,
catgets()
returns a pointer to an internal buffer area
containing the null-terminated message string.
If the call is unsuccessful,
catgets()
returns a pointer to
def_str.
ERRORS
catgets()
fails and sets
errno
under any of the following conditions:
- [EBADF]
catd
is not a valid catalog descriptor.
- [EINTR]
A signal was caught during the
read(2)
system call.
- [EINVAL]
The message catalog identified by
catd
is corrupted.
- [ENOMSG]
The message identified by
set_num
or
msg_num
is not in the message catalog.
- [ERANGE]
A message longer than
NL_TEXTMAX
bytes was truncated.
WARNINGS
The
catgets()
function returns a pointer to a static area
that is overwritten on each call.
AUTHOR
catgets()
was developed by HP.
FILES
/usr/include/nl_types.h
STANDARDS CONFORMANCE
catgets(): AES, SVID3, XPG2, XPG3, XPG4