]> wimlib.net Git - wimlib/blob - include/wimlib/win32.h
Make win32.h includable on non-Windows
[wimlib] / include / wimlib / win32.h
1 #ifndef _WIMLIB_WIN32_H
2 #define _WIMLIB_WIN32_H
3
4 #ifdef __WIN32__
5
6 #include "wimlib/callback.h"
7 #include "wimlib/types.h"
8
9 struct blob_descriptor;
10
11 extern int
12 read_winnt_stream_prefix(const struct blob_descriptor *blob, u64 size,
13                          consume_data_callback_t cb, void *cb_ctx);
14
15 extern int
16 read_win32_encrypted_file_prefix(const struct blob_descriptor *blob,
17                                  u64 size,
18                                  consume_data_callback_t cb,
19                                  void *cb_ctx);
20
21 extern int
22 win32_global_init(int init_flags);
23
24 extern void
25 win32_global_cleanup(void);
26
27 extern int
28 fsync(int fd);
29
30 extern unsigned
31 win32_get_number_of_processors(void);
32
33 extern u64
34 win32_get_avail_memory(void);
35
36 extern tchar *
37 realpath(const tchar *path, tchar *resolved_path);
38
39 extern int
40 win32_rename_replacement(const tchar *oldpath, const tchar *newpath);
41
42 extern int
43 win32_truncate_replacement(const tchar *path, off_t size);
44
45 extern int
46 win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen);
47
48 extern FILE *
49 win32_open_logfile(const wchar_t *path);
50
51 extern ssize_t
52 pread(int fd, void *buf, size_t count, off_t offset);
53
54 extern ssize_t
55 pwrite(int fd, const void *buf, size_t count, off_t offset);
56
57 #endif /* __WIN32__ */
58
59 #endif /* _WIMLIB_WIN32_H */