/usr/share/gtk-doc/html/libepc-1.0/libepc-1.0-contents.html is in libepc-doc 0.4.6-1.
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 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | <!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: Easy Publish and Consume Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.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.25 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libepc-1.0-contents.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="publishing.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libepc-1.0-auth-context.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libepc-1.0-publisher.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></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 class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libepc-1.0-contents.stability-level"></a><h2>Stability Level</h2>
<a href="http://foldoc.org/Unstable"><span class="acronym">Unstable</span></a>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libepc-1.0-contents.html#EpcContentsReadFunc" title="EpcContentsReadFunc ()">*EpcContentsReadFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> *
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-new" title="epc_contents_new ()">epc_contents_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> *
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-new-dup" title="epc_contents_new_dup ()">epc_contents_new_dup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> *
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-ref" title="epc_contents_ref ()">epc_contents_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-unref" title="epc_contents_unref ()">epc_contents_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gconstpointer"><span class="returnvalue">gconstpointer</span></a>
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-get-data" title="epc_contents_get_data ()">epc_contents_get_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<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> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="returnvalue">EpcContents</span></a> *
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-stream-new" title="epc_contents_stream_new ()">epc_contents_stream_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gconstpointer"><span class="returnvalue">gconstpointer</span></a>
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-stream-read" title="epc_contents_stream_read ()">epc_contents_stream_read</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libepc-1.0-contents.html#epc-contents-is-stream" title="epc_contents_is_stream ()">epc_contents_is_stream</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents">EpcContents</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <libepc/contents.h>
</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>
<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="gtkdoc kwb">static</span> EpcContents<span class="gtkdoc opt">*</span>
<span class="function">timestamp_handler</span> <span class="gtkdoc opt">(</span>EpcPublisher <span class="gtkdoc opt">*</span>publisher G_GNUC_UNUSED<span class="gtkdoc opt">,</span>
<span class="gtkdoc kwb">const</span> gchar <span class="gtkdoc opt">*</span>key G_GNUC_UNUSED<span class="gtkdoc opt">,</span>
gpointer data<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
<span class="gtkdoc kwb">time_t</span> now <span class="gtkdoc opt">=</span> <span class="function">time</span> <span class="gtkdoc opt">(</span>NULL<span class="gtkdoc opt">);</span>
<span class="gtkdoc kwb">struct</span> tm <span class="gtkdoc opt">*</span>tm <span class="gtkdoc opt">=</span> <span class="function">localtime</span> <span class="gtkdoc opt">(&</span>now<span class="gtkdoc opt">);</span>
<span class="gtkdoc kwb">const</span> gchar <span class="gtkdoc opt">*</span>format <span class="gtkdoc opt">=</span> data<span class="gtkdoc opt">;</span>
gsize length <span class="gtkdoc opt">=</span> <span class="number">60</span><span class="gtkdoc opt">;</span>
gchar <span class="gtkdoc opt">*</span>buffer<span class="gtkdoc opt">;</span>
buffer <span class="gtkdoc opt">=</span> <span class="function"><a href="/usr/share/gtk-doc/html/glibglib-Memory-Allocation.html#g-malloc">g_malloc</a></span> <span class="gtkdoc opt">(</span>length<span class="gtkdoc opt">);</span>
length <span class="gtkdoc opt">=</span> <span class="function">strftime</span> <span class="gtkdoc opt">(</span>buffer<span class="gtkdoc opt">,</span> length<span class="gtkdoc opt">,</span> format<span class="gtkdoc opt">,</span> tm<span class="gtkdoc opt">);</span>
<span class="keyword">return</span> <span class="function">epc_content_new</span> <span class="gtkdoc opt">(</span><span class="string">"text/plain"</span><span class="gtkdoc opt">,</span> buffer<span class="gtkdoc opt">,</span> length<span class="gtkdoc opt">);</span>
<span class="gtkdoc opt">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="example-break">
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="EpcContentsReadFunc"></a><h3>EpcContentsReadFunc ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*EpcContentsReadFunc<span class="c_punctuation">)</span> (<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><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> 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 <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> when the buffer has reached its end, and no more data is
available. Also return <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, 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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="EpcContentsReadFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>a location for storing the contents, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>a location for passing and storing the contents length in bytes.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>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></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="EpcContentsReadFunc.returns"></a><h4>Returns</h4>
<p> Returns <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when the next chunk could be read, and <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error.</p>
</div>
</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 <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> 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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="epc-contents-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>the MIME type of this contents, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>static contents for the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the contents length in bytes, or -1 if <em class="parameter"><code>data</code></em>
is a null-terminated string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>destroy_data</p></td>
<td class="parameter_description"><p>This function will be called to free <em class="parameter"><code>data</code></em>
when it is no longer needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-new.returns"></a><h4>Returns</h4>
<p> The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</p>
</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 <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *type</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> 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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="epc-contents-new-dup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>the MIME type of this contents, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>static contents for the buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the content's length in bytes, or -1 if <em class="parameter"><code>data</code></em>
is a null-terminated string. </p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-new-dup.returns"></a><h4>Returns</h4>
<p> The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</p>
</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="refsect3">
<a name="epc-contents-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-ref.returns"></a><h4>Returns</h4>
<p> the same <em class="parameter"><code>contents</code></em>
buffer.</p>
</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="refsect3">
<a name="epc-contents-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-get-data"></a><h3>epc_contents_get_data ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gconstpointer"><span class="returnvalue">gconstpointer</span></a>
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><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="epc-contents-get-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>a location for storing the contents length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-get-data.returns"></a><h4>Returns</h4>
<p> Returns the static buffer contents, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. This should not be freed or modified.</p>
</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 <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> was passed.</p>
<div class="refsect3">
<a name="epc-contents-get-mime-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-get-mime-type.returns"></a><h4>Returns</h4>
<p> Returns the MIME type of the buffer.</p>
</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 <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *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><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> 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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="epc-contents-stream-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>the MIME type of this contents, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>the function for retrieving chunks</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data which will be passed to <em class="parameter"><code>callback</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>destroy_data</p></td>
<td class="parameter_description"><p>This function will be called to free <em class="parameter"><code>user_data</code></em>
when it is no longer needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-stream-new.returns"></a><h4>Returns</h4>
<p> The newly created <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-stream-read"></a><h3>epc_contents_stream_read ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gconstpointer"><span class="returnvalue">gconstpointer</span></a>
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><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *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="/usr/share/gtk-doc/html/glibglib-Standard-Macros.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="refsect3">
<a name="epc-contents-stream-read.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>a location for storing the contents length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-stream-read.returns"></a><h4>Returns</h4>
<p> Returns the next chunk of data, or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. The should not be freed or modified.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="epc-contents-is-stream"></a><h3>epc_contents_is_stream ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
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="refsect3">
<a name="epc-contents-is-stream.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>contents</p></td>
<td class="parameter_description"><p>a <a class="link" href="libepc-1.0-contents.html#EpcContents" title="EpcContents"><span class="type">EpcContents</span></a> buffer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="epc-contents-is-stream.returns"></a><h4>Returns</h4>
<p> Returns <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when stream routines have to be used.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.other_details"></a><h2>Types and Values</h2>
<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>
</div>
<div class="refsect1">
<a name="libepc-1.0-contents.see-also"></a><h2>See Also</h2>
<p><a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|