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

Technical Reference: Base Operating System and Extensions, Volume 1


catclose Subroutine

Purpose

Closes a specified message catalog.

Library

Standard C Library (libc.a)

Syntax

#include <nl_types.h>
int catclose ( CatalogDescriptor)
nl_catd CatalogDescriptor;

Description

The catclose subroutine closes a specified message catalog. If your program accesses several message catalogs and you reach the maximum number of opened catalogs (specified by the NL_MAXOPEN constant), you must close some catalogs before opening additional ones. If you use a file descriptor to implement the nl_catd data type, the catclose subroutine closes that file descriptor.

The catclose subroutine closes a message catalog only when the number of calls it receives matches the total number of calls to the catopen subroutine in an application. All message buffer pointers obtained by prior calls to the catgets subroutine are not valid when the message catalog is closed.

Parameters


CatalogDescriptor Points to the message catalog returned from a call to the catopen subroutine.

Return Values

The catclose subroutine returns a value of 0 if it closes the catalog successfully, or if the number of calls it receives is fewer than the number of calls to the catopen subroutine.

The catclose subroutine returns a value of -1 if it does not succeed in closing the catalog. The catclose subroutine is unsuccessful if the number of calls it receives is greater than the number of calls to the catopen subroutine, or if the value of the CatalogDescriptor parameter is not valid.

Implementation Specifics

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

Related Information

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

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

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


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