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>C Specification</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/nand.h&gt;
18
19#define NAND_SEEK_SET          0
20#define NAND_SEEK_CUR          1
21#define NAND_SEEK_END          2
22
23s32 NANDSeek(NANDFileInfo *info, s32 offset, s32 whence);
24</code></pre></dd></dl>
25
26<h2>Arguments</h2>
27<p>
28<TABLE border="1" >
29  <tr>
30<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>info</EM></STRONG></CODE></TD>
31<TD width="520">Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD>
32  </tr>
33  <tr>
34<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>offset</EM></STRONG></CODE></TD>
35<TD width="520">Specifies the offset value The size is given in bytes.</TD>
36  </tr>
37  <tr>
38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>whence</EM></STRONG></CODE></TD>
39<TD width="520">Specifies the seek base position.
40        <table border="1" cellspacing="0.1" width="400">
41          <tr>
42<td width="150"><code>NAND_SEEK_SET</code></td>
43<td>Start of file.</td>
44          </tr>
45          <tr>
46<td width="150"><code>NAND_SEEK_CUR</code></td>
47<td>Current position of file.</td>
48          </tr>
49          <tr>
50<td width="150"><code>NAND_SEEK_END</code></td>
51<td>End of file.</td>
52          </tr>
53        </table>
54    </TD>
55  </tr>
56</TABLE>
57</p>
58
59<h2>Return Values</h2>
60<p>
61Returns the seek target position when seek is successful. When seek fails, one of the following codes is returned:
62<p>
63<code>NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_INVALID<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code>
64</p>
65</p>
66
67<H2>Description</H2>
68<p>
69Does a file seek. The start position of the next read/write is the <STRONG><EM><code>offset</code></EM></STRONG> plus <STRONG><EM><code>whence</code></EM></STRONG>. If the <STRONG><EM><code>offset</code></EM></STRONG> value is positive, the seek position moves from the base point to the end of the file. If the value is negative, the seek position moves from the base point toward the start of the file.
70</p>
71
72<p>
73This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
74</p>
75
76<h2>See Also</h2>
77<p>
78<code><a href="./NANDSeekAsync.html">NANDSeekAsync</a></code>, <code><a href="./NANDRead.html">NANDRead</a></code>, <code><a href="./NANDReadAsync.html">NANDReadAsync</a></code>, <code><a href="./NANDWrite.html">NANDWrite</a></code>, <code><a href="./NANDWriteAsync.html">NANDWriteAsync</a></code>, <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
79</p>
80
81<H2>Revision History</H2>
82<p>
832007/09/25 Added information on the sleep status of threads.<br>2006/11/30 Added <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/06/16 Initial version.<br>
84</p>
85
86
87<hr><p>CONFIDENTIAL</p></body>
88</html>
89