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=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>DVDCancel</title>
10</head>
11
12<body>
13
14<h1>DVDCancel<br> DVDCancelAsync</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">#include &lt;revolution/dvd.h&gt;
18
19typedef void (*DVDCBCallback)(s32 result, <a href="DVDCommandBlock.html">DVDCommandBlock</a>* block);
20
21s32 DVDCancel(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block);
22
23BOOL DVDCancelAsync(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDCBCallback callback);
24</pre></dd></dl>
25
26<H2>Arguments</H2>
27<TABLE class="arguments" border="1" >
28  <TBODY>
29    <TR>
30<TH>block</TH>
31<TD>Command block of the command to cancel.</TD>
32    </TR>
33    <TR>
34<TH>callback</TH>
35<TD>Callback function that indicates completion. If a callback is unnecessary, specify <CODE>NULL</CODE>. </TD>
36    </TR>
37  </TBODY>
38</TABLE>
39
40<H2>Return Values</H2>
41<P><CODE>DVDCancel</CODE>:  <CODE>0</CODE> if cancel succeeds; <CODE>-1</CODE> if cancel fails.</P>
42<P><CODE>DVDCancel Async</CODE>:  <CODE>TRUE</CODE> if cancel succeeds; <CODE>FALSE</CODE> if cancel fails.</P>
43
44<h2>Description</h2>
45<P>The <CODE>DVDCancelAsync</CODE> function uses <SPAN class="argument">block</SPAN> to cancel issued DVD commands. When the command completes, the callback function is called unless <SPAN class="argument">callback</SPAN> is specified as <CODE>NULL</CODE>. The callback function passes zero as <SPAN class="argument">result</SPAN>, and the canceled command block is passed to <SPAN class="argument">block</SPAN>.</P>
46<P><code>DVD_RESULT_CANCELED</code> will be passed to the canceled functions. In other words, canceled synchronous functions return <code>DVD_RESULT_CANCELED</code>. For canceled asynchronous functions, <code>DVD_RESULT_CANCELED</code> will be passed as the <SPAN class="argument">result</SPAN> of the callback function (if a callback function is specified).</P>
47<P>If the canceled function is asynchronous, and if this function and <code>DVDCancelAsync</code> have callbacks specified, the canceled function callback is called, then <code>DVDCancelAsync</code>.</P>
48<P>If the issued cancel succeeds, the <CODE>DVDCancelAsync</CODE> function returns <CODE>TRUE</CODE>. Otherwise, it returns <CODE>FALSE</CODE>. If a command that uses <SPAN class="argument">block</SPAN> is cancelled by another <CODE>DVDCancel(Async)</CODE> function, the cancellation fails to issue. In this case, a cancel is not performed.</P>
49<P>The <CODE>DVDCancel</CODE> function is the synchronous version of <CODE>DVDCancelAsync</CODE>. 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 <code>DVDCancelAsync</code> function does.</P>
50<P>Canceling already completed commands does not cause any problems.</P>
51
52<p>This function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.</p>
53
54<h2>See Also</h2>
55<p class="reference">
56<a href="DVDCancelAll.html"><CODE>DVDCancelAll(Async)</CODE></a><BR><a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
57</p>
58
59<H2>Revision History</H2>
60<P>
612007/09/25 Added an explanation of thread behavior. <BR>2006/03/01 Initial version.<BR>
62</P>
63
64<hr><p>CONFIDENTIAL</p></body>
65</html>