Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

catgets(3)

catclose(3)

dspcat(1)

dspmsg(1)

gencat(1)

catopen(3)  —  Subroutines

OSF

NAME

catopen − Opens a specified message catalog

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <limits.h>
#include <nl_types.h>
nl_catd catopen (
    const char ∗name,
    int oflag );

PARAMETERS

nameSpecifies the catalog file to open. 

oflagIncluded for compatibility with X/Open. The oflag parameter is reserved for future use and should be set to zero. 

DESCRIPTION

The catopen() function opens a specified message catalog and returns a catalog descriptor that is used to retrieve messages from the catalog. 

The special nl_catd data type is used for catalog descriptors.  Since this data type is defined in the nl_types.h header file, include this file in your application program. 

The name parameter specifies the name of the message catalog to be opened.  If name contains a / (slash), then name specifies a full pathname for the message catalog.  Otherwise, the environment variable NLSPATH is used with name substituted for %N.  If NLSPATH does not exist in the environment, or if a message catalog cannot be opened in any of the components specified by NLSPATH , then an default message catalog is used.  The variable %L will be replaced by the value of the LANG environment variable. 

If there is an open file descriptor associated with the catalog file, the FD_CLOEXEC flag will be set. 

The LANG environment variable is used to refer to message catalogs that are separated into directories based on natural languages.  For example, if the catopen() function specifies a catalog with the name mycmd, and the environment variables are set as follows:

NLSPATH=../%N:./%N:/system/nls/%L/%N:/system/nls/%N
LANG=Fr_FR

then the application searches for the catalog in the following order:

../mycmd.
/mycmd
/system/nls/Fr_FR/mycmd
/system/nls/mycmd

If you omit the variable %N in a directory specification within the environment variable NLSPATH, the application assumes that the path defines a directory and searches for the catalog in that directory before searching the next specified path. The value /usr/lib/nls/msg/%L/%N:/etc/nls/%L/%N is the default path for NLSPATH. 

NOTES

AES Support Level:
Trial use

RETURN VALUES

The catopen() function returns a value of -1 if the number of catalogs already open is equal to the NL_MAXOPEN limit defined in the mesg.h header file. 

The catopen() function also returns a value of -1 if it cannot find the file. 

RELATED INFORMATION

Functions: catgets(3), catclose(3)

Commands: dspcat(1), dspmsg(1), gencat(1)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026