catgets Subroutine

Purpose

Retrieves a message from a catalog.

Library

Standard C Library (libc.a)

Syntax

#include <nl_types>

char *catgets (CatalogDescriptorSetNumberMessageNumberString)
nl_catd  CatalogDescriptor;
int  SetNumber MessageNumber;
const char * String;

Description

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.

Parameters

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.

Return Values

If the catgets subroutine is unsuccessful for any reason, it returns the user-supplied default message string specified by the String parameter.