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=utf-8">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>OSCheckInstall</title>
9</head>
10
11<body>
12
13<h1>OSCheckInstall<br>OSCheckInstallAsync</h1>
14
15<h2>Syntax</h2>
16<dl>
17  <dd><pre><code>#include &lt;revolution/discnand.h&gt;</code></pre>
18  </dd>
19  <dd><pre><CODE>typedef void (*OSInstallCallback)(s32 <i>result</i>, <a href="OSInstallCommandBlock.html">OSInstallCommandBlock</a>* <i>block</i>);</CODE></pre>
20  </dd>
21  <dd><pre><CODE>s32 OSCheckInstall(u32 <i>num</i>, u32 <i>fsBlock</i>, u32 <i>inode</i>, u32* <i>answer</i>);</CODE></pre>
22  </dd>
23  <dd><pre><CODE>s32 OSCheckInstallAsync(u32 <i>num</i>, u32 <i>fsBlock</i>, u32 <i>inode</i>, u32* <i>answer</i>,
24                       OSInstallCallback <i>cb</i>, <a href="OSInstallCommandBlock.html">OSInstallCommandBlock</a>* <i>block</i>);</CODE></pre>
25  </dd>
26</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>num</EM></STRONG></CODE></TD>
33<TD width="520">Total number of channels that the application intends to install.</TD>
34  </tr>
35  <tr>
36<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>fsBlock</EM></STRONG></CODE></TD>
37<TD width="520">Total number of file system blocks for the channels that the application intends to install.</TD>
38  </tr>
39  <tr>
40<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>inode</EM></STRONG></CODE></TD>
41<TD width="520">Total number of files and directories that the application intends to install.</TD>
42  </tr>
43  <tr>
44<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>answer</EM></STRONG></CODE></TD>
45<TD width="520">Pointer to a u32-type variable that stores resource availability information.</TD>
46  </tr>
47  <tr>
48<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>cb</EM></STRONG></CODE></TD>
49<TD width="520">Callback function that will be called when this function completes processing.</TD>
50  </tr>
51  <tr>
52<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>block</EM></STRONG></CODE></TD>
53<TD width="520">Command block structure to be passed to the callback function.</TD>
54  </tr>
55</TABLE>
56</p>
57
58<h2>Return Values</h2>
59<p>
60Returns one of the following codes.<br><code>OSINSTALL_RESULT_OK<br> OSINSTALL_RESULT_NOINFO<br> OSINSTALL_RESULT_ALLOC_FAILED<br> OSINSTALL_RESULT_BUSY<br> OSINSTALL_RESULT_INVALID<br> OSINSTALL_RESULT_UNKOWN<br> OSINSTALL_RESULT_FATAL_ERROR<br></code>
61</p>
62
63<h2>Description</h2>
64<p>
65Requests the total number of channels that the application intends to install, as well as the total size for all these channels and the total number of files and directories, and then asynchronously determines whether there is enough space in the file system to create these. Although the <code>NANDFreeBlocks[Async]</code> functions are available to get the available space and number of free inodes, the value that this function retrieves is for the entire file system. Because some free space and free inodes must be retained in the system and because there is an upper limit on the number of channels that can be displayed in the Wii Menu, it is imperative that you call this function and make the determinations before the application installs any new channels. If the call to this function succeeds and <code>OSINSTALL_RESULT_OK</code> has been received by the callback function, check the value in <SPAN class="argument">answer</SPAN>. If it is possible to install all of the channels that were requested, the value set in <SPAN class="argument">answer</SPAN> is zero. If it is not possible, one of the bits shown below is set in <SPAN class="argument">answer</SPAN>.
66</p>
67<table>
68  <tbody>
69    <tr>
70<td bgcolor="#C0C0C0">Macro Constant That Corresponds to the Bit Set in <SPAN class="argument">answer</SPAN></td>
71<td bgcolor="#C0C0C0">Description</td>
72    </tr>
73    <tr>
74<td><CODE>OSINSTALL_CHECK_SYS_INSSPACE</CODE></td>
75<td>Attempted to use the free space reserved by the system.</td>
76    </tr>
77    <tr>
78<td><CODE>OSINSTALL_CHECK_SYS_INSINODE</CODE></td>
79<td>Attempted to use the free inodes reserved by the system.</td>
80    </tr>
81    <tr>
82<td><CODE>OSINSTALL_CHECK_SYS_INSCHAN</CODE></td>
83<td>There are no free channels.</td>
84    </tr>
85  </tbody>
86</table>
87<p>
88If you want to calculate the total size for all the channels and the total number of files and directories from the WAD file, use <A href="./tools/scanWad.html"><CODE>scanWad</CODE></A>.
89</p>
90
91<h2>See Also</h2>
92<p>
93<a href="../nand/NANDCheck.html"><CODE>NANDCheck</CODE></a><BR> <a href="../nand/NANDFreeBlocks.html"><CODE>NANDFreeBlocks</CODE></a><BR> <a href="../nand/NANDFreeBlocksAsync.html"><CODE>NANDFreeBlocksAsync</CODE></a>
94</p>
95
96<h2>Revision History</h2>
97<p>
982009/10/16 Changed the <CODE>include</CODE> file.<br> 2008/10/30 Revised the format.<br>2007/04/20 Initial version.
99</p>
100
101
102<hr><p>CONFIDENTIAL</p></body>
103</html>
104