51e2f3f208c9d0b274cf3457cf4febb151c470ba
[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 add_image_params *params);
12
13 extern int
14 win32_get_file_and_vol_ids(const wchar_t *path, u64 *ino_ret, u64 *dev_ret);
15
16 extern int
17 win32_read_file(const tchar *filename, HANDLE handle,
18                 u64 offset, size_t size, void *buf);
19
20 extern int
21 read_win32_file_prefix(const struct wim_lookup_table_entry *lte,
22                        u64 size,
23                        consume_data_callback_t cb,
24                        void *ctx_or_buf,
25                        int _ignored_flags);
26
27 extern int
28 read_win32_encrypted_file_prefix(const struct wim_lookup_table_entry *lte,
29                                  u64 size,
30                                  consume_data_callback_t cb,
31                                  void *ctx_or_buf,
32                                  int _ignored_flags);
33
34 #define FNM_PATHNAME 0x1
35 #define FNM_NOESCAPE 0x2
36 #define FNM_NOMATCH 1
37 extern int
38 fnmatch(const tchar *pattern, const tchar *string, int flags);
39
40 extern int
41 win32_do_apply_dentry(const tchar *output_path,
42                       size_t output_path_nbytes,
43                       struct wim_dentry *dentry,
44                       struct apply_args *args);
45
46 extern int
47 win32_do_apply_dentry_timestamps(const tchar *output_path,
48                                  size_t output_path_nbytes,
49                                  const struct wim_dentry *dentry,
50                                  const struct apply_args *args);
51
52 extern int
53 fsync(int fd);
54
55 extern unsigned
56 win32_get_number_of_processors();
57
58 extern tchar *
59 realpath(const tchar *path, tchar *resolved_path);
60
61 typedef enum {
62         CODESET
63 } nl_item;
64
65 extern int
66 win32_rename_replacement(const tchar *oldpath, const tchar *newpath);
67
68 extern int
69 win32_truncate_replacement(const tchar *path, off_t size);
70
71 extern void
72 win32_global_init();
73
74 extern void
75 win32_global_cleanup();
76
77 extern int
78 win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen);
79
80 extern ssize_t
81 win32_pread(int fd, void *buf, size_t count, off_t offset);
82
83 extern ssize_t
84 win32_pwrite(int fd, const void *buf, size_t count, off_t offset);
85
86 extern ssize_t
87 win32_writev(int fd, const struct iovec *iov, int iovcnt);
88
89 #endif /* _WIMLIB_WIN32_H */