⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 catopen.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 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-2003 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, 2003 Edition<br>Copyright &copy; 2001-2003 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 &lt;nl_types.h&gt;<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> argumentspecifies the name of the message catalog to be opened. If <i>name</i> contains a <tt>'/'</tt> , then <i>name</i> specifies acomplete name for the message catalog. Otherwise, the environment variable <i>NLSPATH</i> is used with <i>name</i> substituted forthe <tt>%N</tt> conversion specification (see the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a>). If <i>NLSPATH</i> exists in the environment when the processstarts, then if the process has appropriate privileges, the behavior of <i>catopen</i>() is undefined. If <i>NLSPATH</i> does notexist in the environment, or if a message catalog cannot be found in any of the components specified by <i>NLSPATH</i>, then animplementation-defined default path shall be used. This default may be affected by the setting of <i>LC_MESSAGES</i> if the valueof <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 mayinvalidate 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>&lt;fcntl.h&gt;</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 withoutregard to the <i>LC_MESSAGES</i> category. If the <i>oflag</i> argument is NL_CAT_LOCALE, the <i>LC_MESSAGES</i> category is usedto locate the message catalog (see the Base Definitions volume of IEEE&nbsp;Std&nbsp;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 themessage 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 forinternal buffer areas. The <i>catopen</i>() function may fail if there is insufficient storage space available to accommodate thesebuffers.</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. Thereforethey 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 ofIEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/fcntl.h.html"><i>&lt;fcntl.h&gt;</i></a>, <a href="../basedefs/nl_types.h.html"><i>&lt;nl_types.h&gt;</i></a>, the Shell and Utilities volume of IEEE&nbsp;Std&nbsp;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 &reg; is a registered Trademark of The Open Group.<br>POSIX &reg; 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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -