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

Item Description
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.