180 lines
7.1 KiB
HTML
180 lines
7.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>catopen</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="catopen"></a> <a name="tag_03_58"></a><!-- catopen -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_58_01"></a>NAME</h4>
|
|
|
|
<blockquote>catopen - open a message catalog</blockquote>
|
|
|
|
<h4><a name="tag_03_58_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <nl_types.h><br>
|
|
<br>
|
|
nl_catd catopen(const char *</tt><i>name</i><tt>, int</tt> <i>oflag</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]"
|
|
border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_03_58_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>catopen</i>() function shall open a message catalog and return a message catalog descriptor. The <i>name</i> argument
|
|
specifies the name of the message catalog to be opened. If <i>name</i> contains a <tt>'/'</tt> , then <i>name</i> specifies a
|
|
complete name for the message catalog. Otherwise, the environment variable <i>NLSPATH</i> is used with <i>name</i> substituted for
|
|
the <tt>%N</tt> conversion specification (see the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a>). If <i>NLSPATH</i> exists in the environment when the process
|
|
starts, then if the process has appropriate privileges, the behavior of <i>catopen</i>() is undefined. If <i>NLSPATH</i> does not
|
|
exist in the environment, or if a message catalog cannot be found in any of the components specified by <i>NLSPATH</i>, then an
|
|
implementation-defined default path shall be used. This default may be affected by the setting of <i>LC_MESSAGES</i> if the value
|
|
of <i>oflag</i> is NL_CAT_LOCALE, or the <i>LANG</i> environment variable if <i>oflag</i> is 0.</p>
|
|
|
|
<p>A message catalog descriptor shall remain valid in a process until that process closes it, or a successful call to one of the
|
|
<i><a href="../functions/exec.html">exec</a></i> functions. A change in the setting of the <i>LC_MESSAGES</i> category may
|
|
invalidate existing open catalogs.</p>
|
|
|
|
<p>If a file descriptor is used to implement message catalog descriptors, the FD_CLOEXEC flag shall be set; see <a href=
|
|
"../basedefs/fcntl.h.html"><i><fcntl.h></i></a>.</p>
|
|
|
|
<p>If the value of the <i>oflag</i> argument is 0, the <i>LANG</i> environment variable is used to locate the catalog without
|
|
regard to the <i>LC_MESSAGES</i> category. If the <i>oflag</i> argument is NL_CAT_LOCALE, the <i>LC_MESSAGES</i> category is used
|
|
to locate the message catalog (see the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a>).</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>Upon successful completion, <i>catopen</i>() shall return a message catalog descriptor for use on subsequent calls to <a href=
|
|
"../functions/catgets.html"><i>catgets</i>()</a> and <a href="../functions/catclose.html"><i>catclose</i>()</a>. Otherwise,
|
|
<i>catopen</i>() shall return ( <b>nl_catd</b>) -1 and set <i>errno</i> to indicate the error.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>catopen</i>() function may fail if:</p>
|
|
|
|
<dl compact>
|
|
<dt>[EACCES]</dt>
|
|
|
|
<dd>Search permission is denied for the component of the path prefix of the message catalog or read permission is denied for the
|
|
message catalog.</dd>
|
|
|
|
<dt>[EMFILE]</dt>
|
|
|
|
<dd>{OPEN_MAX} file descriptors are currently open in the calling process.</dd>
|
|
|
|
<dt>[ENAMETOOLONG]</dt>
|
|
|
|
<dd>
|
|
The length of a pathname of the message catalog exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.</dd>
|
|
|
|
<dt>[ENAMETOOLONG]</dt>
|
|
|
|
<dd>
|
|
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.</dd>
|
|
|
|
<dt>[ENFILE]</dt>
|
|
|
|
<dd>Too many files are currently open in the system.</dd>
|
|
|
|
<dt>[ENOENT]</dt>
|
|
|
|
<dd>The message catalog does not exist or the <i>name</i> argument points to an empty string.</dd>
|
|
|
|
<dt>[ENOMEM]</dt>
|
|
|
|
<dd>Insufficient storage space is available.</dd>
|
|
|
|
<dt>[ENOTDIR]</dt>
|
|
|
|
<dd>A component of the path prefix of the message catalog is not a directory.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_58_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>Some implementations of <i>catopen</i>() use <a href="../functions/malloc.html"><i>malloc</i>()</a> to allocate space for
|
|
internal buffer areas. The <i>catopen</i>() function may fail if there is insufficient storage space available to accommodate these
|
|
buffers.</p>
|
|
|
|
<p>Conforming applications must assume that message catalog descriptors are not valid after a call to one of the <i><a href=
|
|
"../functions/exec.html">exec</a></i> functions.</p>
|
|
|
|
<p>Application writers should be aware that guidelines for the location of message catalogs have not yet been developed. Therefore
|
|
they should take care to avoid conflicting with catalogs used by other applications and the standard utilities.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="catclose.html"><i>catclose</i>()</a> , <a href="catgets.html"><i>catgets</i>()</a> , the Base Definitions volume of
|
|
IEEE Std 1003.1-2001, <a href="../basedefs/fcntl.h.html"><i><fcntl.h></i></a>, <a href=
|
|
"../basedefs/nl_types.h.html"><i><nl_types.h></i></a>, the Shell and Utilities volume of IEEE Std 1003.1-2001</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_58_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 2.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|