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><STRONG><EM><CODE>info</CODE></EM></STRONG></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><STRONG><EM><CODE>offset</CODE></EM></STRONG></EM></STRONG></CODE></TD>
35<TD width="520">Specifies the offset value. In unit of bytes. </TD>
36  </tr>
37  <tr>
38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>whence</CODE></EM></STRONG></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 new position in the file if the seek is successful. If the seek fails, one of the following codes is returned:
62<p>
63<code>NAND_RESULT_ACCESS<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<h2>See Also</h2>
73<p>
74<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>
75</p>
76
77<H2>Revision History</H2>
78<p>06/16/2006 Initial version.</p>
79
80
81</body>
82</html>
83