.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "<wordexp.h>" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" <wordexp.h> 
.SH NAME
wordexp.h \- word-expansion types
.SH SYNOPSIS
.LP
\fB#include <wordexp.h>\fP
.SH DESCRIPTION
.LP
The \fI<wordexp.h>\fP header shall define the structures and symbolic
constants used by the \fIwordexp\fP() and \fIwordfree\fP() functions.
.LP
The structure type \fBwordexp_t\fP shall contain at least the following
members:
.sp
.RS
.nf

\fBsize_t   we_wordc \fP Count of words matched by \fIwords.\fP \fB
char   **we_wordv \fP Pointer to list of expanded words. \fB
size_t   we_offs  \fP Slots to reserve at the beginning of \fIwe_wordv.\fP \fB
\fP
.fi
.RE
.LP
The \fIflags\fP argument to the \fIwordexp\fP() function shall be
the
bitwise-inclusive OR of the following flags:
.TP 7
WRDE_APPEND
Append words to those previously generated.
.TP 7
WRDE_DOOFFS
Number of null pointers to prepend to \fIwe_wordv\fP.
.TP 7
WRDE_NOCMD
Fail if command substitution is requested.
.TP 7
WRDE_REUSE
The \fIpwordexp\fP argument was passed to a previous successful call
to \fIwordexp\fP(), and has not been passed to \fIwordfree\fP(). The
result is the same as if the application had called \fIwordfree\fP()
and then called \fIwordexp\fP() without
WRDE_REUSE.
.TP 7
WRDE_SHOWERR
Do not redirect \fIstderr\fP to \fB/dev/null\fP.
.TP 7
WRDE_UNDEF
Report error on an attempt to expand an undefined shell variable.
.sp
.LP
The following constants shall be defined as error return values:
.TP 7
WRDE_BADCHAR
One of the unquoted characters- <newline>, \fB'|'\fP , \fB'&'\fP ,
\fB';'\fP , \fB'<'\fP ,
\fB'>'\fP , \fB'('\fP , \fB')'\fP , \fB'{'\fP , \fB'}'\fP - appears
in \fIwords\fP in an inappropriate
context.
.TP 7
WRDE_BADVAL
Reference to undefined shell variable when WRDE_UNDEF is set in \fIflags\fP.
.TP 7
WRDE_CMDSUB
Command substitution requested when WRDE_NOCMD was set in \fIflags\fP.
.TP 7
WRDE_NOSPACE
Attempt to allocate memory failed.
.TP 7
WRDE_NOSYS
Reserved. 
.TP 7
WRDE_SYNTAX
Shell syntax error, such as unbalanced parentheses or unterminated
string.
.sp
.LP
The \fI<wordexp.h>\fP header shall define the following type:
.TP 7
\fBsize_t\fP
As described in \fI<stddef.h>\fP . 
.sp
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf

\fBint  wordexp(const char *restrict, wordexp_t *restrict, int);
void wordfree(wordexp_t *);
\fP
.fi
.RE
.LP
The implementation may define additional macros or constants using
names beginning with WRDE_.
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fI<stddef.h>\fP , the System Interfaces volume of IEEE\ Std\ 1003.1-2001,
\fIwordexp\fP(), the Shell and Utilities volume of IEEE\ Std\ 1003.1-2001
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
