DVDCancel
DVDCancelAsync

C Specification

#include <revolution/dvd.h>
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);
s32 DVDCancel(DVDCommandBlock* block);
BOOL DVDCancelAsync(DVDCommandBlock* block, DVDCBCallback callback);

Arguments

block Command block of the command to cancel.
callback Callback function that indicates completion. If a callback is unnecessary, specify NULL.

Return Values

DVDCancel: 0 if cancel succeeds and -1 if cancel fails.

DVDCancel Async: TRUE if cancel succeeds and FALSE if cancel fails.

Description

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 the 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 canceled 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 canceled by another DVDCancel(Async) function, cancel fails to issue. In this case, a cancel is not performed.

The DVDCancelfunction is the synchronous version of the DVDCancelAsync function. This function doesn't return until 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.

The DVDCancel function may put the current thread to sleep. Refer to Interrupts and Callback Functions.

See Also

DVDCancelAll(Async)
Interrupts and Callback Functions

Revision History

2007/09/25 Added explanation on thread behavior.
2006/03/01 Initial version.


CONFIDENTIAL