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>CNTReadWithOffset</title>
9</head>
10
11<body>
12
13<h1>CNTReadWithOffset</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/cnt.h&gt;
18
19s32 CNTReadWithOffset(CNTFileInfo* cf, void* addr, u32 length, s32 offset);
20
21#ifdef CNT_READ_BACKWARD_COMPATIBLE
22#define CNTRead CNTReadWithOffset
23#endif
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>cf</EM></STRONG></CODE></TD>
31<TD width="520">Pointer to the <CODE>CNTFileInfo</CODE> structure.</TD>
32  </tr>
33  <tr>
34<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>addr</EM></STRONG></CODE></TD>
35<TD width="520">Pointer to the write destination for the data that was loaded. The write buffer must be 32-byte aligned.</TD>
36  </tr>
37  <tr>
38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>length</EM></STRONG></CODE></TD>
39<TD width="520">Number of bytes to load. Must be a multiple of 32.</TD>
40  </tr>
41  <tr>
42<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>offset</EM></STRONG></CODE></TD>
43<TD width="520">File position to start loading from. Must be a multiple of 4.</TD>
44  </tr>
45</TABLE>
46</p>
47
48<h2>Return Values</h2>
49<p>
50Returns the size (in bytes) loaded when the process completes normally. Returns one of the following codes when the process fails.
51</p>
52
53<p>
54<code>
55CNT_RESULT_AUTHENTICATION<br>
56CNT_RESULT_CORRUPT<br>
57CNT_RESULT_ECC_CRIT<br>
58CNT_RESULT_INVALD<br>
59CNT_RESULT_OUT_OF_MEMORY<br>
60CNT_RESULT_UNKNOWN<br>
61CNT_RESULT_FATAL<br>
62</code>
63</p>
64
65<p>
66If a fatal error occurs during loading when a disc application is being executed, the function will return <CODE>CNT_RESULT_READ_ERR</CODE>. If the load is canceled, the function returns <code>CNT_RESULT_DVD_CANCELED</code>.
67</p>
68
69<H2>Description</H2>
70<p>
71Reads and loads the files in the content file. The access position in the file does not change after loading. The current file access position is used as the point of reference for the file read position specified in the argument <code><STRONG><EM>offset</EM></STRONG></code>. Note that, unlike <code>DVDRead</code>, the reference position is not always the start of the file. This reference position will change if <code>CNTSeek</code> is executed.
72</p>
73
74<p>
75This function is the same as <code>CNTRead</code> in NADK Version 2.1 and earlier. Since <code>CNTRead</code> is replaced with this function if the macro <code>CNT_READ_BACKWARD_COMPATIBLE</code> is defined, applications created using NADK Version 2.1 or earlier can be ported to this version of NADK without changing function calls.
76</p>
77
78<p>
79<STRONG>Note:</STRONG> This function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
80</p>
81
82<H2>Note</H2>
83<p>
84The end of the archive file is not 32-byte aligned. For this reason, the return value for optical disc applications is the 32-byte aligned value specified for loading, while the return value for NAND applications is the actual length of the load (that is, a value that is not 32-byte aligned). Be aware that the values will be different because of this. <br>
85</p>
86
87<h2>See Also</h2>
88<p>
89<code><a href="./CNTOpen.html">CNTOpen</a>, <a href="./CNTSeek.html">CNTSeek</a>, <a href="./CNTTell.html">CNTTell</a>, <a href="./CNTRead.html">CNTRead</a><br> <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a></code>
90</p>
91<H2>Revision History</H2>
92<p>
932008/01/11 Initial version.
94</p>
95
96
97<hr><p>CONFIDENTIAL</p></body>
98</html>
99