#include <revolution/dvd.h>
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);s32 DVDCancel(DVDCommandBlock* block);BOOL DVDCancelAsync(DVDCommandBlock* block, DVDCBCallback callback);block |
Command block of the command to cancel. |
callback |
Callback function that indicates completion. If a callback is unnecessary, specify NULL. |
DVDCancel: 0 if cancel succeeds and -1 if cancel fails.
DVDCancelAsync: Returns TRUE if cancellation is successful; otherwise, returns FALSE.
The DVDCancelAsync function uses block to cancel issued DVD commands. When the command completes, the callback function is called unless callback is specified as NULL. The callback function passes zero as result, and the canceled command block is passed to block.
DVD_RESULT_CANCELED will be passed to the canceled functions. In other words, canceled synchronous functions return DVD_RESULT_CANCELED. For canceled asynchronous functions, DVD_RESULT_CANCELED will be passed as the result of the callback function (if a callback function is specified).
If the canceled function is asynchronous and the cancelled function and the DVDCancelAsync function have callbacks specified, first the canceled function callback and then the DVDCancelAsync function is called.
The DVDCancelAsync function returns TRUE if the issued cancel succeeds. Otherwise, FALSE is returned. If a command that uses block is cancelled by another DVDCancel(Async) function, cancel fails to issue. In this case, a cancel is not performed.
The DVDCancel function is the synchronous version of the DVDCancelAsync function. The DVDCancelAsync function doesn't return until a cancel completes. This function returns 0 if cancel succeeds and -1 otherwise. Cancel fails in the same way that the DVDCancelAsync function does.
Canceling already completed commands does not cause any problems.
03/01/2006 Initial version.