aboutsummaryrefslogtreecommitdiff
path: root/win32/glob.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/glob.h')
-rw-r--r--win32/glob.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/win32/glob.h b/win32/glob.h
new file mode 100644
index 000000000..a8141b8bf
--- /dev/null
+++ b/win32/glob.h
@@ -0,0 +1,89 @@
1/*
2 glob from musl (https://www.musl-libc.org/).
3
4 MIT licensed:
5
6----------------------------------------------------------------------
7Copyright © 2005-2020 Rich Felker, et al.
8
9Permission is hereby granted, free of charge, to any person obtaining
10a copy of this software and associated documentation files (the
11"Software"), to deal in the Software without restriction, including
12without limitation the rights to use, copy, modify, merge, publish,
13distribute, sublicense, and/or sell copies of the Software, and to
14permit persons to whom the Software is furnished to do so, subject to
15the following conditions:
16
17The above copyright notice and this permission notice shall be
18included in all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27----------------------------------------------------------------------
28*/
29#ifndef _GLOB_H
30#define _GLOB_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36typedef struct {
37 size_t gl_pathc;
38 char **gl_pathv;
39 size_t gl_offs;
40 int __dummy1;
41 void *__dummy2[5];
42} glob_t;
43
44int glob(const char *__restrict, int, int (*)(const char *, int), glob_t *__restrict);
45void globfree(glob_t *);
46
47#if ENABLE_PLATFORM_MINGW32
48// Set some flags to zero so the compiler can exclude unused code.
49#define GLOB_ERR 0
50#define GLOB_MARK 0
51#define GLOB_NOSORT 0x04
52#define GLOB_DOOFFS 0
53#define GLOB_NOCHECK 0x10
54#define GLOB_APPEND 0
55#define GLOB_NOESCAPE 0x40
56#define GLOB_PERIOD 0
57
58#define GLOB_TILDE 0
59#define GLOB_TILDE_CHECK 0
60#else
61#define GLOB_ERR 0x01
62#define GLOB_MARK 0x02
63#define GLOB_NOSORT 0x04
64#define GLOB_DOOFFS 0x08
65#define GLOB_NOCHECK 0x10
66#define GLOB_APPEND 0x20
67#define GLOB_NOESCAPE 0x40
68#define GLOB_PERIOD 0x80
69
70#define GLOB_TILDE 0x1000
71#define GLOB_TILDE_CHECK 0x4000
72#endif
73
74#define GLOB_NOSPACE 1
75#define GLOB_ABORTED 2
76#define GLOB_NOMATCH 3
77#define GLOB_NOSYS 4
78
79#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
80#define glob64 glob
81#define globfree64 globfree
82#define glob64_t glob_t
83#endif
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif