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>CNTRead</title>
9</head>
10
11<body>
12
13<h1>CNTRead</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/cnt.h&gt;
18
19s32 CNTRead(CNTFileInfo* cf, void* addr, u32 length);
20</code></pre></dd></dl>
21
22<h2>Arguments</h2>
23<p>
24<TABLE border="1" >
25  <tr>
26<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>cf</EM></STRONG></CODE></TD>
27<TD width="520">Pointer to the <CODE>CNTFileInfo</CODE> structure.</TD>
28  </tr>
29  <tr>
30<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>addr</EM></STRONG></CODE></TD>
31<TD width="520">Pointer to the write destination for the data that was loaded. The write buffer must be 32-byte aligned.</TD>
32  </tr>
33  <tr>
34<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>length</EM></STRONG></CODE></TD>
35<TD width="520">Number of bytes to load. Must be a multiple of 32.</TD>
36  </tr>
37</TABLE>
38</p>
39
40<h2>Return Values</h2>
41<p>
42Returns the size (in bytes) loaded when the process completes normally. Returns one of the following codes when the process fails.
43<p>
44<code>
45CNT_RESULT_AUTHENTICATION<br>
46CNT_RESULT_CORRUPT<br>
47CNT_RESULT_ECC_CRIT<br>
48CNT_RESULT_INVALD<br>
49CNT_RESULT_OUT_OF_MEMORY<br>
50CNT_RESULT_UNKNOWN<br>
51CNT_RESULT_FATAL<br>
52</code>
53</p>
54<p>
55If 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>.
56</p>
57</p>
58
59<H2>Description</H2>
60<p>
61Reads and loads the files in the content file. After reading the files, the file access position moves by the amount of data read.
62</p>
63<p>
64<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>.
65</p>
66
67<H2>Note</H2>
68<p>
69The 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>
70</p>
71
72<h2>See Also</h2>
73<p>
74<code>
75<a href="./CNTOpen.html">CNTOpen</a>,
76<a href="./CNTSeek.html">CNTSeek</a>,
77<a href="./CNTTell.html">CNTTell</a>,
78<a href="./CNTReadWithOffset.html">CNTReadWithOffset</a><br>
79<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
80</code>
81</p>
82<H2>Revision History</H2>
83<p>
842008/01/11 Changed the specifications of <code>CNTRead</code>.<br>2007/11/20 Added information about the result code used with disc applications. Standardized the use of the term &quot;content file&quot;.<BR>2007/09/12 Added information about the sleep status of threads.<br>2006/12/04 Added result code descriptions.<br>2006/09/20 Added a description about the restrictions when specifying <CODE><STRONG><EM>offset</EM></STRONG></CODE>.<br>2006/09/08 Revised the description of the <CODE><STRONG><EM>offset</EM></STRONG></CODE> argument, which was insufficient.<br>2006/08/15 Initial version.
85</p>
86
87
88<hr><p>CONFIDENTIAL</p></body>
89</html>
90