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)						     Linux Programmer's Manual							CATOPEN(3)

NAME
catopen, catclose - open/close a message catalog SYNOPSIS
#include <nl_types.h> nl_catd catopen(const char *name, int flag); int catclose(nl_catd catalog); DESCRIPTION
The function catopen() opens a message catalog and returns a catalog descriptor. The descriptor remains valid until catclose() or execve(2). If a file descriptor is used to implement catalog descriptors, then the FD_CLOEXEC flag will be set. The argument name specifies the name of the message catalog to be opened. If name specifies an absolute path (i.e., contains a '/'), then name specifies a pathname for the message catalog. Otherwise, the environment variable NLSPATH is used with name substituted for %N (see locale(7)). It is unspecified whether NLSPATH will be used when the process has root privileges. If NLSPATH does not exist in the envi- ronment, or if a message catalog cannot be opened in any of the paths specified by it, then an implementation defined path is used. This latter default path may depend on the LC_MESSAGES locale setting when the flag argument is NL_CAT_LOCALE and on the LANG environment vari- able when the flag argument is 0. Changing the LC_MESSAGES part of the locale may invalidate open catalog descriptors. The flag argument to catopen() is used to indicate the source for the language to use. If it is set to NL_CAT_LOCALE, then it will use the current locale setting for LC_MESSAGES. Otherwise, it will use the LANG environment variable. The function catclose() closes the message catalog identified by catalog. It invalidates any subsequent references to the message catalog defined by catalog. RETURN VALUE
The function catopen() returns a message catalog descriptor of type nl_catd on success. On failure, it returns (nl_catd) -1 and sets errno to indicate the error. The possible error values include all possible values for the open(2) call. The function catclose() returns 0 on success, or -1 on failure. ENVIRONMENT
LC_MESSAGES May be the source of the LC_MESSAGES locale setting, and thus determine the language to use if flag is set to NL_CAT_LOCALE. LANG The language to use if flag is 0. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +-----------+---------------+-------------+ |Interface | Attribute | Value | +-----------+---------------+-------------+ |catopen() | Thread safety | MT-Safe env | +-----------+---------------+-------------+ |catclose() | Thread safety | MT-Safe | +-----------+---------------+-------------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008. NOTES
The above is the POSIX.1 description. The glibc value for NL_CAT_LOCALE is 1. The default path varies, but usually looks at a number of places below /usr/share/locale. SEE ALSO
catgets(3), setlocale(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2015-08-08 CATOPEN(3)
Man Page