1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>NANDSeek</title> 9</head> 10 11<body> 12 13<h1>NANDSeek</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction">#include <revolution/nand.h> 17 18#define NAND_SEEK_SET 0 19#define NAND_SEEK_CUR 1 20#define NAND_SEEK_END 2 21 22s32 NANDSeek(NANDFileInfo *info, s32 offset, s32 whence); 23</pre></dd></dl> 24 25<h2>Arguments</h2> 26<p> 27<TABLE class="arguments" border="1" > 28 <tr> 29<TH>info</TH> 30<TD>Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD> 31 </tr> 32 <tr> 33<TH>offset</TH> 34<TD>Specifies the offset value. The size is given in bytes.</TD> 35 </tr> 36 <tr> 37<TH>whence</TH> 38<TD>Specifies the seek base position. 39 <TABLE class="arguments" border="1" > 40 <tr> 41<th>NAND_SEEK_SET</th> 42<td>Start of file.</td> 43 </tr> 44 <tr> 45<th>NAND_SEEK_CUR</th> 46<td>Current position of file.</td> 47 </tr> 48 <tr> 49<th>NAND_SEEK_END</th> 50<td>End of file.</td> 51 </tr> 52 </table> 53 </TD> 54 </tr> 55</TABLE> 56</p> 57 58<h2>Return Values</h2> 59<p> 60Returns the seek target position when seek is successful. When seek fails, one of the following codes is returned: 61<p> 62<code> 63NAND_RESULT_ACCESS<br> 64NAND_RESULT_ALLOC_FAILED<br> 65NAND_RESULT_BUSY<br> 66NAND_RESULT_INVALID<br> 67NAND_RESULT_UNKNOWN<br> 68NAND_RESULT_FATAL_ERROR<br> 69</code> 70</p> 71</p> 72 73<H2>Description</H2> 74<p> 75Performs file seek. The start position of the next read/write is the location obtained by adding the value of <STRONG><EM><code>offset</code></EM></STRONG> to the base point specified by the <STRONG><EM><code>whence</code></EM></STRONG> argument. If the <SPAN class="argument">offset</SPAN> value is positive, the seek position moves from the base point to the file's end. If the value is negative, the seek position moves from the base point toward the file's start. 76</p> 77 78<p> 79This function may put the current thread to sleep. For precautions related to calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 80</p> 81 82<h2>See Also</h2> 83<p class="reference"> 84<a href="./NANDSeekAsync.html">NANDSeekAsync</a>, 85<a href="./NANDRead.html">NANDRead</a>, 86<a href="./NANDReadAsync.html">NANDReadAsync</a>, 87<a href="./NANDWrite.html">NANDWrite</a>, 88<a href="./NANDWriteAsync.html">NANDWriteAsync</a>, 89<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 90</p> 91 92<H2>Revision History</H2> 93<p> 942007/09/25 Added information about the sleep status of threads.<br>2006/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/06/16 Initial version.<BR> 95</p> 96 97<hr><p>CONFIDENTIAL</p></body> 98</html>