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>NANDSafeOpenAsync</title> 9</head> 10 11<body> 12 13<h1>NANDSafeOpenAsync</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 18 19#define NAND_ACCESS_READ 0x01 20#define NAND_ACCESS_WRITE 0x02 21#define NAND_ACCESS_RW (NAND_ACCESS_READ | NAND_ACCESS_WRITE) 22 23typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block ); 24 25s32 NANDSafeOpenAsync(const char *path, NANDFileInfo *info, u8 accType, void *buf, u32 length, NANDCallback cb, NANDCommandBlock *block); 26</code></pre></dd></dl> 27 28<h2>Arguments</h2> 29<p> 30<TABLE border="1" > 31 <tr> 32<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>path</EM></STRONG></CODE></TD> 33<TD width="520">File name to open.</TD> 34 </tr> 35 <tr> 36<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>info</EM></STRONG></CODE></TD> 37<TD width="520">Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD> 38 </tr> 39 <tr> 40<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>accType</EM></STRONG></CODE></TD> 41<TD width="520">Access type. Specifies either <code>NAND_ACCESS_READ</code>, <code>NAND_ACCESS_WRITE</code> or <CODE>NAND_ACCESS_RW</CODE>.</TD> 42 </tr> 43 <tr> 44<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>buf</EM></STRONG></CODE></TD> 45<TD width="520">Specifies the leading address of the buffer to be used when copying files. The buffer must be 32-byte aligned.</TD> 46 </tr> 47 <tr> 48<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>length</EM></STRONG></CODE></TD> 49<TD width="520">Specifies the size of the buffer to be used when copying files. Buffer size must be a multiple of 32 bytes. We recommend a size between 4 KB and 16 KB.</TD> 50 </tr> 51 <tr> 52<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>cb</EM></STRONG></CODE></TD> 53<TD width="520">Callback function to call when this function completes processing.</TD> 54 </tr> 55 <tr> 56<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>block</EM></STRONG></CODE></TD> 57<TD width="520">Command block structure to be passed to the callback function.</TD> 58 </tr> 59</TABLE> 60</p> 61 62 63<h2>Return Values</h2> 64<p> 65Returns <CODE>NAND_RESULT_OK</CODE> when the request begins normally. 66<p> 67<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_AUTHENTICATION<br> NAND_RESULT_BUSY<br> NAND_RESULT_CORRUPT<br> NAND_RESULT_ECC_CRIT<br> NAND_RESULT_INVALID<br> NAND_RESULT_MAXBLOCKS<br> NAND_RESULT_MAXFD<br> NAND_RESULT_MAXFILES<br> NAND_RESULT_NOEXISTS<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 68</p> 69</p> 70 71<H2>Description</H2> 72<p> 73Asynchronously opens a file in a manner that guarantees the atomic nature of file updates. The file opened using this function must be closed using <code><a href="./NANDSafeClose.html">NANDSafeClose</a></code> or <code><a href="./NANDSafeCloseAsync.html">NANDSafeCloseAsync</a></code>. The file opened using this function must be closed using <code><a href="./NANDSafeClose.html">NANDSafeClose</a></code> or <code><a href="./NANDSafeCloseAsync.html">NANDSafeCloseAsync</a></code>. <code>NAND_RESULT_BUSY</code> is returned and this function call is denied when the queue for accepting requests inside the library is full. 74</p> 75 76<h2>See Also</h2> 77<p> 78<code><a href="./NANDSafeOpen.html">NANDSafeOpen</a></code>, <code><a href="./NANDSafeClose.html">NANDSafeClose</a></code>, <code><a href="./NANDSafeCloseAsync.html">NANDSafeCloseAsync</a></code> 79</p> 80 81<H2>Revision History</H2> 82<p>08/15/2006 Initial version.</p> 83 84<hr> 85<P>CONFIDENTIAL</p> 86</BODY> 87</HTML> 88