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<dd><pre><code>typedef void (*DVDCBCallback)(s32 result, <a href="DVDCommandBlock.html">DVDCommandBlock</a>* block);</code></pre></dd>
23<dd><pre><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></pre></dd>
24</dl>
25<H2>Arguments</H2>
26<TABLE border="1" cellpadding="3" cellspacing="0.1">
27  <TBODY>
28    <TR>
29<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>block</CODE></STRONG></EM></TD>
30<TD width="520">Command block of the command to cancel.</TD>
31    </TR>
32    <TR>
33<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>callback</CODE></STRONG></EM></TD>
34<TD width="520">Callback function that indicates completion. If a callback is unnecessary, specify <CODE>NULL</CODE>. </TD>
35    </TR>
36  </TBODY>
37</TABLE>
38<H2>Return Values</H2>
39<P><CODE>DVDCancel</CODE>: <CODE>0</CODE> if cancel succeeds and <CODE>-1</CODE> if cancel fails. </P>
40<P><CODE>DVDCancel Async</CODE>: <CODE>TRUE</CODE> if cancel succeeds and <CODE>FALSE</CODE> if cancel fails.</P>
41<h2>Description</h2>
42
43<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 the <STRONG><EM><CODE>result</CODE></EM></STRONG>, and the canceled command block is passed to <EM><CODE><STRONG>block</STRONG></CODE></EM>.</P>
44<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>
45<P>If the canceled function is asynchronous and the canceled 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>
46<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 canceled  by another <CODE>DVDCancel(Async)</CODE> function, cancel fails to issue. In this case, a cancel is not performed.</P>
47<P>The <CODE>DVDCancel</CODE>function is the synchronous version of the <CODE>DVDCancelAsync</CODE> 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 <code>DVDCancelAsync</code> function does.</P>
48<P>Canceling already completed commands does not cause any problems.</P>
49
50<p>The <CODE>DVDCancel</CODE> function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.</p>
51
52<h2>See Also</h2>
53
54<p><a href="DVDCancelAll.html"><code>DVDCancelAll(Async)</code></a><BR> <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a></p>
55<H2>Revision History</H2>
56<P>2007/09/25 Added explanation on thread behavior.<BR> 2006/03/01 Initial version.</P>
57<hr><p>CONFIDENTIAL</p></body>
58</html>
59