/usr/share/gtk-doc/html/libepc-1.0/libepc-1.0-contents.html is in libepc-doc 0.4.4-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EpcContents</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Easy Publish and Consume Reference Manual">
<link rel="up" href="publishing.html" title="Publishing">
<link rel="prev" href="libepc-1.0-auth-context.html" title="EpcAuthContext">
<link rel="next" href="libepc-1.0-publisher.html" title="EpcPublisher">
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libepc-1.0-auth-context.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="publishing.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Easy Publish and Consume Reference Manual</th>
<td><a accesskey="n" href="libepc-1.0-publisher.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libepc-1.0-contents.synopsis" class="shortcut">Top</a>
|
<a href="#libepc-1.0-contents.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libepc-1.0-contents"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libepc-1.0-contents.top_of_page"></a>EpcContents</span></h2>
<p>EpcContents — custom contents</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libepc-1.0-contents.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="libepc-1.0-contents.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <libepc/contents.h>
<span class="returnvalue">gboolean</span> (<a class="link" href="libepc-1.0-contents.html#EpcContentsReadFunc" title="EpcContentsReadFunc ()">*EpcContentsReadFunc</a>) (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> buffer</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents">EpcContents</a>;
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * <a class="link" href="libepc-1.0-contents.html#epc-contents-new" title="epc_contents_new ()">epc_contents_new</a> (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">gssize</span> length</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> destroy_data</code></em>);
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * <a class="link" href="libepc-1.0-contents.html#epc-contents-new-dup" title="epc_contents_new_dup ()">epc_contents_new_dup</a> (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><span class="type">gconstpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">gssize</span> length</code></em>);
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * <a class="link" href="libepc-1.0-contents.html#epc-contents-ref" title="epc_contents_ref ()">epc_contents_ref</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libepc-1.0-contents.html#epc-contents-unref" title="epc_contents_unref ()">epc_contents_unref</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);
<span class="returnvalue">gconstpointer</span> <a class="link" href="libepc-1.0-contents.html#epc-contents-get-data" title="epc_contents_get_data ()">epc_contents_get_data</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libepc-1.0-contents.html#epc-contents-get-mime-type" title="epc_contents_get_mime_type ()">epc_contents_get_mime_type</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()">epc_contents_stream_new</a> (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContentsReadFunc" title="EpcContentsReadFunc ()"><span class="type">EpcContentsReadFunc</span></a> callback</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> destroy_data</code></em>);
<span class="returnvalue">gconstpointer</span> <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()">epc_contents_stream_read</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="libepc-1.0-contents.html#epc-contents-is-stream" title="epc_contents_is_stream ()">epc_contents_is_stream</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.description"></a><h2>Description</h2>
<p>
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> is a reference counted structure for storing custom contents.
To publish custom content call <a class="link" href="libepc-1.0-publisher.html#epc-publisher-add-handler" title="epc_publisher_add_handler ()"><code class="function">epc_publisher_add_handler()</code></a> to register a
<a class="link" href="libepc-1.0-publisher.html#EpcContentsHandler" title="EpcContentsHandler ()"><span class="type">EpcContentsHandler</span></a> like this:
</p>
<p>
</p>
<div class="example">
<a name="custom-contents-handler"></a><p class="title"><b>Example 5. A custom contents handler</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> <a href="libepc-1.0-contents.html#EpcContents">EpcContents</a></span><span class="symbol">*</span>
<span class="function">timestamp_handler</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="libepc-1.0-publisher.html#EpcPublisher">EpcPublisher</a> </span><span class="symbol">*</span><span class="usertype">publisher</span><span class="normal"> G_GNUC_UNUSED</span><span class="symbol">,</span>
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> gchar </span><span class="symbol">*</span><span class="usertype">key</span><span class="normal"> G_GNUC_UNUSED</span><span class="symbol">,</span>
<span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">time_t</span><span class="normal"> now </span><span class="symbol">=</span><span class="normal"> </span><span class="function">time</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">tm</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">tm </span><span class="symbol">=</span><span class="normal"> </span><span class="function">localtime</span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">now</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">format </span><span class="symbol">=</span><span class="normal"> data</span><span class="symbol">;</span>
<span class="normal"> </span><span class="usertype">gsize</span><span class="normal"> length </span><span class="symbol">=</span><span class="normal"> </span><span class="number">60</span><span class="symbol">;</span>
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">buffer</span><span class="symbol">;</span>
<span class="normal"> buffer </span><span class="symbol">=</span><span class="normal"> </span><span class="function">g_malloc</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">length</span><span class="symbol">);</span>
<span class="normal"> length </span><span class="symbol">=</span><span class="normal"> </span><span class="function">strftime</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">buffer</span><span class="symbol">,</span><span class="normal"> length</span><span class="symbol">,</span><span class="normal"> format</span><span class="symbol">,</span><span class="normal"> tm</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="function">epc_content_new</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"text/plain"</span><span class="symbol">,</span><span class="normal"> buffer</span><span class="symbol">,</span><span class="normal"> length</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="EpcContentsReadFunc"></a><h3>EpcContentsReadFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> (*EpcContentsReadFunc) (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> buffer</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>
This callback is used to retrieve the next chunk of data for a streaming
contents buffer created with <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><span class="type">epc_contents_stream_read</span></a>.
</p>
<p>
Return <code class="literal">FALSE</code> when the buffer has reached its end, and no more data is
available. Also return <code class="literal">FALSE</code>, when the buffer size passed in <em class="parameter"><code>length</code></em> is
not sufficient. Copy your minimal buffer size to <em class="parameter"><code>length</code></em> in that situation.
</p>
<p>
The library might pass <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>buffer</code></em> on the first call to start buffer
size negotation.
</p>
<p>
See also: <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()"><span class="type">epc_contents_stream_new</span></a>, <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><span class="type">epc_contents_stream_read</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a location for storing the contents, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a location for passing and storing the contents length in bytes.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the user_data passed to <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()"><span class="type">epc_contents_stream_new</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <code class="literal">TRUE</code> when the next chunk could be read, and <code class="literal">FALSE</code> on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="EpcContents"></a><h3>EpcContents</h3>
<pre class="programlisting">typedef struct _EpcContents EpcContents;</pre>
<p>
A reference counted buffer for storing contents to deliver by the
<a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>. Use <a class="link" href="libepc-1.0-contents.html#epc-contents-new" title="epc_contents_new ()"><code class="function">epc_contents_new()</code></a> or <a class="link" href="libepc-1.0-contents.html#epc-contents-new-dup" title="epc_contents_new_dup ()"><span class="type">epc_contents_new_dup</span></a> to create
instances of this buffer.
</p>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-new"></a><h3>epc_contents_new ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * epc_contents_new (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">gssize</span> length</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> destroy_data</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer, and takes ownership of the <em class="parameter"><code>data</code></em> passed.
Passing <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>type</code></em> is equivalent to passing "application/octet-stream".
</p>
<p>
See also: epc_contents_new_dup, epc_contents_stream_new
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the MIME type of this contents, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>static contents for the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the contents length in bytes, or -1 if <em class="parameter"><code>data</code></em> is a null-terminated string.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
<td>This function will be called to free <em class="parameter"><code>data</code></em> when it is no longer needed.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-new-dup"></a><h3>epc_contents_new_dup ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * epc_contents_new_dup (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><span class="type">gconstpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">gssize</span> length</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer, and copies the <em class="parameter"><code>data</code></em> passed.
Passing <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>type</code></em> is equivalent to passing "application/octet-stream".
</p>
<p>
See also: epc_contents_new, epc_contents_stream_new
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the MIME type of this contents, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>static contents for the buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the content's length in bytes, or -1 if <em class="parameter"><code>data</code></em> is a null-terminated string.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-ref"></a><h3>epc_contents_ref ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * epc_contents_ref (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);</pre>
<p>
Increases the reference count of <em class="parameter"><code>contents</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the same <em class="parameter"><code>contents</code></em> buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-unref"></a><h3>epc_contents_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> epc_contents_unref (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);</pre>
<p>
Decreases the reference count of <em class="parameter"><code>contents</code></em>.
When its reference count drops to 0, the buffer is released
(i.e. its memory is freed).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-get-data"></a><h3>epc_contents_get_data ()</h3>
<pre class="programlisting"><span class="returnvalue">gconstpointer</span> epc_contents_get_data (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>);</pre>
<p>
Retrieves the contents of a static contents buffer created with
<a class="link" href="libepc-1.0-contents.html#epc-contents-new" title="epc_contents_new ()"><code class="function">epc_contents_new()</code></a>. Any other buffer returns <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>. The data returned
is owned by the <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer and must not be freeded.
</p>
<p>
See also: <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><code class="function">epc_contents_stream_read()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a location for storing the contents length</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns the static buffer contents, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>. This should not be freed or modified.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-get-mime-type"></a><h3>epc_contents_get_mime_type ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * epc_contents_get_mime_type (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);</pre>
<p>
Queries the MIME type associated with the buffer. Returns the MIME
type specified for <a class="link" href="libepc-1.0-contents.html#epc-contents-new" title="epc_contents_new ()"><code class="function">epc_contents_new()</code></a> or <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()"><span class="type">epc_contents_stream_new</span></a>,
or "application/octet-stream" when <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> was passed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns the MIME type of the buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-stream-new"></a><h3>epc_contents_stream_new ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> * epc_contents_stream_new (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>,
<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContentsReadFunc" title="EpcContentsReadFunc ()"><span class="type">EpcContentsReadFunc</span></a> callback</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> destroy_data</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer for large contents like movie files,
which cannot, or should be delivered as solid blob of data.
</p>
<p>
Passing <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>type</code></em> is equivalent to passing "application/octet-stream".
</p>
<p>
See also: <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><code class="function">epc_contents_stream_read()</code></a>, <a class="link" href="libepc-1.0-contents.html#epc-contents-is-stream" title="epc_contents_is_stream ()"><span class="type">epc_contents_is_stream</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the MIME type of this contents, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>the function for retrieving chunks</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>data which will be passed to <em class="parameter"><code>callback</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
<td>This function will be called to free <em class="parameter"><code>user_data</code></em> when it is no longer needed.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-stream-read"></a><h3>epc_contents_stream_read ()</h3>
<pre class="programlisting"><span class="returnvalue">gconstpointer</span> epc_contents_stream_read (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>);</pre>
<p>
Retrieves the next chunk of data for a streaming contents buffer created
with <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><code class="function">epc_contents_stream_read()</code></a>. <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> is returned, when the buffer has
reached its end, or isn't a streaming contents buffer.
</p>
<p>
The data returned is owned by the <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer and must not be
freeded by the called. Make sure to copy the returned data before the
function again, as repeated calls to the function might return the
same buffer, but filled with new data.
</p>
<p>
See also: <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()"><code class="function">epc_contents_stream_new()</code></a>, <a class="link" href="libepc-1.0-contents.html#epc-contents-is-stream" title="epc_contents_is_stream ()"><span class="type">epc_contents_is_stream</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a location for storing the contents length</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns the next chunk of data, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>. The should not be freed or modified.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-is-stream"></a><h3>epc_contents_is_stream ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> epc_contents_is_stream (<em class="parameter"><code><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> *contents</code></em>);</pre>
<p>
Checks if stream routines can be used for retreiving
the contents of the buffer.
</p>
<p>
See also: <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()"><code class="function">epc_contents_stream_new()</code></a>, <a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()"><span class="type">epc_contents_stream_read</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>contents</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Returns <code class="literal">TRUE</code> when stream routines have to be used.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.see-also"></a><h2>See Also</h2>
<a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18.1</div>
</body>
</html>
|