CATREAD(3C)
NAME
catread − MPE/RTE-style message catalog support
SYNOPSIS
int catread (fd, set_num, msg_num, msg_buf, buflen [,arg]...)
int fd, set_num, msg_num, buflen;
char *msg_buf, *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(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 may 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 MPE/RTE. (MPE and RTE are HP operating systems.)
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).
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989