[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, 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  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

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.

Related Information

The catclose (catclose Subroutine) subroutine, catopen (catopen Subroutine) subroutine.

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

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

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]