[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

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 SetNumberMessageNumber;
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

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.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The catclose subroutine, catopen subroutine.

For more information about the Message Facility, see Message Facility Overview for Programming in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

For more information about subroutines and libraries, see Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]