Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/linux/include/wordexp.h')
-rw-r--r--newlib/libc/sys/linux/include/wordexp.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/newlib/libc/sys/linux/include/wordexp.h b/newlib/libc/sys/linux/include/wordexp.h
new file mode 100644
index 000000000..5bc3d00f8
--- /dev/null
+++ b/newlib/libc/sys/linux/include/wordexp.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <sys/types.h>
+
+struct _wordexp_t
+{
+ size_t we_wordc; /* Count of words matched by words. */
+ char **we_wordv; /* Pointer to list of expanded words. */
+ size_t we_offs; /* Slots to reserve at the beginning of we_wordv. */
+};
+
+typedef struct _wordexp_t wordexp_t;
+
+#define WRDE_DOOFFS 0x0001 /* Use we_offs. */
+#define WRDE_APPEND 0x0002 /* Append to output from previous call. */
+#define WRDE_NOCMD 0x0004 /* Don't perform command substitution. */
+#define WRDE_REUSE 0x0008 /* pwordexp points to a wordexp_t struct returned from
+ a previous successful call to wordexp. */
+#define WRDE_SHOWERR 0x0010 /* Print error messages to stderr. */
+#define WRDE_UNDEF 0x0020 /* Report attempt to expand undefined shell variable. */
+
+enum {
+ WRDE_SUCCESS,
+ WRDE_NOSPACE,
+ WRDE_BADCHAR,
+ WRDE_BADVAL,
+ WRDE_CMDSUB,
+ WRDE_SYNTAX,
+ WRDE_NOSYS
+};
+
+/* Note: This implementation of wordexp requires a version of bash
+ that supports the --wordexp and --protected arguments to be present
+ on the system. It does not support the WRDE_UNDEF flag. */
+int wordexp(const char *, wordexp_t *, int);
+void wordfree(wordexp_t *);