#include <revolution/discnand.h>
typedef void (*OSInstallCallback)(s32 result, OSInstallCommandBlock* block);
s32 OSCheckInstall(u32 num, u32 fsBlock, u32 inode, u32* answer);
s32 OSCheckInstallAsync(u32 num, u32 fsBlock, u32 inode, u32* answer,
OSInstallCallback cb, OSInstallCommandBlock* block);
num |
Total number of channels that the application intends to install. |
fsBlock |
Total number of file system blocks for the channels that the application intends to install. |
inode |
Total number of files and directories that the application intends to install. |
answer |
Pointer to a u32-type variable that stores resource availability information. |
cb |
Callback function that will be called when this function completes processing. |
block |
Command block structure to be passed to the callback function. |
Returns one of the following codes.OSINSTALL_RESULT_OK
OSINSTALL_RESULT_NOINFO
OSINSTALL_RESULT_ALLOC_FAILED
OSINSTALL_RESULT_BUSY
OSINSTALL_RESULT_INVALID
OSINSTALL_RESULT_UNKOWN
OSINSTALL_RESULT_FATAL_ERROR
Requests 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 NANDFreeBlocks[Async] 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 OSINSTALL_RESULT_OK has been received by the callback function, check the value in answer. If it is possible to install all of the channels that were requested, the value set in answer is zero. If it is not possible, one of the bits shown below is set in answer.
| Macro Constant That Corresponds to the Bit Set in answer | Description |
OSINSTALL_CHECK_SYS_INSSPACE |
Attempted to use the free space reserved by the system. |
OSINSTALL_CHECK_SYS_INSINODE |
Attempted to use the free inodes reserved by the system. |
OSINSTALL_CHECK_SYS_INSCHAN |
There are no free channels. |
If you want to calculate the total size for all the channels and the total number of files and directories from the WAD file, use scanWad.
NANDCheck
NANDFreeBlocks
NANDFreeBlocksAsync
2009/10/16 Changed the include file.
2008/10/30 Revised the format.
2007/04/20 Initial version.
CONFIDENTIAL