Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ catopen(3C) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

catgetmsg(3C)

catgets(3C)

environ(5)

CATOPEN(3C)

NAME

catopen, catclose − open and close a message catalog for reading

SYNOPSIS

#include <nl_types.h>

nl_catd catopen (name, oflag)
char ∗name;
int oflag;

int catclose (catd)
nl_catd catd;

DESCRIPTION

Catopen opens a message catalog and returns a catalog descriptor.  Name specifies the name of the message catalog being opened.  A name containing a / (slash) specifies a path name for the message catalog.  Otherwise, the environment variable NLSPATH is used, see environ(5). If NLSPATH specifies more than one path, catopen returns the catalog descriptor for the first path on which it is able to successfully open the specified message catalog.  If NLSPATH does not exist in the environment or if a message catalog cannot be opened for any NLSPATH-specified path, catopen uses a systemwide default path.  Name must not contain "%N". 

Oflag is reserved for future use and should be set to 0 (zero).  The results of setting this field to any other value are undefined. 

Catclose closes the message catalog catd, a message catalog descriptor returned from an earlier successful call of catopen.

RETURN VALUE

Catopen returns a message catalog descriptor if successful.  Otherwise, a value of (nl_catd) -1 is returned and errno is set to indicate the error. 

Catclose returns 0 if successful.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

Catopen fails, no message catalog is opened, and errno is set for the last path attempted if any of the following conditions is true:

[ENOTDIR] A component of the path prefix is not a directory. 

[ENOENT] The named catalog does not exist. 

[ENOENT] The path is null. 

[EACCES] A component of the path prefix denies search permission. 

[EACCES] Read permission is denied for the named file. 

[EMFILE] The maximum number of file descriptors allowed are currently open. 

[ENAMETOOLONG] The length of the specified path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect. 

[EINVAL] The name argument contains "%N". 

Catclose fails if the following is true:

[EBADF] Catd is not a valid open message-catalog descriptor. 

WARNINGS

When using NLSPATH, catopen does not provide a default value for LANG. 

NOTES

Catgets(3C) can be used to provide default messages when called following a failed catopen.  Catgets will return its def_str parameter if it is passed an invalid catalog descriptor. 

AUTHOR

Catopen was developed by HP. 

FILES

/usr/lib/nls Message catalog default path. 

SEE ALSO

catgetmsg(3C), catgets(3C), environ(5). 

STANDARDS CONFORMANCE

catopen: XPG2, XPG3

catclose: XPG2, XPG3

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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