]> wimlib.net Git - wimlib/blob - programs/imagex-win32.h
Document handling of invalid filenames
[wimlib] / programs / imagex-win32.h
1 #ifndef _IMAGEX_WIN32_H
2 #define _IMAGEX_WIN32_H
3
4 #include <stddef.h>
5 #include <stdbool.h>
6 #include <wchar.h>
7
8 typedef struct {
9         size_t    gl_pathc;
10         wchar_t **gl_pathv;
11         size_t    gl_offs;
12 } glob_t;
13
14 /* WARNING: this is a reduced functionality replacement */
15 extern int
16 win32_wglob(const wchar_t *pattern, int flags,
17             int (*errfunc)(const wchar_t *epath, int eerrno),
18             glob_t *pglob);
19
20 extern void globfree(glob_t *pglob);
21
22 #define GLOB_ERR        0x1 /* Return on read errors.  */
23 #define GLOB_NOSORT     0x2 /* Don't sort the names.  */
24
25 /* Error returns from `glob'.  */
26 #define GLOB_NOSPACE    1       /* Ran out of memory.  */
27 #define GLOB_ABORTED    2       /* Read error.  */
28 #define GLOB_NOMATCH    3       /* No matches found.  */
29
30 extern void
31 win32_acquire_capture_privileges(void);
32
33 extern void
34 win32_release_capture_privileges(void);
35
36 extern void
37 win32_acquire_restore_privileges(void);
38
39 extern void
40 win32_release_restore_privileges(void);
41
42 extern wchar_t *
43 win32_mbs_to_wcs(const char *mbs, size_t mbs_nbytes, size_t *num_wchars_ret);
44
45 extern wchar_t *
46 win32_wbasename(wchar_t *path);
47
48 #include "wgetopt.h"
49
50 #define optarg                  woptarg
51 #define optind                  woptind
52 #define opterr                  wopterr
53 #define optopt                  woptopt
54 #define option                  woption
55
56 #define getopt_long_only        wgetopt_long_only
57 #define getopt_long             wgetopt_long
58 #define getopt                  wgetopt
59
60 #endif