Replace _wcserror_s for Windows XP compatibility
[wimlib] / src / win32.h
1 #ifndef _WIMLIB_WIN32_H
2 #define _WIMLIB_WIN32_H
3
4 #include "wimlib_internal.h"
5 #include <direct.h>
6 #include <windef.h>
7
8 extern int
9 win32_build_dentry_tree(struct wim_dentry **root_ret,
10                         const tchar *root_disk_path,
11                         struct wim_lookup_table *lookup_table,
12                         struct sd_set *sd,
13                         const struct wimlib_capture_config *config,
14                         int add_image_flags,
15                         wimlib_progress_func_t progress_func,
16                         void *extra_arg);
17
18 extern int
19 win32_read_file(const tchar *filename, HANDLE handle,
20                 u64 offset, size_t size, void *buf);
21
22 extern HANDLE
23 win32_open_file_data_only(const wchar_t *path_utf16);
24
25 extern void
26 win32_close_file(void *handle);
27
28 #ifdef ENABLE_ERROR_MESSAGES
29 extern void win32_error(u32 err);
30 extern void win32_error_last();
31 #else
32 #  define win32_error(err)
33 #  define win32_error_last()
34 #endif
35
36 #define FNM_PATHNAME 0x1
37 #define FNM_NOESCAPE 0x2
38 #define FNM_NOMATCH 1
39 extern int
40 fnmatch(const tchar *pattern, const tchar *string, int flags);
41
42 extern int
43 win32_do_apply_dentry(const tchar *output_path,
44                       size_t output_path_nbytes,
45                       struct wim_dentry *dentry,
46                       struct apply_args *args);
47
48 extern int
49 win32_do_apply_dentry_timestamps(const tchar *output_path,
50                                  size_t output_path_nbytes,
51                                  const struct wim_dentry *dentry,
52                                  const struct apply_args *args);
53
54 extern int
55 fsync(int fd);
56
57 extern unsigned
58 win32_get_number_of_processors();
59
60 extern tchar *
61 realpath(const tchar *path, tchar *resolved_path);
62
63 typedef enum {
64         CODESET
65 } nl_item;
66
67 extern int
68 win32_rename_replacement(const tchar *oldpath, const tchar *newpath);
69
70 extern int
71 win32_truncate_replacement(const tchar *path, off_t size);
72
73 extern void
74 win32_global_init();
75
76 extern void
77 win32_global_cleanup();
78
79 extern int
80 win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen);
81
82 #endif /* _WIMLIB_WIN32_H */