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>NANDCheckAsync</title>
9</head>
10
11<body>
12
13<h1>NANDCheckAsync</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/nand.h&gt;
18
19#define NAND_CHECK_HOME_INSSPACE    0x00000001
20#define NAND_CHECK_HOME_INSINODE    0x00000002
21#define NAND_CHECK_SYS_INSSPACE     0x00000004
22#define NAND_CHECK_SYS_INSINODE     0x00000008
23
24typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block );
25
26s32 NANDCheckAsync( u32 fsBlock, u32 inode, u32 *answer, NANDCallback cb, NANDCommandBlock *block );
27</pre></dd></dl>
28
29<h2>Arguments</h2>
30<p>
31<TABLE class="arguments" border="1" >
32  <tr>
33<TH>fsBlock</TH>
34<TD>The total number of file system blocks for the files that the application is going to create.</TD>
35  </tr>
36  <tr>
37<TH>inode</TH>
38<TD>The total number of files and directories that the application is going to create.</TD>
39  </tr>
40  <tr>
41<TH>answer</TH>
42<TD>Pointer to a u32-type variable that stores resource availability information.</TD>
43  </tr>
44  <tr>
45<TH>cb</TH>
46<TD>Callback function to call when this function completes processing.</TD>
47  </tr>
48  <tr>
49<TH>block</TH>
50<TD>Command block structure to be passed to the callback function.</TD>
51  </tr>
52</TABLE>
53</p>
54
55<h2>Return Values</h2>
56<p>
57The result codes that may be returned by <code>NANDCheckAsync</code> are listed below. Returns <CODE>NAND_RESULT_OK</CODE> when the request begins normally.
58<p>
59<code>
60NAND_RESULT_OK<br>
61NAND_RESULT_ACCESS<br>
62NAND_RESULT_ALLOC_FAILED<br>
63NAND_RESULT_BUSY<br>
64NAND_RESULT_INVALID<br>
65NAND_RESULT_FATAL_ERROR<br>
66</code>
67</p>
68<p>
69The result codes that may be passed to the callback function are listed below.
70</p>
71<p>
72<code>
73NAND_RESULT_OK<br>
74NAND_RESULT_INVALID<br>
75NAND_RESULT_UNKNOWN<br>
76NAND_RESULT_FATAL_ERROR<br>
77</code>
78</p>
79</p>
80
81<h2>Description</h2>
82<p>
83Requests the total size of files to be created by the application and the number of files and directories to be created, and asynchronously determines whether there is enough space in the file system to create those files and directories. Although the <code>NANDFreeBlocks[Async]</code> functions are available to get the available space and number of free i-nodes, the value that this function retrieves is for the entire file system. Because some available space and i-nodes must be allocated for the system, be certain to call this function and use the result when creating new files and directories in the home directory for the application. If <code>NAND_RESULT_OK</code> is received by the callback function and the call to this function was successful, check the value supplied in <SPAN class="argument">answer</SPAN>. If it is possible to create the requested files and directories, <SPAN class="argument">answer</SPAN> is set to zero. If it is not possible to create the requested files and directories, the bits shown in the following table are used to set the value of <SPAN class="argument">answer</SPAN>.
84</p>
85
86<table class="arguments" border="1">
87  <tbody>
88    <tr>
89<td bgcolor="#C0C0C0" nowrap>Macro Constants Corresponding to the Bits Set in <SPAN class="argument">answer</SPAN></td>
90<td bgcolor="#C0C0C0">Description</td>
91    </tr>
92    <tr>
93<th>NAND_CHECK_HOME_INSSPACE</th>
94<td>Exceeded the maximum file size that can be created in the home directory.</td>
95    </tr>
96    <tr>
97<th>NAND_CHECK_HOME_INSINODE</th>
98<td>Exceeded the maximum number of files and directories that can be created in the home directory.</td>
99    </tr>
100    <tr>
101<th>NAND_CHECK_SYS_INSSPACE</th>
102<td>Attempted to use the available space reserved by the system.</td>
103    </tr>
104    <tr>
105<th>NAND_CHECK_SYS_INSINODE</th>
106<td>Attempted to use the available i-nodes reserved by the system.</td>
107    </tr>
108  </tbody>
109</table>
110
111<p>
112See <a href="./sequence.html">Processing Sequence</a> for more on the process flow when an application is launched.
113</p>
114
115<h2>See Also</h2>
116<p class="reference">
117<a href="./NANDInit.html">NANDInit</a>,
118<a href="./NANDCheck.html">NANDCheck</a>,
119<a href="./NANDGetAvailableArea.html">NANDGetAvailableArea</a>,
120<a href="./NANDGetAvailableAreaAsync.html">NANDGetAvailableAreaAsync</a>,
121<a href="./NANDFreeBlocks.html">NANDFreeBlocks</a>,
122<a href="./NANDFreeBlocksAsync.html">NANDFreeBlocksAsync</a>
123</p>
124
125<h2>Revision History</h2>
126<p>
1272008/08/01 Revised the result codes that are passed to the callback function.<br>2008/05/13 Described the result codes passed to the callback function.<br>2006/11/30 Deleted text about using <CODE>NANDGetAvailableArea[Async]</CODE> as an alternate method.<br>2006/10/25 Added a reference to <CODE>NANDGetAvailableArea[Async]</CODE>. Added links to <B>See Also</B>.<br>2006/08/30 Initial version.<BR>
128</p>
129
130<hr><p>CONFIDENTIAL</p></body>
131</html>
132