/* ** fr_seek ** ** Seek in a file. ** ** INPUT : *filehandle - pointer to a file descriptor ** offset - offset ** whence - F_SEEK_SET: position = offset ** F_SEEK_CUR: position = position + offset ** F_SEEK_END: position = end of file (offset=0) ** RETURN: F_NOERR on succes, other if error. */ unsigned char fr_seek ( F_FILE * filehandle, long offset, unsigned char whence ) { unsigned char rc; if( xSemaphoreTake( fs_lock_semaphore, F_MAX_LOCK_WAIT_TICKS ) == pdPASS ) { rc = fn_seek( filehandle, offset, whence ); xSemaphoreGive( fs_lock_semaphore ); } else { rc = F_ERR_OS; } return rc; }
unsigned char fn_rewind ( F_FILE * filehandle ) { return fn_seek( filehandle, 0L, F_SEEK_SET ); }