17:39
[skypekit:skypekit.git] / skypekit_2.0.0.190_29281_CB30 / interfaces / skype / cpp_embedded / documentation / html / tutorial__3_8cpp-example.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <title>SkypeKit C++ Wrapper: Main Page</title>
6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
7 <link href="islander.css" rel="stylesheet" type="text/css"/>
8 </head>
9 <body>
10 <img src="..\skypekit.png" align="right">
11 <!-- Generated by Doxygen 1.6.2 -->
12 <script type="text/javascript">
13 <!--
14 function changeDisplayState (e){
15   var num=this.id.replace(/[^[0-9]/g,'');
16   var button=this.firstChild;
17   var sectionDiv=document.getElementById('dynsection'+num);
18   if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
19     sectionDiv.style.display='block';
20     button.src='open.gif';
21   }else{
22     sectionDiv.style.display='none';
23     button.src='closed.gif';
24   }
25 }
26 function initDynSections(){
27   var divs=document.getElementsByTagName('div');
28   var sectionCounter=1;
29   for(var i=0;i<divs.length-1;i++){
30     if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
31       var header=divs[i];
32       var section=divs[i+1];
33       var button=header.firstChild;
34       if (button!='IMG'){
35         divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
36         button=document.createElement('img');
37         divs[i].insertBefore(button,divs[i].firstChild);
38       }
39       header.style.cursor='pointer';
40       header.onclick=changeDisplayState;
41       header.id='dynheader'+sectionCounter;
42       button.src='closed.gif';
43       section.id='dynsection'+sectionCounter;
44       section.style.display='none';
45       section.style.marginLeft='14px';
46       sectionCounter++;
47     }
48   }
49 }
50 window.onload = initDynSections;
51 -->
52 </script>
53 <div class="navigation" id="top">
54   <div class="tabs">
55     <ul>
56       <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
57       <li><a href="annotated.html"><span>Classes</span></a></li>
58       <li><a href="files.html"><span>Files</span></a></li>
59       <li><a href="examples.html"><span>Examples</span></a></li>
60     </ul>
61   </div>
62 </div>
63 <div class="contents">
64 <h1>tutorial_3.cpp</h1><h2><a class="anchor" id="Step3">
65 C++ Tutorial Step 3: Receiving and sending chat messages</a></h2>
66 <p>In this example, we will write a simple SkypeKit-based auto-reply bot. The bot will:</p>
67 <p>Take a skypename and password as commmand-line arguments  Log in  Catch all incoming text chat messages  Send a canned reply message</p>
68 <p>To run the program:</p>
69 <div class="fragment"><pre class="fragment">$ cd examples/cpp/tutorial/step3
70 $ ./tutorial_3 skypename password
71 </pre></div><h3><a class="anchor" id="Step3Walkthrough">
72 Code Walkthrough</a></h3>
73 <p>The good news is that for handling incoming messages, we don't even have to write our own version of the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> class. We can simply catch to the OnMessage event of the <a class="el" href="class_skype.html" title="The main class that exposes Skype-related functionality to your application.">Skype</a> class, which we are overriding anyway.</p>
74 <p>(Note: there actually is another OnMessage event, in the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> class. For simplicity, we will use the one in the <a class="el" href="class_skype.html" title="The main class that exposes Skype-related functionality to your application.">Skype</a> class).</p>
75 <p>The <a class="el" href="class_skype.html#a7354ad58c7301f5f27f6e0315f4b3301">Skype::OnMessage</a> callback is defined as: </p>
76 <div class="fragment"><pre class="fragment"><span class="keyword">virtual</span> <span class="keywordtype">void</span> OnMessage(
77     <span class="keyword">const</span> <a name="_a0"></a><a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; message,
78     <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; changesInboxTimestamp,
79     <span class="keyword">const</span> <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; supersedesHistoryMessage);
80 </pre></div><p>The first argument is a reference to the <a class="el" href="class_message.html" title="Events in a conversation context are expressed as a Messages. It is therefore useful...">Message</a> object.</p>
81 <p>The second argument indicates whether the message caused an update to the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> INBOX_TIMESTAMP property. A non-empty value of this property indicates that the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> is included in the Inbox filter. If not empty, it contains a timestamp of the last event (message) in the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> that required user's attention. The value of this property can be used to chronologically sort <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> objects in the UI Inbox.</p>
82 <p>The third argument: let's ignore this one for now.</p>
83 <p>Inside the callback, the first thing we need to do is check the message type. In the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> API, all sorts of things get manifested as messages, including SMS messages, file transfers, joins and leaves. In this particular case we are only interested in chat messages.</p>
84 <p>Here's how we check the message type: </p>
85 <div class="fragment"><pre class="fragment"><span class="keywordtype">int</span> MessageType = message-&gt;GetProp(<a name="a1"></a><a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23a747c40ef95a5a90497a69c8979181738">Message::P_TYPE</a>).toInt();
86 <span class="keywordflow">if</span> (MessageType == <a name="a2"></a><a class="code" href="class_message.html#a5305592a3170872320962a09d8a1c7fea91b2b91db678c2d6134ff63511e5c133">Message::POSTED_TEXT</a>) { rest goes here };
87 </pre></div><p>The next thing we need to know is whether this was an incoming message or one that we sent out ourselves. The easiest way to check is to examine the P_AUTHOR property. If the author of the message is equal to the skypename you logged in with, we can assume the message was outgoing. There is a neat side effect here: if you are logged in with the same skypename from different places, the bot wont' bother with auto-replys to incoming messages from those.</p>
88 <p>To send a reply, we will need to use the <a class="el" href="class_conversation.html#a8210a5a091cdc724f9aac967d0e15463">Conversation::PostText</a> method. To retrieve the <a class="el" href="class_conversation.html" title="The Conversation class encapsulates all types of communication possible with Skype...">Conversation</a> object we will need to know the P_CONVO_ID property of the message. Thus, it is best to get all three properties--author, body text and conversation ID--with GetProps.</p>
89 <div class="fragment"><pre class="fragment"><a name="_a3"></a><a class="code" href="class_s_e_int_list.html" title="SEIntList represents a list of integers.">SEIntList</a> Props;
90 <a name="_a4"></a><a class="code" href="class_s_e_int_dict.html" title="SEIntDict is a dictionary class of integers associated to strings.">SEIntDict</a> Values;
91 Props.<a name="a5"></a><a class="code" href="class_s_e_int_list.html#a3a1bc3c8f8112135fc13dd91464a1386">append</a>(<a name="a6"></a><a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23a41a492333cb3ded7bf369d53056f25d0">Message::P_AUTHOR</a>);
92 Props.<a class="code" href="class_s_e_int_list.html#a3a1bc3c8f8112135fc13dd91464a1386">append</a>(<a name="a7"></a><a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23ad1151928d4c8c152448c39ae641a43b2">Message::P_BODY_XML</a>);
93 Props.<a class="code" href="class_s_e_int_list.html#a3a1bc3c8f8112135fc13dd91464a1386">append</a>(<a name="a8"></a><a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23a97caddeeb99394fb7d3d0c7b8ec23a7f">Message::P_CONVO_ID</a>);
94 Values = message-&gt;GetProps(Props);
95 </pre></div><p>This enables us to output the message like this:</p>
96 <div class="fragment"><pre class="fragment">printf(<span class="stringliteral">&quot;%s : %s\n&quot;</span>, (<span class="keyword">const</span> <span class="keywordtype">char</span>*)Values[0], (<span class="keyword">const</span> <span class="keywordtype">char</span>*)Values[1]);
97 </pre></div><p>and send the automated reply message like this:</p>
98 <div class="fragment"><pre class="fragment"><a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a> Reply;
99 <a name="_a9"></a><a class="code" href="class_conversation_ref.html" title="Reference to an Conversation class instance, equivalent to Conversation::Ref.">Conversation::Ref</a> Conv(Values[2].toInt());
100 Conv-&gt;PostText(<span class="stringliteral">&quot;This is an automated reply.&quot;</span>, Reply, <span class="keyword">false</span>);
101 </pre></div><p>The second bool argument of the <a class="el" href="class_conversation.html#a8210a5a091cdc724f9aac967d0e15463">Conversation::PostText</a> is for cases when the message contains XML tags.</p>
102 <p>The third one will return a reference to a formed <a class="el" href="class_message.html" title="Events in a conversation context are expressed as a Messages. It is therefore useful...">Message</a> object.</p>
103 <h2><a class="anchor" id="Step3FullCode">
104 Full code of this example</a></h2>
105 <div class="fragment"><pre class="fragment"><span class="comment">/****************************************************************************</span>
106 <span class="comment"></span>
107 <span class="comment">Getting Started With SkypeKit. Tutorial Application, Step 3.</span>
108 <span class="comment"></span>
109 <span class="comment">In this example, we will write a simple SkypeKit-based auto-reply bot. The bot will: </span>
110 <span class="comment"> 1. Take a skypename and password as commmand-line arguments</span>
111 <span class="comment"> 2. Log in</span>
112 <span class="comment"> 3. Catch all incoming text chat messages</span>
113 <span class="comment"> 4. Send a canned reply message</span>
114 <span class="comment">**/</span>
115
116 <span class="preprocessor">#ifdef _WIN32</span>
117 <span class="preprocessor"></span><span class="preprocessor">#include &quot;Windows.h&quot;</span>
118 <span class="preprocessor">#else</span>
119 <span class="preprocessor"></span><span class="preprocessor">#include &lt;unistd.h&gt;</span>
120 <span class="preprocessor">#endif</span>
121 <span class="preprocessor"></span>
122 <span class="preprocessor">#include &quot;<a class="code" href="skype-embedded__2_8h.html">skype-embedded_2.h</a>&quot;</span>
123 <span class="preprocessor">#include &quot;<a class="code" href="skype-tcp-transport_8h.html">skype-tcp-transport.h</a>&quot;</span>
124 <span class="preprocessor">#include &quot;app_token.h&quot;</span>
125
126 <span class="keyword">using namespace </span>Sid;
127
128 <a name="_a10"></a><a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> inetAddr           = <span class="stringliteral">&quot;127.0.0.1&quot;</span>;
129 uint portNum                = 8963;
130
131 <span class="keywordtype">bool</span> LoggedIn               = <span class="keyword">false</span>;
132 <span class="keywordtype">bool</span> LoggedOut              = <span class="keyword">false</span>;
133
134 <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> MyAccountName;
135 <a class="code" href="class_s_e_string.html" title="SEString is basic char* based string class.">SEString</a> MyAccountPsw;
136
137 <a name="_a11"></a><a class="code" href="class_s_e_t_c_p_transport.html" title="TCP transport to skypekit.">SETCPTransport</a>* transport   = 0;
138
139
140 <span class="keywordtype">void</span> debugOut(<span class="keyword">const</span> <span class="keywordtype">char</span>* out)
141 {
142     <span class="comment">//printf(&quot;%s&quot;, out);</span>
143 }
144
145 <span class="keywordtype">void</span> Delay(<span class="keywordtype">int</span> Ms)
146 {
147 <span class="preprocessor">    #ifdef _WIN32</span>
148 <span class="preprocessor"></span>        Sleep(Ms);
149 <span class="preprocessor">    #else</span>
150 <span class="preprocessor"></span>        sleep(Ms);
151 <span class="preprocessor">    #endif</span>
152 <span class="preprocessor"></span>};
153
154 <span class="comment">//---------------------------------------------------------------------------------------</span>
155 <span class="comment">// Subclassing Account</span>
156
157 <span class="keyword">class </span>MyAccount : <span class="keyword">public</span> <a name="_a12"></a><a class="code" href="class_account.html" title="Represents a local account. Encapsulates methods for Skype account creation, login...">Account</a>
158 {
159 <span class="keyword">public</span>:
160     <span class="keyword">typedef</span> <a name="_a13"></a><a class="code" href="struct_d_ref.html" title="Used for downcast the skypekit references to references to you own derived classes...">DRef&lt;MyAccount, Account&gt;</a> Ref;
161     MyAccount(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oid, <a name="_a14"></a><a class="code" href="class_s_e_root_object.html" title="SERootObject is the root module and entry point for API.">SERootObject</a>* root);
162     ~MyAccount() {};
163
164     <span class="keywordtype">void</span> <a name="a15"></a><a class="code" href="class_s_e_object.html#a9bbdb15b8b15ac9c3471da3855f67227">OnChange</a>(<span class="keywordtype">int</span> prop);
165 };
166
167 MyAccount::MyAccount(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oid, <a class="code" href="class_s_e_root_object.html" title="SERootObject is the root module and entry point for API.">SERootObject</a>* root) : <a class="code" href="class_account.html" title="Represents a local account. Encapsulates methods for Skype account creation, login...">Account</a>(oid, root) {};
168
169 <span class="keywordtype">void</span> <a class="code" href="class_s_e_object.html#a9bbdb15b8b15ac9c3471da3855f67227">MyAccount::OnChange</a>(<span class="keywordtype">int</span> prop)
170 {
171     <span class="keywordflow">if</span> (prop == <a name="a16"></a><a class="code" href="class_account.html#a0e7af48c2ba1d22690d83f5adbc071c5a61a8b512c81fd58cbcd6ea8f9e8d54af">Account::P_STATUS</a>)
172     {
173         <a class="code" href="class_account.html#ac2cd2fd3f85a302363a51db3ba97c90d">Account::STATUS</a> LoginStatus;
174         GetPropStatus(LoginStatus);
175         <span class="keywordflow">if</span> (LoginStatus == <a name="a17"></a><a class="code" href="class_account.html#ac2cd2fd3f85a302363a51db3ba97c90dac2c5c7998621e577285e6c4517a897bd">Account::LOGGED_IN</a>)        { LoggedIn  = <span class="keyword">true</span>; };
176         <span class="keywordflow">if</span> (LoginStatus == <a name="a18"></a><a class="code" href="class_account.html#ac2cd2fd3f85a302363a51db3ba97c90dac506fb36d2c2004e4f9abe5c64941c3d">Account::LOGGED_OUT</a>)       { LoggedOut = <span class="keyword">true</span>; };
177     };
178 };
179
180 <span class="comment">//---------------------------------------------------------------------------------------</span>
181 <span class="comment">// Subclassing Skype</span>
182
183 <span class="keyword">class </span>MySkype : <span class="keyword">public</span> <a name="_a19"></a><a class="code" href="class_skype.html" title="The main class that exposes Skype-related functionality to your application.">Skype</a>
184 {
185 <span class="keyword">public</span>:
186     MySkype(<a name="_a20"></a><a class="code" href="class_s_e_transport.html" title="Abstract interface for transport layer.">SETransport</a>* transport) : <a class="code" href="class_skype.html" title="The main class that exposes Skype-related functionality to your application.">Skype</a>(transport) {}
187     ~MySkype() {}
188     <a class="code" href="class_account.html" title="Represents a local account. Encapsulates methods for Skype account creation, login...">Account</a>* <a name="a21"></a><a class="code" href="class_skype.html#a3f609b824744b88ec82b47e460116b92">newAccount</a>(<span class="keywordtype">int</span> oid) {<span class="keywordflow">return</span> <span class="keyword">new</span> MyAccount(oid, <span class="keyword">this</span>);}
189
190     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a name="a22"></a><a class="code" href="class_skype.html#a7354ad58c7301f5f27f6e0315f4b3301">OnMessage</a>(
191         <span class="keyword">const</span> <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; message,
192         <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; changesInboxTimestamp,
193         <span class="keyword">const</span> <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; supersedesHistoryMessage,
194         <span class="keyword">const</span> <a class="code" href="class_conversation_ref.html" title="Reference to an Conversation class instance, equivalent to Conversation::Ref.">Conversation::Ref</a>&amp; conversation);
195 };
196
197 <span class="keywordtype">void</span> <a class="code" href="class_skype.html#a7354ad58c7301f5f27f6e0315f4b3301">MySkype::OnMessage</a>(
198         <span class="keyword">const</span> <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; message,
199         <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; changesInboxTimestamp,
200         <span class="keyword">const</span> <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a>&amp; supersedesHistoryMessage,
201         <span class="keyword">const</span> <a class="code" href="class_conversation_ref.html" title="Reference to an Conversation class instance, equivalent to Conversation::Ref.">Conversation::Ref</a>&amp; conversation)
202 {
203         <span class="keywordtype">int</span> MessageType = message-&gt;GetProp(<a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23a747c40ef95a5a90497a69c8979181738">Message::P_TYPE</a>).toInt();
204         <span class="keywordflow">if</span> (MessageType == <a class="code" href="class_message.html#a5305592a3170872320962a09d8a1c7fea91b2b91db678c2d6134ff63511e5c133">Message::POSTED_TEXT</a>)
205         {
206             <a class="code" href="class_s_e_int_list.html" title="SEIntList represents a list of integers.">SEIntList</a> Props;
207             <a class="code" href="class_s_e_int_dict.html" title="SEIntDict is a dictionary class of integers associated to strings.">SEIntDict</a> Values;
208             Props.<a class="code" href="class_s_e_int_list.html#a3a1bc3c8f8112135fc13dd91464a1386">append</a>(<a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23a41a492333cb3ded7bf369d53056f25d0">Message::P_AUTHOR</a>);
209             Props.<a class="code" href="class_s_e_int_list.html#a3a1bc3c8f8112135fc13dd91464a1386">append</a>(<a class="code" href="class_message.html#a5012b8f0a3fcd1fec7bf3e6ba326ce23ad1151928d4c8c152448c39ae641a43b2">Message::P_BODY_XML</a>);
210             Values = message-&gt;GetProps(Props);
211
212             <span class="keywordflow">if</span> (Values[0] != MyAccountName)
213             {
214                 printf(<span class="stringliteral">&quot;%s : %s\n&quot;</span>,
215                 (<span class="keyword">const</span> <span class="keywordtype">char</span>*)Values[0],
216                 (<span class="keyword">const</span> <span class="keywordtype">char</span>*)Values[1]);
217
218                 <a class="code" href="class_message_ref.html" title="Reference to an Message class instance, equivalent to Message::Ref.">Message::Ref</a> Reply;
219                 conversation-&gt;PostText(<span class="stringliteral">&quot;This is an automated reply.&quot;</span>, Reply, <span class="keyword">false</span>);
220             }
221         }
222 };
223
224
225 <span class="comment">//---------------------------------------------------------------------------------------</span>
226 <span class="comment">// Main</span>
227
228 MySkype* skype = 0;
229
230 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[])
231 {
232     printf(<span class="stringliteral">&quot;*****************************************************************\n&quot;</span>);
233     printf(<span class="stringliteral">&quot; SkypeKit Tutorial, Step 3. - Getting and sending chat messages.\n&quot;</span>);
234     printf(<span class="stringliteral">&quot;*****************************************************************\n&quot;</span>);
235
236     <span class="keywordflow">if</span> (argc &lt; 3)
237     {
238         printf(<span class="stringliteral">&quot;usage: tutorial_3 &lt;skypename&gt; &lt;password&gt;\n&quot;</span>);
239         <span class="keywordflow">return</span> 0;
240     };
241
242     MyAccountName = argv[1];
243     MyAccountPsw = argv[2];
244
245     printf(<span class="stringliteral">&quot;Creating transport ..\n&quot;</span>);
246     transport = <span class="keyword">new</span> <a class="code" href="class_s_e_t_c_p_transport.html" title="TCP transport to skypekit.">SETCPTransport</a>(inetAddr, portNum);
247     printf(<span class="stringliteral">&quot;Creating skype ..\n&quot;</span>);
248     skype = <span class="keyword">new</span> MySkype(transport);
249     skype-&gt;log = &amp;(debugOut);
250
251     skype-&gt;init();
252     skype-&gt;start();
253
254     printf(<span class="stringliteral">&quot;Submitting application token..\n&quot;</span>);
255     skype-&gt;SetApplicationToken(AppToken);
256
257     printf(<span class="stringliteral">&quot;Retrieving account ..\n&quot;</span>);
258     MyAccount::Ref A;
259
260     <span class="keywordflow">if</span> (skype-&gt;GetAccount(MyAccountName, A))
261     {
262         printf(<span class="stringliteral">&quot;Logging in..\n&quot;</span>);
263         A-&gt;LoginWithPassword(MyAccountPsw, <span class="keyword">false</span>, <span class="keyword">true</span>);
264         <span class="keywordflow">while</span> (!LoggedIn) {Delay(1);};
265         printf(<span class="stringliteral">&quot;Loggin complete.\n&quot;</span>);
266
267         <span class="keywordtype">char</span> Ch;
268         printf(<span class="stringliteral">&quot;Now accepting incoming chat messages.\n&quot;</span>);
269         printf(<span class="stringliteral">&quot;Press ENTER to quit.\n&quot;</span>);
270         Ch = getchar();
271
272         printf(<span class="stringliteral">&quot;Logging out..\n&quot;</span>);
273         A-&gt;Logout(<span class="keyword">false</span>);
274
275         <span class="keywordflow">while</span> (!LoggedOut) {Delay(1);};
276         printf(<span class="stringliteral">&quot;Logout complete.\n&quot;</span>);
277     }
278     <span class="keywordflow">else</span>
279     {
280         printf(<span class="stringliteral">&quot;Account does not exist\n&quot;</span>);
281     };
282
283     printf(<span class="stringliteral">&quot;Cleaning up.\n&quot;</span>);
284     skype-&gt;stop();
285     skype-&gt;cleanup();
286     <span class="keyword">delete</span> skype;
287     <span class="keyword">delete</span> transport;
288     printf(<span class="stringliteral">&quot;Done.\n&quot;</span>);
289     <span class="keywordflow">return</span> 0;
290 };
291 </pre></div> </div>
292
293 <hr/>   
294                 <p><b>(c) Skype Technologies S.A. Confidential/Proprietary</b></p>              
295                 <p>Last updated: 18 Jun 2010</p>                
296                 </BODY>
297 </HTML>