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>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 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 24s32 NANDCheck( u32 fsBlock, u32 inode, u32 *answer ); 25</code></pre></dd></dl> 26 27<h2>Arguments</h2> 28<p> 29<TABLE border="1" > 30 <tr> 31<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>fsBlock</EM></STRONG></CODE></TD> 32<TD width="520">The total number of file system blocks for the files that the application is going to create.</TD> 33 </tr> 34 <tr> 35<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>inode</EM></STRONG></CODE></TD> 36<TD width="520">The total number of files and directories that the application is going to create.</TD> 37 </tr> 38 <tr> 39<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>answer</EM></STRONG></CODE></TD> 40<TD width="520">Pointer to a u32 type variable that stores resource availability information.</TD> 41 </tr> 42</TABLE> 43</p> 44 45<h2>Return Values</h2> 46<p> 47Returns one of the following codes: 48<p> 49<code>NAND_RESULT_OK<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_INVALID<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 50</p> 51</p> 52 53<h2>Description</h2> 54<p> 55Requests 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> function is available to get the available space and number of free inodes, the value that this function retrieves is for the entire file system. Since some available space and inodes 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 the call to this function was successful, check the value supplied in answer. If it is possible to create the requested files and directories, answer 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 <CODE>answer</CODE>. 56</p> 57 58<table border="1"> 59 <tbody> 60 <tr> 61<td bgcolor="#C0C0C0"><strong>Macro Constants Corresponding to the Bits Set in answer</strong></td> 62<td bgcolor="#C0C0C0"><strong>Description</strong></td> 63 </tr> 64 <tr> 65<td>NAND_CHECK_HOME_INSSPACE</td> 66<td>Exceeded the maximum file size that can be created in the home directory.</td> 67 </tr> 68 <tr> 69<td>NAND_CHECK_HOME_INSINODE</td> 70<td>Exceeded the maximum number of files and directories that can be created in the home directory.</td> 71 </tr> 72 <tr> 73<td>NAND_CHECK_SYS_INSSPACE</td> 74<td>Attempted to use the available space reserved by the system.</td> 75 </tr> 76 <tr> 77<td>NAND_CHECK_SYS_INSINODE</td> 78<td>Attempted to use the available inodes reserved by the system.</td> 79 </tr> 80 </tbody> 81</table> 82 83<p> 84See <a href="./sequence.html">Processing Sequence</a> for more on the process flow when an application is launched. 85</p> 86 87<p> 88This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 89</p> 90 91<h2>See Also</h2> 92<p> 93<code><a href="./NANDInit.html">NANDInit</a></code>, <code><a href="./NANDCheckAsync.html">NANDCheckAsync</a></code>, <code><a href="./NANDGetAvailableArea.html">NANDGetAvailableArea</a></code>, <code><a href="./NANDGetAvailableAreaAsync.html">NANDGetAvailableAreaAsync</a></code>, <code><a href="./NANDFreeBlocks.html">NANDFreeBlocks</a></code>, <code><a href="./NANDFreeBlocksAsync.html">NANDFreeBlocksAsync</a></code>, <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a></p> 94 95<h2>Revision History</h2> 96<p> 972007/09/25 Added information on the sleep status of threads.<br>2006/11/30 Added <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 Made reference to <CODE>NANDGetAvailableArea[Async]</CODE>. Added link to <B>See Also</B>.<br>2006/08/30 Initial version.<br> 98</p> 99 100 101<hr><p>CONFIDENTIAL</p></body> 102</html> 103