DVDCancel
DVDCancelAsync

Syntax

#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; -1 if cancel fails.

DVDCancel Async: TRUE if cancel succeeds; 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 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 if this function and DVDCancelAsync have callbacks specified, the canceled function callback is called, then DVDCancelAsync.

If the issued cancel succeeds, the DVDCancelAsync function returns TRUE. Otherwise, it returns FALSE. If a command that uses block is cancelled by another DVDCancel(Async) function, the cancellation fails to issue. In this case, a cancel is not performed.

The DVDCancel function is the synchronous version of DVDCancelAsync. This function doesn't return until cancel completes. This function returns 0 if cancel succeeds and -1 if cancel fails. Cancel fails in the same way that the DVDCancelAsync function does.

Canceling already completed commands does not cause any problems.

This 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 an explanation of thread behavior.
2006/03/01 Initial version.


CONFIDENTIAL