Retrieves a message from a catalog.
Standard C Library (libc.a)
#include <nl_types>
char *catgets (CatalogDescriptor, SetNumber, MessageNumber, String)
nl_catd CatalogDescriptor;
int SetNumber, MessageNumber;
const char * String;
The catgets subroutine retrieves a message from a catalog after a successful call to the catopen subroutine. If the catgets subroutine finds the specified message, it loads it into an internal character string buffer, ends the message string with a null character, and returns a pointer to the buffer.
The catgets subroutine uses the returned pointer to reference the buffer and display the message. However, the buffer can not be referenced after the catalog is closed.
Item | Description |
---|---|
CatalogDescriptor | Specifies a catalog description that is returned by the catopen subroutine. |
SetNumber | Specifies the set ID. |
MessageNumber | Specifies the message ID. The SetNumber and MessageNumber parameters specify a particular message to retrieve in the catalog. |
String | Specifies the default character-string buffer. |
If the catgets subroutine is unsuccessful for any reason, it returns the user-supplied default message string specified by the String parameter.