1wordexp.h(0P) POSIX Programmer's Manual wordexp.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 wordexp.h — word-expansion types
14
16 #include <wordexp.h>
17
19 The <wordexp.h> header shall define the structures and symbolic con‐
20 stants used by the wordexp() and wordfree() functions.
21
22 The <wordexp.h> header shall define the wordexp_t structure type, which
23 shall include at least the following members:
24
25 size_t we_wordc Count of words matched by words.
26 char **we_wordv Pointer to list of expanded words.
27 size_t we_offs Slots to reserve at the beginning of we_wordv.
28
29 The <wordexp.h> header shall define the following symbolic constants
30 for use as flags for the wordexp() function:
31
32 WRDE_APPEND Append words to those previously generated.
33
34 WRDE_DOOFFS Number of null pointers to prepend to we_wordv.
35
36 WRDE_NOCMD Fail if command substitution is requested.
37
38 WRDE_REUSE The pwordexp argument was passed to a previous successful
39 call to wordexp(), and has not been passed to wordfree().
40 The result is the same as if the application had called
41 wordfree() and then called wordexp() without WRDE_REUSE.
42
43 WRDE_SHOWERR Do not redirect stderr to /dev/null.
44
45 WRDE_UNDEF Report error on an attempt to expand an undefined shell
46 variable.
47
48 The <wordexp.h> header shall define the following symbolic constants as
49 error return values:
50
51 WRDE_BADCHAR One of the unquoted characters—<newline>, '|', '&', ';',
52 '<', '>', '(', ')', '{', '}'—appears in words in an inap‐
53 propriate context.
54
55 WRDE_BADVAL Reference to undefined shell variable when WRDE_UNDEF is
56 set in flags.
57
58 WRDE_CMDSUB Command substitution requested when WRDE_NOCMD was set in
59 flags.
60
61 WRDE_NOSPACE Attempt to allocate memory failed.
62
63 WRDE_SYNTAX Shell syntax error, such as unbalanced parentheses or
64 unterminated string.
65
66 The <wordexp.h> header shall define the size_t type as described in
67 <stddef.h>.
68
69 The following shall be declared as functions and may also be defined as
70 macros. Function prototypes shall be provided.
71
72 int wordexp(const char *restrict, wordexp_t *restrict, int);
73 void wordfree(wordexp_t *);
74
75 The following sections are informative.
76
78 None.
79
81 None.
82
84 None.
85
87 <stddef.h>
88
89 The System Interfaces volume of POSIX.1‐2008, Section 2.6, Word Expan‐
90 sions
91
93 Portions of this text are reprinted and reproduced in electronic form
94 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
95 -- Portable Operating System Interface (POSIX), The Open Group Base
96 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
97 cal and Electronics Engineers, Inc and The Open Group. (This is
98 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
99 event of any discrepancy between this version and the original IEEE and
100 The Open Group Standard, the original IEEE and The Open Group Standard
101 is the referee document. The original Standard can be obtained online
102 at http://www.unix.org/online.html .
103
104 Any typographical or formatting errors that appear in this page are
105 most likely to have been introduced during the conversion of the source
106 files to man page format. To report such errors, see https://www.ker‐
107 nel.org/doc/man-pages/reporting_bugs.html .
108
109
110
111IEEE/The Open Group 2013 wordexp.h(0P)