1wordexp.h(0P)              POSIX Programmer's Manual             wordexp.h(0P)
2
3
4

PROLOG

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

NAME

12       wordexp.h — word-expansion types
13

SYNOPSIS

15       #include <wordexp.h>
16

DESCRIPTION

18       The <wordexp.h> header shall define the structures  and  symbolic  con‐
19       stants used by the wordexp() and wordfree() functions.
20
21       The <wordexp.h> header shall define the wordexp_t structure type, which
22       shall include at least the following members:
23
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
73           int  wordexp(const char *restrict, wordexp_t *restrict, int);
74           void wordfree(wordexp_t *);
75
76       The following sections are informative.
77

APPLICATION USAGE

79       None.
80

RATIONALE

82       None.
83

FUTURE DIRECTIONS

85       None.
86

SEE ALSO

88       <stddef.h>
89
90       The  System Interfaces volume of POSIX.1‐2017, Section 2.6, Word Expan‐
91       sions
92
94       Portions of this text are reprinted and reproduced in  electronic  form
95       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
96       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
97       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
98       Electrical and Electronics Engineers, Inc and The Open Group.   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.opengroup.org/unix/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                  2017                        wordexp.h(0P)
Impressum