X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Futil.h;h=3d22cf40101009f5f65722681f87208a0aa55c25;hb=794ecd09fc527e3328e469c14e563d42a7a70a39;hp=ee9598e0909d1f0176595e20e41c10b449509c44;hpb=a4afe5a6e7fc70b3e73022f4911e7a60d67a7675;p=wimlib diff --git a/src/util.h b/src/util.h index ee9598e0..3d22cf40 100644 --- a/src/util.h +++ b/src/util.h @@ -129,7 +129,7 @@ tstr_to_utf8_simple(const tchar *tstr, char **out); #define ZERO_ARRAY(array) memset(array, 0, sizeof(array)) /* Used for buffering FILE IO in a few places */ -#define BUFFER_SIZE 4096 +#define BUFFER_SIZE 32768 static inline void FORMAT(printf, 1, 2) dummy_tprintf(const tchar *format, ...) @@ -279,10 +279,47 @@ wimlib_printf(const tchar *format, ...) FORMAT(printf, 1, 2); extern void zap_backslashes(tchar *s); +extern tchar * +canonicalize_wim_path(const tchar *wim_path); + +extern tchar * +canonicalize_fs_path(const tchar *fs_path); + static inline u64 hash_u64(u64 n) { return n * 0x9e37fffffffc0001ULL; } +extern size_t +full_read(int fd, void *buf, size_t n); + +extern size_t +full_write(int fd, const void *buf, size_t n); + +extern size_t +full_pread(int fd, void *buf, size_t nbyte, off_t offset); + +extern size_t +full_pwrite(int fd, const void *buf, size_t count, off_t offset); + +#ifdef __WIN32__ +struct iovec { + void *iov_base; + size_t iov_len; +}; +#else +struct iovec; +#endif + +extern size_t +full_writev(int fd, struct iovec *iov, int iovcnt); + +extern off_t +filedes_offset(int fd); + +#ifndef __WIN32__ +# define O_BINARY 0 +#endif + #endif /* _WIMLIB_UTIL_H */