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>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 24typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block ); 25 26s32 NANDCheckAsync( u32 fsBlock, u32 inode, u32 *answer, NANDCallback cb, NANDCommandBlock *block ); 27</code></pre></dd></dl> 28 29<h2>Arguments</h2> 30<p> 31<TABLE border="1" > 32 <tr> 33<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>fsBlock</EM></STRONG></CODE></TD> 34<TD width="520">The total number of file system blocks for the files that the application is going to create.</TD> 35 </tr> 36 <tr> 37<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>inode</EM></STRONG></CODE></TD> 38<TD width="520">The total number of files and directories that the application is going to create.</TD> 39 </tr> 40 <tr> 41<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>answer</EM></STRONG></CODE></TD> 42<TD width="520">Pointer to a u32 type variable that stores resource availability information.</TD> 43 </tr> 44 <tr> 45<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>cb</EM></STRONG></CODE></TD> 46<TD width="520">Callback function to call when this function completes processing.</TD> 47 </tr> 48 <tr> 49<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>block</EM></STRONG></CODE></TD> 50<TD width="520">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> 57Returns one of the following codes: 58<p> 59<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> 60</p> 61</p> 62 63<h2>Description</h2> 64<p> 65Requests the total size of files to be created by the application, 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> 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 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 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>. 66</p> 67 68<table> 69 <tbody> 70 <tr> 71<td bgcolor="#C0C0C0">Macro Constants Corresponding to the Bits Set in answer</td> 72<td bgcolor="#C0C0C0">Description</td> 73 </tr> 74 <tr> 75<td>NAND_CHECK_HOME_INSSPACE</td> 76<td>Exceeded the maximum file size that can be created in the home directory.</td> 77 </tr> 78 <tr> 79<td>NAND_CHECK_HOME_INSINODE</td> 80<td>Exceeded the maximum number of files and directories that can be created in the home directory.</td> 81 </tr> 82 <tr> 83<td>NAND_CHECK_SYS_INSSPACE</td> 84<td>Attempted to use the available space reserved by the system.</td> 85 </tr> 86 <tr> 87<td>NAND_CHECK_SYS_INSINODE</td> 88<td>Attempted to use the available inodes reserved by the system.</td> 89 </tr> 90 </tbody> 91</table> 92 93<p> 94See <a href="./sequence.html">Processing Sequence</a> for more on the process flow when an application is launched. 95</p> 96 97<h2>See Also</h2> 98<p> 99<code><a href="./NANDInit.html">NANDInit</a></code>, <code><a href="./NANDCheck.html">NANDCheck</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> 100</p> 101 102<h2>Revision History</h2> 103<p> 1042006/11/30 Deleted text about using <CODE>NANDGetAvailableArea[Async]</CODE> as an alternate method.<br>2006/10/25 Expanded statement to include NANDGetAvailableArea[Async]. Added links to See Also.<br>2006/08/30 Initial version. <br> 105</p> 106 107 108</body> 109</html> 110