Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ catopen(3C) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

catgetmsg(3C)

catgets(3C)

environ(5)

CATOPEN(3C)  —  HP-UX

NAME

catopen, catclose − open and close a message catalogue 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 catalogue and returns a catalogue descriptor.  Name specifies the name of the message catalogue to be opened.  A name containing a / (slash) specifies a path name for the message catalogue.  Otherwise, the environment variable NLSPATH is used with name substituted for "%N" (see environ(5)). If NLSPATH specifies more than one path, catopen returns the catalogue descriptor for the first path on which it is able to successfully open the specified message catalogue.  If NLSPATH does not exist in the environment or if a message catalogue cannot be opened for any NLSPATH-specified path, catopen uses a systemwide default path.  If name specifies a path, it should not contain the keyword "%N", because this would result in a recursive expansion (see environ(5)).

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 catalogue catd, a message catalogue descriptor returned from an earlier, successful call of catopen.

RETURN VALUE

Catopen returns a message catalogue 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 will fail and no catalogue will be opened if, for each of the paths or message catalogues, one of the following conditions is true.  Errno will be set for the last path attempted:

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

­[ENOENT] The named catalogue 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 path specified exceeds MAXPATHLEN characters. 

Catclose will fail if the following is true:

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

WARNINGS

Catopen does not verify that the file opened is actually a message catalogue. 

AUTHOR

Catopen was developed by HP. 

SEE ALSO

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

Hewlett-Packard Company  —  May 11, 2021

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