Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(3int)

gencat(1int)

catopen(3int)

catgets(3int)

nl_types(5int)

catgetmsg(3int)

Name

catgetmsg − get message from a message catalog

Syntax

#include <nl_types.h>

nl_catd catd;
int set_num, msg_num, buflen;
char *buf;

Description

The catgetmsg function has been superceded by the catgets function.  You should use the catgets function to get messages from a message catalog. You might want to rewrite calls to the catgetmsg function so that they use the catgets function.  The catgetmsg function is available for compatibility with XPG−2 conformant software and might not be available in the future. For more information on using catgets, see the catgets() reference page.

The function catgetmsg attempts to read up to buflen −1 bytes of a message string into the area pointed to by buf .  The parameter buflen is an integer value containing the size in bytes of buf. The return string is always terminated with a null byte.

The parameter catd is a catalog descriptor returned from an earlier call to catopen and identifies the message catalog containing the message set ( set_num) and the program message  ( msg_num).

The arguments set_num and msg_num are defined as integer values for maximum portability.  Where possible, you should use symbolic names for message and set numbers, rather hard-coding integer values into your source programs.  If you use symbolic names, you must include the #include file gencat −h creates in all the program modules.

Return Value

If successful, catgetmsg returns a pointer to the message string in buf. Otherwise, if catd is invalid or if set_num or msg_num are not in the message catalog, catgetmsg returns a pointer to an empty (null) string.

See Also

intro(3int), gencat(1int), catopen(3int), catgets(3int), nl_types(5int)
Guide to Developing International Software

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026