mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-05 04:27:51 +00:00
Add initial POSIX support for Linux for wordexp.
This commit is contained in:
@@ -102,6 +102,27 @@ when ODIN_OS == .Darwin {
|
||||
WRDE_NOSPACE :: 4
|
||||
WRDE_SYNTAX :: 6
|
||||
|
||||
} else when ODIN_OS == .Linux {
|
||||
|
||||
wordexp_t :: struct {
|
||||
we_wordc: c.size_t, /* [PSX] count of words matched by words */
|
||||
we_wordv: [^]cstring, /* [PSX] pointer to list of expanded words */
|
||||
we_offs: c.size_t, /* [PSX] slots to reserve at the beginning of we_wordv */
|
||||
}
|
||||
|
||||
WRDE_DOOFFS :: 1 << 0 /* Insert PWORDEXP->we_offs NULLs. */
|
||||
WRDE_APPEND :: 1 << 1 /* Append to results of a previous call. */
|
||||
WRDE_NOCMD :: 1 << 2 /* Don't do command substitution. */
|
||||
WRDE_REUSE :: 1 << 3 /* Reuse storage in PWORDEXP. */
|
||||
WRDE_SHOWERR :: 1 << 4 /* Don't redirect stderr to /dev/null. */
|
||||
WRDE_UNDEF :: 1 << 5 /* Error for expanding undefined variables. */
|
||||
|
||||
WRDE_NOSPACE :: 1
|
||||
WRDE_BADCHAR :: 2
|
||||
WRDE_BADVAL :: 3
|
||||
WRDE_CMDSUB :: 4
|
||||
WRDE_SYNTAX :: 5
|
||||
|
||||
} else {
|
||||
#panic("posix is unimplemented for the current target")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user