aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/glob.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/posix/include/glob.h
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/include/glob.h')
-rw-r--r--lib/mlibc/options/posix/include/glob.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/mlibc/options/posix/include/glob.h b/lib/mlibc/options/posix/include/glob.h
new file mode 100644
index 0000000..2bf9e48
--- /dev/null
+++ b/lib/mlibc/options/posix/include/glob.h
@@ -0,0 +1,58 @@
+
+#ifndef _GLOB_H
+#define _GLOB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <bits/size_t.h>
+
+#define GLOB_APPEND 0x01
+#define GLOB_DOOFFS 0x02
+#define GLOB_ERR 0x04
+#define GLOB_MARK 0x08
+#define GLOB_NOCHECK 0x10
+#define GLOB_NOESCAPE 0x20
+#define GLOB_NOSORT 0x40
+#define GLOB_PERIOD 0x80
+#define GLOB_TILDE 0x100
+#define GLOB_TILDE_CHECK 0x200
+#define GLOB_BRACE 0x400
+#define GLOB_NOMAGIC 0x800
+#define GLOB_ALTDIRFUNC 0x1000
+#define GLOB_ONLYDIR 0x2000
+#define GLOB_MAGCHAR 0x4000
+
+#define GLOB_ABORTED 1
+#define GLOB_NOMATCH 2
+#define GLOB_NOSPACE 3
+#define GLOB_NOSYS 4
+
+struct stat;
+typedef struct glob_t {
+ size_t gl_pathc;
+ char **gl_pathv;
+ size_t gl_offs;
+ int gl_flags;
+ void (*gl_closedir) (void *);
+ struct dirent *(*gl_readdir) (void *);
+ void *(*gl_opendir) (const char *);
+ int (*gl_lstat) (const char *__restrict, struct stat *__restrict);
+ int (*gl_stat) (const char *__restrict, struct stat *__restrict);
+} glob_t;
+
+#ifndef __MLIBC_ABI_ONLY
+
+int glob(const char *__restirct, int, int(*)(const char *, int), struct glob_t *__restrict);
+void globfree(struct glob_t *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GLOB_H
+
+