Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

catopen(3c) [hpux man page]

catopen(3C)															       catopen(3C)

NAME
catopen(), catclose() - open and close a message catalog for reading SYNOPSIS
DESCRIPTION
The function opens a message catalog and returns a catalog descriptor. The specifies the name of the message catalog being opened. A con- taining a slash specifies a path name for the message catalog. Otherwise, the environment variable is used (see environ(5)). If specifies more than one path, returns the catalog descriptor for the first path on which it is able to successfully open the specified message cata- log. If does not exist in the environment, or if a message catalog cannot be opened for any path, uses a system-wide default path. The default is affected by if the value of is If the value of is zero, the default is affected by the environment variable See environ(5) for details. If is invoked from or programs with owner root, the environment variable is not directly used to locate message catalogs. Instead, the paths which are available both in the configuration file and environment variable are considered to locate message catalogs. See nlspath(4) for details. Example: If the environment variable is set to: and the configuration file has an entry: only path is considered for locating catalog files. This feature is provided only for backward compatibility for those or root programs which are depending on the environment variable. All new or root programs should not depend on the environment variable and should only use absolute path names. A message catalog descriptor remains valid in a process until the process closes it or until a successful call to one of the functions. A change in the setting of the category may invalidate existing open catalogs. A file descriptor is used to implement the message catalog descriptor and the close-on-exec flag is set for the message catalog descriptor (see fcntl(2)). If is zero, the environment variable is used to locate the catalog. If is the category is used to locate the message catalog only if a successful call to has been made prior to the call to The result of setting to any other value is undefined. The function closes the message catalog a message catalog descriptor returned from an earlier successful call to RETURN VALUE
Upon success, returns a message catalog descriptor. Otherwise, returns a value of (nl_catd)-1 and sets to indicate the error. Upon success, returns zero. Otherwise, returns -1 and sets to indicate the error. ERRORS
fails without opening a message catalog and sets for the last path attempted under any of the following conditions: A component of the path prefix denies search permission, or read permission is denied for the named file. The maximum number of file descriptors allowed are currently open. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. The system file table is full. The named catalog does not exist or the path is null. A component of the path prefix is not a directory. can be used to provide default messages when called following a failed (see catgets(3C)). returns its parameter if it is passed an invalid catalog descriptor. fails if the following is true: is not a valid open message catalog descriptor. WARNINGS
When using does not provide a default value for AUTHOR
and were developed by HP. FILES
Include file containing native language types. Message catalog default path for core HP-UX products only. SEE ALSO
fcntl(2), catgets(3C), setlocale(3C), nlspath(4), environ(5), thread_safety(5). STANDARDS CONFORMANCE
catopen(3C)

Check Out this Related Man Page

CATOPEN(3)						   BSD Library Functions Manual 						CATOPEN(3)

NAME
catopen -- open message catalog LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <nl_types.h> nl_catd catopen(const char *name, int oflag); DESCRIPTION
The catopen() function opens the message catalog specified by name and returns a message catalog descriptor. If name contains a '/' then name specifies the full pathname for the message catalog, otherwise the value of the environment variable NLSPATH is used with the following substitutions: %N The value of the name argument. %L The value of the LANG environment variable or the LC_MESSAGES category (see below). %l The language element from the LANG environment variable or from the LC_MESSAGES category. %t The territory element from the LANG environment variable or from the LC_MESSAGES category. %c The codeset element from the LANG environment variable or from the LC_MESSAGES category. %% A single % character. An empty string is substituted for undefined values. Path names templates defined in NLSPATH are separated by colons (':'). A leading or two adjacent colons is equivalent to specifying %N. If the oflag argument is set to the NL_CAT_LOCALE constant, LC_MESSAGES locale category used to open the message catalog; using NL_CAT_LOCALE conforms to the X/Open Portability Guide Issue 4 (``XPG4'') standard. You can specify 0 for compatibility with X/Open Portability Guide Issue 3 (``XPG3''); when oflag is set to 0, the LANG environment variable determines the message catalog locale. A message catalog descriptor remains valid in a process until that process closes it, or until a successful call to one of the exec(3) func- tion. RETURN VALUES
Upon successful completion, catopen() returns a message catalog descriptor. Otherwise, (nl_catd) -1 is returned and errno is set to indicate the error. ERRORS
[EINVAL] Argument name does not point to a valid message catalog, or catalog is corrupt. [ENAMETOOLONG] An entire path to the message catalog exceeded 1024 characters. [ENOENT] The named message catalog does not exists, or the name argument points to an empty string. [ENOMEM] Insufficient memory is available. SEE ALSO
gencat(1), catclose(3), catgets(3), setlocale(3) STANDARDS
The catopen() function conforms to IEEE Std 1003.1-2001 (``POSIX.1''). BSD
February 12, 2005 BSD
Man Page