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>NANDCheck</title>
9</head>
10
11<body>
12
13<h1>NANDCheck</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">#include &lt;revolution/nand.h&gt;
17
18#define NAND_CHECK_HOME_INSSPACE    0x00000001
19#define NAND_CHECK_HOME_INSINODE    0x00000002
20#define NAND_CHECK_SYS_INSSPACE     0x00000004
21#define NAND_CHECK_SYS_INSINODE     0x00000008
22
23s32 NANDCheck( u32 fsBlock, u32 inode, u32 *answer );
24</pre></dd></dl>
25
26<h2>Arguments</h2>
27<p>
28<TABLE class="arguments" border="1" >
29  <tr>
30<TH>fsBlock</TH>
31<TD>The total number of file system blocks for the files that the application is going to create.</TD>
32  </tr>
33  <tr>
34<TH>inode</TH>
35<TD>The total number of files and directories that the application is going to create.</TD>
36  </tr>
37  <tr>
38<TH>answer</TH>
39<TD>Pointer to a u32-type variable that stores resource availability information.</TD>
40  </tr>
41</TABLE>
42</p>
43
44<h2>Return Values</h2>
45<p>
46Returns one of the following codes.
47<p>
48<code>
49NAND_RESULT_OK<br>
50NAND_RESULT_ALLOC_FAILED<br>
51NAND_RESULT_BUSY<br>
52NAND_RESULT_INVALID<br>
53NAND_RESULT_UNKNOWN<br>
54NAND_RESULT_FATAL_ERROR<br>
55</code>
56</p>
57</p>
58
59<h2>Description</h2>
60<p>
61Requests the total size of the files to be created by the application and the number of files and directories to be created. It also gets information about 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 returned because a 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 set in <CODE><STRONG><EM>answer</EM></STRONG></CODE>.
62</p>
63
64<table class="arguments" border="1">
65  <tbody>
66    <tr>
67<td bgcolor="#C0C0C0" nowrap>Macro Constants Corresponding to the Bits Set in <SPAN class="argument">answer</SPAN></td>
68<td bgcolor="#C0C0C0">Description</td>
69    </tr>
70    <tr>
71<th>NAND_CHECK_HOME_INSSPACE</th>
72<td>Exceeded the maximum file size that can be created in the home directory.</td>
73    </tr>
74    <tr>
75<th>NAND_CHECK_HOME_INSINODE</th>
76<td>Exceeded the maximum number of files and directories that can be created in the home directory.</td>
77    </tr>
78    <tr>
79<th>NAND_CHECK_SYS_INSSPACE</th>
80<td>Attempted to use the available space reserved by the system.</td>
81    </tr>
82    <tr>
83<th>NAND_CHECK_SYS_INSINODE</th>
84<td>Attempted to use the available i-nodes reserved by the system.</td>
85    </tr>
86  </tbody>
87</table>
88
89<p>
90See <a href="./sequence.html">Processing Sequence</a> for more on the process flow when an application is launched.
91</p>
92
93<p>
94This function may put the current thread to sleep. For precautions related to calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
95</p>
96
97<h2>See Also</h2>
98<p class="reference">
99<a href="./NANDInit.html">NANDInit</a>,
100<a href="./NANDCheckAsync.html">NANDCheckAsync</a>,
101<a href="./NANDGetAvailableArea.html">NANDGetAvailableArea</a>,
102<a href="./NANDGetAvailableAreaAsync.html">NANDGetAvailableAreaAsync</a>,
103<a href="./NANDFreeBlocks.html">NANDFreeBlocks</a>,
104<a href="./NANDFreeBlocksAsync.html">NANDFreeBlocksAsync</a>,
105<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
106</p>
107
108<h2>Revision History</h2>
109<p>
1102007/09/25 Added information about the sleep status of threads.<br>2006/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<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>
111</p>
112
113<hr><p>CONFIDENTIAL</p></body>
114</html>