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="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
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
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/dvd.h&gt;</code></pre>
21  </dd>
22<dt><code>&nbsp;&nbsp;&nbsp; typedef void (*DVDCBCallback)(s32 result, <a     href="DVDCommandBlock.html">DVDCommandBlock</a>* block);</code></dt>
23  <dd>&nbsp;</dd>
24<dd><code>s32 DVDCancel(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block);</code><br> <code>BOOL DVDCancelAsync(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDCBCallback callback);</code></dd>
25</dl>
26<H2>Arguments</H2>
27<TABLE border="1" cellpadding="3" cellspacing="0.1">
28  <TBODY>
29    <TR>
30<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>block</CODE></STRONG></EM></TD>
31<TD width="520">Command block of the command to cancel.</TD>
32    </TR>
33    <TR>
34<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>callback</CODE></STRONG></EM></TD>
35<TD width="520">Callback function that indicates completion. If a callback is unnecessary, specify <CODE>NULL</CODE>. </TD>
36    </TR>
37  </TBODY>
38</TABLE>
39<H2>Return Values</H2>
40<P><CODE>DVDCancel</CODE>: <CODE>0</CODE> if cancel succeeds and -1 if cancel fails. </P>
41<P><CODE>DVDCancelAsync</CODE>: Returns TRUE if cancellation is successful; otherwise, returns FALSE. </P>
42<h2>Description</h2>
43
44<P>The <CODE>DVDCancelAsync</CODE> function uses <STRONG><EM><CODE>block</CODE></EM> </STRONG> to cancel issued DVD commands. When the command completes, the <STRONG><EM><CODE>callback</CODE></EM></STRONG> function is called unless <STRONG><EM><CODE>callback</CODE></EM></STRONG> is specified as <CODE>NULL</CODE>. The callback function passes zero as <STRONG><EM><CODE>result</CODE></EM></STRONG>, and the canceled command block is passed to <EM><CODE><STRONG>block</STRONG></CODE></EM>. </P>
45<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 <STRONG><em><code>result</code></em></STRONG> of the callback function (if a callback function is specified).</P>
46<P>If the canceled function is asynchronous and the cancelled function and the <code>DVDCancelAsync</code> function have callbacks specified, first the canceled function callback and then the <code>DVDCancelAsync</code> function is called.  </P>
47<P>The <CODE>DVDCancelAsync</CODE> function returns <CODE>TRUE</CODE> if the issued cancel succeeds. Otherwise, <CODE>FALSE</CODE> is returned. If a command that uses <EM><CODE><STRONG>block</STRONG></CODE></EM> is cancelled  by another <CODE>DVDCancel(Async)</CODE> function, cancel fails to issue. In this case, a cancel is not performed.</P>
48<P>The <CODE>DVDCancel</CODE> function is the synchronous version of the <CODE>DVDCancelAsync</CODE> function. The <CODE>DVDCancelAsync</CODE> 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 <code>DVDCancelAsync</code> function does.</P>
49<P>Canceling already completed commands does not cause any problems. </P>
50<h2>See Also</h2>
51
52<p><a href="DVDCancelAll.html"><code>DVDCancelAll(Async)</code></a></p>
53<H2>Revision History</H2>
54<P>03/01/2006 Initial version.</P>
55</body>
56</html>
57