]> wimlib.net Git - wimlib/blobdiff - include/wimlib/file_io.h
Adjust endianness detection
[wimlib] / include / wimlib / file_io.h
index de59cfa07d8b9be48d0a1efcb123c1b5f1723c91..549dc5e43392f7a360ce4feaab25df01382ed6e9 100644 (file)
@@ -3,7 +3,11 @@
 
 #include <stddef.h>
 #include <sys/types.h>
+#include <stdbool.h>
 
+/* Wrapper around a file descriptor that keeps track of offset (including in
+ * pipes, which don't support lseek()) and a cached flag that tells whether the
+ * file descriptor is a pipe or not.  */
 struct filedes {
        int fd;
        unsigned int is_pipe : 1;
@@ -28,18 +32,6 @@ raw_pread(struct filedes *fd, void *buf, size_t nbyte, off_t offset);
 extern ssize_t
 raw_pwrite(struct filedes *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 int
-full_writev(struct filedes *fd, struct iovec *iov, int iovcnt);
-
 #ifndef __WIN32__
 #  define O_BINARY 0
 #endif
@@ -62,11 +54,6 @@ static inline void filedes_invalidate(struct filedes *fd)
        fd->fd = -1;
 }
 
-static inline void filedes_copy(struct filedes *dst, const struct filedes *src)
-{
-       *dst = *src;
-}
-
 #define filedes_close(f) close((f)->fd)
 
 static inline bool