Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / include / wordexp.h
blob1f09a64c5edb22c2cb577b79f8033e099b3a102a
1 /* Copyright (C) 2002, 2010 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
7 #ifndef _WORDEXP_H_
8 #define _WORDEXP_H_
10 #include <sys/types.h>
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 struct _wordexp_t
18 size_t we_wordc; /* Count of words matched by words. */
19 char **we_wordv; /* Pointer to list of expanded words. */
20 size_t we_offs; /* Slots to reserve at the beginning of we_wordv. */
23 typedef struct _wordexp_t wordexp_t;
25 #define WRDE_DOOFFS 0x0001 /* Use we_offs. */
26 #define WRDE_APPEND 0x0002 /* Append to output from previous call. */
27 #define WRDE_NOCMD 0x0004 /* Don't perform command substitution. */
28 #define WRDE_REUSE 0x0008 /* pwordexp points to a wordexp_t struct returned from
29 a previous successful call to wordexp. */
30 #define WRDE_SHOWERR 0x0010 /* Print error messages to stderr. */
31 #define WRDE_UNDEF 0x0020 /* Report attempt to expand undefined shell variable. */
33 enum {
34 WRDE_SUCCESS,
35 WRDE_NOSPACE,
36 WRDE_BADCHAR,
37 WRDE_BADVAL,
38 WRDE_CMDSUB,
39 WRDE_SYNTAX,
40 WRDE_NOSYS
43 /* Note: This implementation of wordexp requires a version of bash
44 that supports the --wordexp and --protected arguments to be present
45 on the system. It does not support the WRDE_UNDEF flag. */
46 int wordexp(const char *__restrict, wordexp_t *__restrict, int);
47 void wordfree(wordexp_t *);
49 #ifdef __cplusplus
51 #endif
53 #endif /* _WORDEXP_H_ */