Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 1d7e4a84435f8a9172037d395187297e > files > 122

libkate-devel-0.4.1-13.mga7.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libkate: high.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libkate
   &#160;<span id="projectnumber">0.4.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">high.c</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">  This shows how to use the high level decoding API to easily decode</span></div><div class="line"><span class="comment">  a Kate stream.</span></div><div class="line"><span class="comment">  For clarity, error checking is omitted.</span></div><div class="line"><span class="comment">  For simplicity, the input is assumed to be a single Kate stream.</span></div><div class="line"><span class="comment">  Usually, Kate streams will be multiplexed with other streams (either</span></div><div class="line"><span class="comment">  other Kate streams, or audio, or video). In these cases, the Ogg</span></div><div class="line"><span class="comment">  part will have to be more complex, but the Kate specific code will</span></div><div class="line"><span class="comment">  be the same.</span></div><div class="line"><span class="comment">  */</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;ogg/ogg.h&gt;</span></div><div class="line"><span class="preprocessor">#include &quot;common.h&quot;</span></div><div class="line"></div><div class="line"><span class="comment">/* All the libkate API is available from the main kate header file: */</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="kate_8h.html">kate/kate.h</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  ogg_sync_state oy;</div><div class="line">  ogg_stream_state os;</div><div class="line">  <span class="keywordtype">int</span> init=0;</div><div class="line">  ogg_packet op;</div><div class="line">  <a name="_a0"></a><a class="code" href="structkate__state.html">kate_state</a> k;</div><div class="line">  <span class="keyword">const</span> <a name="_a1"></a><a class="code" href="structkate__event.html">kate_event</a> *ev;</div><div class="line">  <a name="_a2"></a><a class="code" href="structkate__packet.html">kate_packet</a> kp;</div><div class="line"></div><div class="line">  <span class="comment">/* for the benefit of windows, which mangles data otherwise */</span></div><div class="line">  set_binary_file(stdin);</div><div class="line"></div><div class="line">  <span class="comment">/* we initialize ogg and the kate state  */</span></div><div class="line">  ogg_sync_init(&amp;oy);</div><div class="line">  <span class="keywordtype">int</span> ret=<a name="a3"></a><a class="code" href="group__high.html#ga810984fb4ec910632c250672d39feee4">kate_high_decode_init</a>(&amp;k);</div><div class="line"></div><div class="line">  <span class="comment">/*</span></div><div class="line"><span class="comment">    We then read packets and feed them to the libkate high level API. When</span></div><div class="line"><span class="comment">    kate_high_decode_packetin returns a positive number, this signals the</span></div><div class="line"><span class="comment">    end of the stream.</span></div><div class="line"><span class="comment">    */</span></div><div class="line">  <span class="keywordflow">while</span> (1) {</div><div class="line">    <span class="keywordflow">if</span> (get_packet(&amp;oy,&amp;os,&amp;init,&amp;op)) <span class="keywordflow">break</span>;</div><div class="line">    <a name="a4"></a><a class="code" href="group__packet.html#ga7c0c2af28df8ea89f5f62e830dc916b1">kate_packet_wrap</a>(&amp;kp,op.bytes,op.packet);</div><div class="line">    <span class="keywordflow">if</span> (<a name="a5"></a><a class="code" href="group__high.html#ga4c9bac57e090c34e778b6f080cd4df82">kate_high_decode_packetin</a>(&amp;k,&amp;kp,&amp;ev)&gt;0) <span class="keywordflow">break</span>;</div><div class="line">    <span class="comment">/* if the event is non NULL, we have an event */</span></div><div class="line">    <span class="keywordflow">if</span> (ev) {</div><div class="line">      printf(<span class="stringliteral">&quot;Kate stream has text: %s\n&quot;</span>,ev-&gt;<a name="a6"></a><a class="code" href="structkate__event.html#ae10745a5078521816cc07a09654fbfd4">text</a>);</div><div class="line">    }</div><div class="line">  }</div><div class="line"></div><div class="line">  <span class="comment">/* That&#39;s it, we can now cleanup */</span></div><div class="line">  ogg_stream_clear(&amp;os);</div><div class="line">  ogg_sync_clear(&amp;oy);</div><div class="line"></div><div class="line">  <a name="a7"></a><a class="code" href="group__high.html#ga8faebcd4839fb5a2bced259f8560f47f">kate_high_decode_clear</a>(&amp;k);</div><div class="line"></div><div class="line">  <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>