1<wordexp.h>(0P) POSIX Programmer's Manual <wordexp.h>(0P)
2
3
4
6 wordexp.h - word-expansion types
7
9 #include <wordexp.h>
10
12 The <wordexp.h> header shall define the structures and symbolic con‐
13 stants used by the wordexp() and wordfree() functions.
14
15 The structure type wordexp_t shall contain at least the following mem‐
16 bers:
17
18
19 size_t we_wordc Count of words matched by words.
20 char **we_wordv Pointer to list of expanded words.
21 size_t we_offs Slots to reserve at the beginning of we_wordv.
22
23 The flags argument to the wordexp() function shall be the bitwise-
24 inclusive OR of the following flags:
25
26 WRDE_APPEND
27 Append words to those previously generated.
28
29 WRDE_DOOFFS
30 Number of null pointers to prepend to we_wordv.
31
32 WRDE_NOCMD
33 Fail if command substitution is requested.
34
35 WRDE_REUSE
36 The pwordexp argument was passed to a previous successful call
37 to wordexp(), and has not been passed to wordfree(). The result
38 is the same as if the application had called wordfree() and then
39 called wordexp() without WRDE_REUSE.
40
41 WRDE_SHOWERR
42 Do not redirect stderr to /dev/null.
43
44 WRDE_UNDEF
45 Report error on an attempt to expand an undefined shell vari‐
46 able.
47
48
49 The following constants shall be defined as error return values:
50
51 WRDE_BADCHAR
52 One of the unquoted characters- <newline>, '|', '&', ';', '<',
53 '>', '(', ')', '{', '}' - appears in words in an inappropriate
54 context.
55
56 WRDE_BADVAL
57 Reference to undefined shell variable when WRDE_UNDEF is set in
58 flags.
59
60 WRDE_CMDSUB
61 Command substitution requested when WRDE_NOCMD was set in flags.
62
63 WRDE_NOSPACE
64 Attempt to allocate memory failed.
65
66 WRDE_NOSYS
67 Reserved.
68
69 WRDE_SYNTAX
70 Shell syntax error, such as unbalanced parentheses or untermi‐
71 nated string.
72
73
74 The <wordexp.h> header shall define the following type:
75
76 size_t As described in <stddef.h> .
77
78
79 The following shall be declared as functions and may also be defined as
80 macros. Function prototypes shall be provided.
81
82
83 int wordexp(const char *restrict, wordexp_t *restrict, int);
84 void wordfree(wordexp_t *);
85
86 The implementation may define additional macros or constants using
87 names beginning with WRDE_.
88
89 The following sections are informative.
90
92 None.
93
95 None.
96
98 None.
99
101 <stddef.h>, the System Interfaces volume of IEEE Std 1003.1-2001, word‐
102 exp(), the Shell and Utilities volume of IEEE Std 1003.1-2001
103
105 Portions of this text are reprinted and reproduced in electronic form
106 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
107 -- Portable Operating System Interface (POSIX), The Open Group Base
108 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
109 Electrical and Electronics Engineers, Inc and The Open Group. In the
110 event of any discrepancy between this version and the original IEEE and
111 The Open Group Standard, the original IEEE and The Open Group Standard
112 is the referee document. The original Standard can be obtained online
113 at http://www.opengroup.org/unix/online.html .
114
115
116
117IEEE/The Open Group 2003 <wordexp.h>(0P)