.\"Copyright 2010 (c) EPFL .TH XDF_SEEK 3 2010 "EPFL" "xdffileio library manual" .SH NAME xdf_seek - move the sample pointer of a xDF file .SH SYNOPSIS .LP .B #include .sp .BI "off_t xdf_seek(struct xdf* " xdf ", off_t " offset ", int " whence ");" .br .SH DESCRIPTION .LP \fBxdf_seek\fP() repositions the current sample pointer according to the couple (\fIoffset\fP,\fIwhence\fP) where \fIwhence\fP can be: .TP 7 .B SEEK_SET The offset is set to \fIoffset\fP bytes. .TP 7 .B SEEK_CUR The offset is set to its current location plus \fIoffset\fP bytes. .TP 7 .B SEEK_END The offset is set to the size of the file plus \fIoffset\fP bytes. .LP The file referenced by \fIxdf\fP should have been opened with mode \fBXDF_READ\fP and \fBxdf_prepare_arrays\fP(3) should have been successfully called on it. .SH "RETURN VALUE" .LP Upon successful completion, \fBxdf_seek\fP() returns the resulting offset location as measured in number of samples from the beginning of the recording. Otherwise, a value of \-1 is returned and \fIerrno\fP is set to indicate the error. .SH ERRORS .TP 7 .B EINVAL \fIxdf\fP is NULL or \fIwhence\fP is none of the allowed values. .TP 7 .B EPERM No successfull call to \fBxdf_prepare_transfer\fP(3) have been done on \fIxdf\fP or it has been opened using the mode \fBXDF_WRITE\fP. .TP 7 .B ERANGE The requested offset is out of the range of the recording. .TP 7 .B EINTR The call was interrupted by a signal before any data was read; see \fBsignal\fP(7). .TP 7 .B EIO A low-level I/O error occurred while reading from the inode. .TP 7 .B ESTALE Stale file handle. This error can occur for NFS and for other file systems .SH "SEE ALSO" .BR xdf_define_arrays (3), .BR xdf_prepare_transfer (3)