1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>KLone: codec.h Source File</title>
<link href="kl.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<div class="nav">
<a class="el" href="dir_000002.html">klone</a></div>
<h1>codec.h</h1><a href="codec_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
00002 <span class="comment"> * Copyright (c) 2005, 2006 by KoanLogic s.r.l. <http://www.koanlogic.com></span>
00003 <span class="comment"> * All rights reserved.</span>
00004 <span class="comment"> *</span>
00005 <span class="comment"> * This file is part of KLone, and as such it is subject to the license stated</span>
00006 <span class="comment"> * in the LICENSE file which you have received as part of this distribution.</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * $Id: codec.h,v 1.12 2006/01/09 12:38:37 tat Exp $</span>
00009 <span class="comment"> */</span>
00010
00011 <span class="preprocessor">#ifndef _KLONE_CODEC_H_</span>
00012 <span class="preprocessor"></span><span class="preprocessor">#define _KLONE_CODEC_H_</span>
00013 <span class="preprocessor"></span>
00014 <span class="preprocessor">#include <sys/types.h></span>
00015 <span class="preprocessor">#include <stdlib.h></span>
00016 <span class="preprocessor">#include <stdarg.h></span>
00017 <span class="preprocessor">#include <u/libu.h></span>
00018
00019 <span class="preprocessor">#ifdef __cplusplus</span>
00020 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00021 <span class="preprocessor">#endif </span>
00022 <span class="preprocessor"></span>
00023 <span class="keyword">enum</span> { CODEC_FLUSH_COMPLETE, <a class="code" href="codec_8h.html#a10a6">CODEC_FLUSH_CHUNK</a> };
00024
00025 <span class="keyword">enum</span> { <a class="code" href="codec_8h.html#a11a7">CODEC_BUFSZ</a> = 4096 };
00026
00027 <a class="code" href="field_8h.html#a5">TAILQ_HEAD</a>(codec_chain_s, <a class="code" href="structcodec__s.html">codec_s</a>);
<a name="l00028"></a><a class="code" href="codec_8h.html#a0">00028</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>codec_chain_s <a class="code" href="codec_8h.html#a0">codec_chain_t</a>;
00029
<a name="l00030"></a><a class="code" href="codec_8h.html#a1">00030</a> <span class="keyword">typedef</span> ssize_t (*codec_transform_t) (<span class="keyword">struct </span><a class="code" href="structcodec__s.html">codec_s</a> *codec,
00031 <span class="keywordtype">char</span> *dst, size_t *dst_cnt, <span class="keyword">const</span> <span class="keywordtype">char</span> *src, size_t src_sz);
00032
<a name="l00033"></a><a class="code" href="codec_8h.html#a2">00033</a> <span class="keyword">typedef</span> ssize_t (*codec_flush_t) (<span class="keyword">struct </span><a class="code" href="structcodec__s.html">codec_s</a> *codec,
00034 <span class="keywordtype">char</span> *dst, size_t *dst_cnt);
00035
<a name="l00036"></a><a class="code" href="codec_8h.html#a3">00036</a> <span class="keyword">typedef</span> int (*codec_free_t) (<span class="keyword">struct </span><a class="code" href="structcodec__s.html">codec_s</a> *codec);
00037
<a name="l00038"></a><a class="code" href="structcodec__s.html">00038</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structcodec__s.html">codec_s</a>
00039 {
<a name="l00040"></a><a class="code" href="structcodec__s.html#o0">00040</a> <a class="code" href="codec_8h.html#a1">codec_transform_t</a> transform;
<a name="l00041"></a><a class="code" href="structcodec__s.html#o1">00041</a> <a class="code" href="codec_8h.html#a2">codec_flush_t</a> flush;
<a name="l00042"></a><a class="code" href="structcodec__s.html#o2">00042</a> <a class="code" href="codec_8h.html#a3">codec_free_t</a> free;
00043
00044 <span class="comment">/* codec buffer */</span>
<a name="l00045"></a><a class="code" href="structcodec__s.html#o3">00045</a> <span class="keywordtype">char</span> cbuf[CODEC_BUFSZ];
<a name="l00046"></a><a class="code" href="structcodec__s.html#o5">00046</a> size_t ccount, coff;
00047
00048 <span class="comment">/* chain next & prev pointer */</span>
00049 TAILQ_ENTRY(<a class="code" href="structcodec__s.html">codec_s</a>) np;
00050 } <a class="code" href="structcodec__s.html">codec_t</a>;
00051
00052 <span class="keywordtype">int</span> codec_free(<a class="code" href="structcodec__s.html">codec_t</a> *codec);
00053
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057
00058 #endif
</pre></div><hr>
<div>
<div style="text-align:left">
<a href="http://www.koanlogic.com/kl/cont/gb/html/products.html">←Products</a>
</div>
<div style="text-align:center;">
© 2005-2006 - <a href="http://www.koanlogic.com">KoanLogic S.r.l.</a> - All rights reserved
</div>
</div>
</body>
</html>
|