diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2017-04-05 18:47:22 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2017-04-05 18:47:22 +0300 |
commit | c28f0b3d00af87b92dda229831548d8eb0067d1d (patch) | |
tree | ab2aa7f93c98a2ad9a5dfcdd705cbb061bf00ce2 /src/xz/file_io.h | |
parent | xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. (diff) | |
download | xz-c28f0b3d00af87b92dda229831548d8eb0067d1d.tar.xz |
xz: Add io_seek_src().
Diffstat (limited to 'src/xz/file_io.h')
-rw-r--r-- | src/xz/file_io.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xz/file_io.h b/src/xz/file_io.h index 6722aef8..84d5b44d 100644 --- a/src/xz/file_io.h +++ b/src/xz/file_io.h @@ -129,6 +129,19 @@ extern size_t io_read(file_pair *pair, io_buf *buf, size_t size); extern void io_fix_src_pos(file_pair *pair, size_t rewind_size); +/// \brief Seek to the given absolute position in the source file +/// +/// This calls lseek() and also clears pair->src_eof. +/// +/// \param pair Seekable source file +/// \param pos Offset relative to the beginning of the file, +/// from which the data should be read. +/// +/// \return On success, false is returned. On error, error message +/// is printed and true is returned. +extern bool io_seek_src(file_pair *pair, off_t pos); + + /// \brief Read from source file from given offset to a buffer /// /// This is remotely similar to standard pread(). This uses lseek() though, |