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>NANDReadDirAsync</title> 9</head> 10 11<body> 12 13<h1>NANDReadDirAsync</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 18 19#define NAND_MAX_NAME 12 20 21typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block ); 22 23s32 NANDReadDirAsync( const char *dirName, char *nameList, u32 *num, NANDCallback cb, NANDCommandBlock *block ); 24</code></pre></dd></dl> 25 26<h2>Arguments</h2> 27<p> 28<TABLE border="1" > 29 <tr> 30<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>dirName</EM></STRONG></CODE></TD> 31<TD width="520">Name of the directory to read from.</TD> 32 </tr> 33 <tr> 34<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>nameList</EM></STRONG></CODE></TD> 35<TD width="520">Start address of the buffer used for storing the list of file names and directory names contained in the directory that is read. This buffer must be aligned on a 32-byte address boundary. If set to NULL, the list is not stored in the buffer.</TD> 36 </tr> 37 <tr> 38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>num</EM></STRONG></CODE></TD> 39<TD width="520">Stores the number of files and directories contained in the directory that is read.</TD> 40 </tr> 41 <tr> 42<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>cb</EM></STRONG></CODE></TD> 43<TD width="520">Specifies the callback function to call when this function completes processing.</TD> 44 </tr> 45 <tr> 46<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>block</EM></STRONG></CODE></TD> 47<TD width="520">Specifies the command block structure to pass to the callback function.</TD> 48 </tr> 49</TABLE> 50</p> 51 52<h2>Return Values</h2> 53<p> 54Returns <CODE>NAND_RESULT_OK</CODE> when the request begins normally. 55<p> 56<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_INVALID<br> NAND_RESULT_NOEXISTS<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 57</p> 58</p> 59 60<H2>Description</H2> 61<p> 62Asynchronously gets the list of file names and directory names contained in the directory that is read. If the list size is unknown, retrieve the list as follows: 63<ol> 64<li>Call this function with the second argument set to <CODE>NULL</CODE>. The number of elements in the list is written to the location pointed to by <STRONG><EM><CODE>num</CODE></EM></STRONG>. 65<li>Allocate a memory block with the size [ (Number of Elements) x (<CODE>NAND_MAX_NAME</CODE>+1)] or larger. 66<li>Call this function again with start address of the allocated memory buffer as the second argument. 67<li>The number of elements of the list that was retrieved is stored in <STRONG><EM><CODE>num</CODE></EM></STRONG> (this value may be less than the value in the first call to this function), and the file and directory list with a null character separator is stored in the allocated memory. 68</ol> 69</p> 70<p> 71If the queue receiving the request is full in the library, this function call is refused and <code>NAND_RESULT_BUSY</code> is returned. 72</p> 73 74<h2>See Also</h2> 75<p> 76<code><a href="./NANDReadDir.html">NANDReadDir</a></code> 77</p> 78 79<H2>Revision History</H2> 80<p>06/16/2006 Initial version.</p> 81 82 83</body> 84</html> 85