catgetmsg(3C)
NAME
catgetmsg() − get message from a message catalog
SYNOPSIS
#include <nl_types.h>
char *catgetmsg(
nl_catd catd,
int set_num,
int msg_num,
char *buf,
size_t buflen
);
DESCRIPTION
catgetmsg() reads message msg_num in set set_num from the message catalog indentified by catd, a catalog descriptor returned from a previous call to catopen() (see catopen(3C)). The return message is stored in buf, a buffer of length buflen bytes.
A message longer than buflen − 1 bytes is silently truncated. The return message is always terminated with a null byte.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
If successful, catgetmsg() returns a pointer to the message in buf. Otherwise, catgetmsg() returns a pointer to an empty (null) string and sets errno to indicate the error. If buflen is greater than zero, the pointer returned is buf.
ERRORS
catgetmsg() fails and errno is set to the value indicated if one of the following conditions is true:
[EBADF] catd is not a valid catalog descriptor.
[EINVAL] buflen is less than 1.
[EINVAL] set_num is not in the message catalog.
[EINVAL] The message catalog identified by catd is corrupted.
[EINTR] A signal was caught during the read() system call.
[EFAULT] buf points outside the allocated address space. The reliable detection of this error is implementation dependent.
[ENOMSG] msg_num is not in the message catalog.
[ERANGE] A message longer than buflen− 1 bytes was truncated.
AUTHOR
catgetmsg() was developed by HP.
SEE ALSO
catopen(3C), catgets(3C), read(2).
STANDARDS CONFORMANCE
catgetmsg(): XPG2
Hewlett-Packard Company — HP-UX Release 9.0: August 1992