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>CNTGetFSTSize</title> 9</head> 10 11<body> 12 13<h1>CNTGetFSTSize</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre><code> 17#include <revolution/cnt.h> 18 19s32 CNTGetFSTSize(u32 contentIdx, u32* size); 20</code></pre></dd></dl> 21 22<h2>Arguments</h2> 23<p> 24<TABLE border="1" > 25 <tr> 26<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>contentIdx</EM></STRONG></CODE></TD> 27<TD width="520">Number of the content file whose FST size is to be obtained. Must be in the range of 2 to 511.</TD> 28 </tr> 29<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>size</EM></STRONG></CODE></TD> 30<TD width="520">Pointer to the variable that stores the size.</TD> 31 </tr> 32</TABLE> 33</p> 34 35<h2>Return Values</h2> 36<p> 37For a NAND application, returns one of the following codes: 38<p> 39<code> 40CNT_RESULT_OK<br> 41CNT_RESULT_ACCESS<br> 42CNT_RESULT_AUTHENTICATION<br> 43CNT_RESULT_CORRUPT<br> 44CNT_RESULT_ECC_CRIT<br> 45CNT_RESULT_INVALID<br> 46CNT_RESULT_MAXFD<br> 47CNT_RESULT_OUT_OF_MEMORY<br> 48CNT_RESULT_UNKNOWN<br> 49CNT_RESULT_FATAL<br> 50</code> 51</p> 52</p> 53<p> 54For disc applications, returns <code>CNT_RESULT_INVALID</code> if the <CODE>/content{index}</CODE> directory does not exist under <CODE>DvdRoot</CODE>. 55</p> 56 57<H2>Description</H2> 58<p> 59This function can be used to get the size of the FST of a content file. This is the size allocated from the memory allocator when <CODE>CNTInitHandle</CODE> is executed. By calling this function before initialization by <CODE>CNTInitHandle</CODE>, it is possible to check the required memory size.<br>An archive's FST size may also be obtained statically by <CODE>darchD.exe</CODE>. Click <a href="../arc/intro.html">here</a> for details on archives. <br><br><B>Note:</B> This function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 60</p> 61 62<H2>Note</H2> 63<p> 64The FST size is calculated with the assumption that archiving was performed with the method shown below. This is the same method as used with disc applications when <CODE>CNT_IDX</CODE> is specified in the <CODE>make</CODE> options (defined in <CODE>build/buildtools/modulerules</CODE>). <br>If you use a content file that was archived using any other method, the value that you obtain with this function may be different for disc applications and NAND applications. <br><br> 65<table border="1" width="100%"> 66<tbody> 67<tr> 68<td width="100%"> 69<pre><code> 70% cd $REVOLUTION_SDK_ROOT/dvddata/content{n} 71% darchD -c * ../archives/content{n}.arc 72</code></pre> 73</td> 74</tr> 75</tbody> 76</table> 77</p> 78 79<h2>See Also</h2> 80<p> 81<a href="./CNTInitHandle.html"><CODE>CNTInitHandle</CODE></a><br> <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 82</p> 83<H2>Revision History</H2> 84<p> 852007/11/20 Standardized the use of the term "content file".<BR>2007/09/12 Added information about the sleep status of threads.<br>2007/05/02 Initial version. 86</p> 87 88<hr><p>CONFIDENTIAL</p></body> 89</html> 90