1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "<wordexp.h>" P 2003 POSIX
.\" <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 .
|