catread(3C)
NAME
catread() − MPE/RTE-style message catalog support
SYNOPSIS
#include <portnls.h>
int catread(
int fd,
int set_num,
int msg_num,
char *msg_buf,
int buflen,
/* arg, */ ...
);
DESCRIPTION
catread() reads message number msg_num of set set_num in the message catalog identified by fd, a file descriptor returned from a previous call to open() (see open(2)). The return message is stored in buf, a buffer of length buflen bytes.
The message read from the catalog can have embedded formatting information in the form ![ digit]. Exclamation marks must be all numbered or all unnumbered. If exclamation marks are numbered, an exclamation mark followed by digit n is replaced by the nth arg. If exclamation marks are unnumbered, they are replaced by the args in serial order. If there are fewer args than exclamation marks, the results are undefined. If there are more args than exclamation marks, the excess args are ignored.
A character in a message can be quoted (that is, made to stand for itself) by preceding it with a tilde (~). To use the special characters ! or ~ in a message, preceed the special character with ~.
A message longer than buflen− 1 bytes is silently truncated. The return message is always terminated with a null byte.
catread() is provided to support message catalog applications from The HP MPE and RTE operating systems.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
If successful, catread() returns the length, in bytes, of the formatted message in msg_buf. Otherwise, if set_num or msg_num is not found in the catalog, catread() returns a negative integer.
ERRORS
catread() succeeds, but sets errno if the following condition is true:
[ERANGE] Formatted message exceeds buflen −1 bytes.
AUTHOR
catread() was developed by HP.
SEE ALSO
gencat(1), getmsg(3C), hpnls(5).
Hewlett-Packard Company — HP-UX Release 9.10: April 1995