190 lines
6.1 KiB
HTML
190 lines
6.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><wordexp.h></title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="<wordexp.h>"></a> <a name="tag_13_85"></a><!-- <wordexp.h> -->
|
|
<!--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_13_85_01"></a>NAME</h4>
|
|
|
|
<blockquote>wordexp.h - word-expansion types</blockquote>
|
|
|
|
<h4><a name="tag_13_85_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<p><tt>#include <wordexp.h></tt></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i><wordexp.h></i> header shall define the structures and symbolic constants used by the <a href=
|
|
"../functions/wordexp.html"><i>wordexp</i>()</a> and <a href="../functions/wordfree.html"><i>wordfree</i>()</a> functions.</p>
|
|
|
|
<p>The structure type <b>wordexp_t</b> shall contain at least the following members:</p>
|
|
|
|
<pre>
|
|
<tt>size_t we_wordc </tt> Count of words matched by <i>words.</i> <tt>
|
|
char **we_wordv </tt> Pointer to list of expanded words. <tt>
|
|
size_t we_offs </tt> Slots to reserve at the beginning of <i>we_wordv.</i> <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <i>flags</i> argument to the <a href="../functions/wordexp.html"><i>wordexp</i>()</a> function shall be the
|
|
bitwise-inclusive OR of the following flags:</p>
|
|
|
|
<dl compact>
|
|
<dt>WRDE_APPEND</dt>
|
|
|
|
<dd>Append words to those previously generated.</dd>
|
|
|
|
<dt>WRDE_DOOFFS</dt>
|
|
|
|
<dd>Number of null pointers to prepend to <i>we_wordv</i>.</dd>
|
|
|
|
<dt>WRDE_NOCMD</dt>
|
|
|
|
<dd>Fail if command substitution is requested.</dd>
|
|
|
|
<dt>WRDE_REUSE</dt>
|
|
|
|
<dd>The <i>pwordexp</i> argument was passed to a previous successful call to <a href=
|
|
"../functions/wordexp.html"><i>wordexp</i>()</a>, and has not been passed to <a href=
|
|
"../functions/wordfree.html"><i>wordfree</i>()</a>. The result is the same as if the application had called <a href=
|
|
"../functions/wordfree.html"><i>wordfree</i>()</a> and then called <a href="../functions/wordexp.html"><i>wordexp</i>()</a> without
|
|
WRDE_REUSE.</dd>
|
|
|
|
<dt>WRDE_SHOWERR</dt>
|
|
|
|
<dd>Do not redirect <i>stderr</i> to <b>/dev/null</b>.</dd>
|
|
|
|
<dt>WRDE_UNDEF</dt>
|
|
|
|
<dd>Report error on an attempt to expand an undefined shell variable.</dd>
|
|
</dl>
|
|
|
|
<p>The following constants shall be defined as error return values:</p>
|
|
|
|
<dl compact>
|
|
<dt>WRDE_BADCHAR</dt>
|
|
|
|
<dd>One of the unquoted characters- <newline>, <tt>'|'</tt> , <tt>'&'</tt> , <tt>';'</tt> , <tt>'<'</tt> ,
|
|
<tt>'>'</tt> , <tt>'('</tt> , <tt>')'</tt> , <tt>'{'</tt> , <tt>'}'</tt> - appears in <i>words</i> in an inappropriate
|
|
context.</dd>
|
|
|
|
<dt>WRDE_BADVAL</dt>
|
|
|
|
<dd>Reference to undefined shell variable when WRDE_UNDEF is set in <i>flags</i>.</dd>
|
|
|
|
<dt>WRDE_CMDSUB</dt>
|
|
|
|
<dd>Command substitution requested when WRDE_NOCMD was set in <i>flags</i>.</dd>
|
|
|
|
<dt>WRDE_NOSPACE</dt>
|
|
|
|
<dd>Attempt to allocate memory failed.</dd>
|
|
|
|
<dt>WRDE_NOSYS</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('OB XSI')">OB XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"
|
|
border="0"> Reserved. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>WRDE_SYNTAX</dt>
|
|
|
|
<dd>Shell syntax error, such as unbalanced parentheses or unterminated string.</dd>
|
|
</dl>
|
|
|
|
<p>The <i><wordexp.h></i> header shall define the following type:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>size_t</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
As described in <a href="stddef.h.html"><i><stddef.h></i></a> . <img src="../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></dd>
|
|
</dl>
|
|
|
|
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
|
|
|
|
<pre>
|
|
<tt>int wordexp(const char *restrict, wordexp_t *restrict, int);
|
|
void wordfree(wordexp_t *);
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The implementation may define additional macros or constants using names beginning with WRDE_.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_13_85_04"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_05"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_06"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_07"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="stddef.h.html"><i><stddef.h></i></a> , the System Interfaces volume of IEEE Std 1003.1-2001, <a href=
|
|
"../functions/wordexp.html"><i>wordexp</i>()</a>, the Shell and Utilities volume of IEEE Std 1003.1-2001</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_08"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4. Derived from the ISO POSIX-2 standard.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_85_09"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>The <b>restrict</b> keyword is added to the prototype for <a href="../functions/wordexp.html"><i>wordexp</i>()</a>.</p>
|
|
|
|
<p>The WRDE_NOSYS constant is marked obsolescent.</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>
|
|
|