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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>CARDRead</title> 10</head> 11 12<body> 13 14<h1>CARDRead</h1> 15 16 17<h2>C Specification</h2> 18<DL> 19 <DD> 20 <PRE><code>#include <revolution/card.h> 21 22#define CARD_READ_SIZE 512</CODE></PRE> 23 24 <DD> 25 <PRE><CODE>s32 CARDRead(CARDFileInfo* fileInfo, void* buf, s32 length, s32 offset);</CODE></PRE> 26 27</DL> 28<h2>Arguments</h2> 29<TABLE border="1" cellpadding="3" cellspacing="0.1"> 30 <tr> 31<TD width="120" bgcolor="#ffffe8"><em><strong><code>fileInfo</code></strong></em></TD> 32<TD width="520">Pointer to the file information of the file to read. <code><em><strong>fileInfo</strong></em></code> must be valid file information that was initialized using the <code><a href="CARDOpen.html">CARD</a><a href="CARDFastOpen.html">[Fast]</a><a href="CARDOpen.html">Open</a></code> or <code><a href="CARDCreate.html">CARDCreate</a><a href="CARDCreateAsync.html">[Async]</a></code> function.</TD> 33 </tr> 34 <tr> 35<TD width="120" bgcolor="#ffffe8"><em><strong><code>buf</code></strong></em></TD> 36<TD width="520">Buffer address (32-byte alignment).</TD> 37 </tr> 38 <tr> 39<TD width="120" bgcolor="#ffffe8"><em><strong><code>length</code></strong></em></TD> 40<TD width="520">Number of bytes to be read (multiple of <code>CARD_READ_SIZE</code>).</TD> 41 </tr> 42 <tr> 43<TD width="120" bgcolor="#ffffe8"><em><strong><code>offset</code></strong></em></TD> 44<TD width="520">File position at which to start the read (multiple of <code>CARD_READ_SIZE</code>).</TD> 45 </tr> 46</TABLE> 47<h2>Return Values</h2> 48 49<p>One of the following codes:</p> 50 51<p><code>CARD_RESULT_FATAL_ERROR<br> CARD_RESULT_NOCARD<br> CARD_RESULT_BUSY<br> CARD_RESULT_NOFILE<br> CARD_RESULT_NOPERM<br> CARD_RESULT_LIMIT<br> CARD_RESULT_CANCELED<br> CARD_RESULT_READY</code></p> 52<H2>Description</H2> 53<P>Reads data from a file synchronously.</P> 54<p> 55This 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>. 56</p> 57<h2>See Also</h2> 58<P> 59<code><a href="CARDOpen.html">CARD</a><a href="CARDFastOpen.html">[Fast]</a><a href="CARDOpen.html">Open</a></code><br> <code><a href="CARDCreate.html">CARDCreate</a><a href="CARDCreateAsync.html">[Async]</a></code><br><code><a href="CARDCancel.html">CARDCancel()</a></code><br><code><a href="CARDGetResultCode.html">CARDGetResultCode()</a></code> 60</P> 61 62<H2>Revision History</H2> 63<P> 642007/09/25 Added information on the sleep status of threads.<br>2006/03/01 Initial version. 65</P> 66<hr><p>CONFIDENTIAL</p></body> 67</html> 68