/usr/share/gtk-doc/html/libepc-1.0/libepc-1.0-consumer.html is in libepc-doc 0.4.4-3.
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 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EpcConsumer</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="consuming.html" title="Consuming">
<link rel="prev" href="consuming.html" title="Consuming">
<link rel="next" href="EpcProtocol.html" title="EpcProtocol">
<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="consuming.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="consuming.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="EpcProtocol.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-consumer.synopsis" class="shortcut">Top</a>
|
<a href="#libepc-1.0-consumer.description" class="shortcut">Description</a>
|
<a href="#libepc-1.0-consumer.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#libepc-1.0-consumer.properties" class="shortcut">Properties</a>
|
<a href="#libepc-1.0-consumer.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry">
<a name="libepc-1.0-consumer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libepc-1.0-consumer.top_of_page"></a>EpcConsumer</span></h2>
<p>EpcConsumer — lookup published values</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libepc-1.0-consumer.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="libepc-1.0-consumer.synopsis"></a><h2>Synopsis</h2>
<a name="EpcConsumer"></a><pre class="synopsis">
#include <libepc/consumer.h>
#define <a class="link" href="libepc-1.0-consumer.html#EPC-HTTP-ERROR:CAPS" title="EPC_HTTP_ERROR">EPC_HTTP_ERROR</a>
<a class="link" href="libepc-1.0-consumer.html#EpcConsumerPrivate" title="EpcConsumerPrivate">EpcConsumerPrivate</a>;
struct <a class="link" href="libepc-1.0-consumer.html#EpcConsumerClass" title="struct EpcConsumerClass">EpcConsumerClass</a>;
struct <a class="link" href="libepc-1.0-consumer.html#EpcConsumer-struct" title="struct EpcConsumer">EpcConsumer</a>;
<a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new" title="epc_consumer_new ()">epc_consumer_new</a> (<em class="parameter"><code>const <a class="link" href="EpcServiceInfo.html" title="EpcServiceInfo"><span class="type">EpcServiceInfo</span></a> *service</code></em>);
<a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name" title="epc_consumer_new_for_name ()">epc_consumer_new_for_name</a> (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);
<a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name-full" title="epc_consumer_new_for_name_full ()">epc_consumer_new_for_name_full</a> (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *application</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *domain</code></em>);
<a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="returnvalue">EpcProtocol</span></a> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-get-protocol" title="epc_consumer_get_protocol ()">epc_consumer_get_protocol</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-get-password" title="epc_consumer_get_password ()">epc_consumer_get_password</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-get-username" title="epc_consumer_get_username ()">epc_consumer_get_username</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-set-protocol" title="epc_consumer_set_protocol ()">epc_consumer_set_protocol</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code><a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="type">EpcProtocol</span></a> protocol</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-set-password" title="epc_consumer_set_password ()">epc_consumer_set_password</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-set-username" title="epc_consumer_set_username ()">epc_consumer_set_username</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-resolve-publisher" title="epc_consumer_resolve_publisher ()">epc_consumer_resolve_publisher</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code><span class="type">guint</span> timeout</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-is-publisher-resolved" title="epc_consumer_is_publisher_resolved ()">epc_consumer_is_publisher_resolved</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);
<span class="returnvalue">gpointer</span> <a class="link" href="libepc-1.0-consumer.html#epc-consumer-lookup" title="epc_consumer_lookup ()">epc_consumer_lookup</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *key</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
<span class="returnvalue">GList</span> * <a class="link" href="libepc-1.0-consumer.html#epc-consumer-list" title="epc_consumer_list ()">epc_consumer_list</a> (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *pattern</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
GObject
+----EpcConsumer
</pre>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--application" title='The "application" property'>application</a>" <span class="type">gchar</span>* : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--domain" title='The "domain" property'>domain</a>" <span class="type">gchar</span>* : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--hostname" title='The "hostname" property'>hostname</a>" <span class="type">gchar</span>* : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--name" title='The "name" property'>name</a>" <span class="type">gchar</span>* : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--password" title='The "password" property'>password</a>" <span class="type">gchar</span>* : Read / Write / Construct
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--path" title='The "path" property'>path</a>" <span class="type">gchar</span>* : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--port" title='The "port" property'>port</a>" <span class="type">gint</span> : Read / Write / Construct Only
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--protocol" title='The "protocol" property'>protocol</a>" <a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="type">EpcProtocol</span></a> : Read / Write / Construct
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer--username" title='The "username" property'>username</a>" <span class="type">gchar</span>* : Read / Write / Construct
</pre>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.signals"></a><h2>Signals</h2>
<pre class="synopsis">
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer-authenticate" title='The "authenticate" signal'>authenticate</a>" : <code class="literal">Run Last</code>
"<a class="link" href="libepc-1.0-consumer.html#EpcConsumer-publisher-resolved" title='The "publisher-resolved" signal'>publisher-resolved</a>" : <code class="literal">Run First</code>
</pre>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.description"></a><h2>Description</h2>
<p>
The <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object is used to lookup values published by an
<a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a> service. Currently HTTP is used for communication.
To find a publisher, use DNS-SD (also known as ZeroConf) to
list <span class="type">EPC_PUBLISHER_SERVICE_TYPE</span> services.
</p>
<p>
</p>
<div class="example">
<a name="lookup-value"></a><p class="title"><b>Example 1. Lookup a value</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</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">service_name </span><span class="symbol">=</span><span class="normal"> </span><span class="function">choose_recently_used_service</span><span class="normal"> </span><span class="symbol">();</span>
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service_name</span><span class="symbol">)</span>
<span class="normal"> consumer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libepc-1.0-consumer.html#epc-consumer-new-for-name">epc_consumer_new_for_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service_name</span><span class="symbol">);</span>
<span class="keyword">else</span>
<span class="normal"> consumer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libepc-1.0-consumer.html#epc-consumer-new">epc_consumer_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">your_app_find_service</span><span class="normal"> </span><span class="symbol">());</span>
<span class="normal">value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libepc-1.0-consumer.html#epc-consumer-lookup">epc_consumer_lookup</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">consumer</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"glom-settings"</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="symbol">&</span><span class="normal">error</span><span class="symbol">);</span>
<span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">consumer</span><span class="symbol">);</span>
<span class="function">your_app_consume_value</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="function">g_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><br class="example-break">
</p>
<p>
</p>
<div class="example">
<a name="find-publisher"></a><p class="title"><b>Example 2. Find a publisher</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
17
18
19
20
21
22
23
24
25
26
27
28
29</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">dialog </span><span class="symbol">=</span><span class="normal"> </span><span class="function">aui_service_dialog_new</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Choose a Service"</span><span class="symbol">,</span><span class="normal"> main_window</span><span class="symbol">,</span>
<span class="normal"> GTK_STOCK_CANCEL</span><span class="symbol">,</span><span class="normal"> GTK_RESPONSE_CANCEL</span><span class="symbol">,</span>
<span class="normal"> GTK_STOCK_CONNECT</span><span class="symbol">,</span><span class="normal"> GTK_RESPONSE_ACCEPT</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="function">aui_service_dialog_set_browse_service_types</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">),</span>
<span class="normal"> <a href="libepc-1.0-EpcServiceType.html#EPC-SERVICE-TYPE-HTTPS:CAPS">EPC_SERVICE_TYPE_HTTPS</a></span><span class="symbol">,</span>
<span class="normal"> <a href="libepc-1.0-EpcServiceType.html#EPC-SERVICE-TYPE-HTTP:CAPS">EPC_SERVICE_TYPE_HTTP</a></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="function">aui_service_dialog_set_service_type_name</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">),</span>
<span class="normal"> <a href="libepc-1.0-EpcServiceType.html#EPC-SERVICE-TYPE-HTTPS:CAPS">EPC_SERVICE_TYPE_HTTPS</a></span><span class="symbol">,</span>
<span class="normal"> </span><span class="string">"Secure Transport"</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function">aui_service_dialog_set_service_type_name</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">),</span>
<span class="normal"> <a href="libepc-1.0-EpcServiceType.html#EPC-SERVICE-TYPE-HTTP:CAPS">EPC_SERVICE_TYPE_HTTP</a></span><span class="symbol">,</span>
<span class="normal"> </span><span class="string">"Insecure Transport"</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GTK_RESPONSE_ACCEPT </span><span class="symbol">==</span><span class="normal"> </span><span class="function">gtk_dialog_run</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">)))</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">EpcServiceInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">service </span><span class="symbol">=</span>
<span class="normal"> </span><span class="function"><a href="EpcServiceInfo.html#epc-service-info-new">epc_service_info_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">aui_service_dialog_get_service_type</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">)),</span>
<span class="normal"> </span><span class="function">aui_service_dialog_get_host_name</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">)),</span>
<span class="normal"> </span><span class="function">aui_service_dialog_get_port</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">)),</span>
<span class="normal"> </span><span class="function">aui_service_dialog_get_txt_data</span><span class="normal"> </span><span class="symbol">(</span><span class="function">AUI_SERVICE_DIALOG</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">)));</span>
<span class="normal"> consumer </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libepc-1.0-consumer.html#epc-consumer-new">epc_consumer_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="EpcServiceInfo.html#epc-service-info-unref">epc_service_info_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>
<span class="normal"> </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-consumer.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="EPC-HTTP-ERROR:CAPS"></a><h3>EPC_HTTP_ERROR</h3>
<pre class="programlisting">#define EPC_HTTP_ERROR (epc_http_error_quark())
</pre>
<p>
Error domain for HTTP operations. Errors in this domain will
be from the <span class="type">SoupKnownStatusCode</span> enumeration. See GError for
information on error domains.
</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumerPrivate"></a><h3>EpcConsumerPrivate</h3>
<pre class="programlisting">typedef struct _EpcConsumerPrivate EpcConsumerPrivate;</pre>
<p>
Private fields of the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> class.
</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumerClass"></a><h3>struct EpcConsumerClass</h3>
<pre class="programlisting">struct EpcConsumerClass {
void (*authenticate) (EpcConsumer *consumer,
const gchar *realm);
void (*publisher_resolved) (EpcConsumer *consumer,
EpcProtocol protocol,
const gchar *hostname,
guint port);
};
</pre>
<p>
Virtual methods of the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> class.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="EpcConsumerClass.authenticate"></a>authenticate</code></em> ()</span></p></td>
<td>virtual method of the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer-authenticate" title='The "authenticate" signal'><span class="type">"authenticate"</span></a> signal</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="EpcConsumerClass.publisher-resolved"></a>publisher_resolved</code></em> ()</span></p></td>
<td>virtual method of the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer-publisher-resolved" title='The "publisher-resolved" signal'><span class="type">"publisher-resolved"</span></a> signal</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer-struct"></a><h3>struct EpcConsumer</h3>
<pre class="programlisting">struct EpcConsumer;</pre>
<p>
Public fields of the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> class.
</p>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-new"></a><h3>epc_consumer_new ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * epc_consumer_new (<em class="parameter"><code>const <a class="link" href="EpcServiceInfo.html" title="EpcServiceInfo"><span class="type">EpcServiceInfo</span></a> *service</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object and associates it with a known
<a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>. The <em class="parameter"><code>service</code></em> description can be retrieved, for instance,
by using <a class="link" href="libepc-1.0-service-monitor.html#EpcServiceMonitor"><span class="type">EpcServiceMonitor</span></a>, or by using the service selection dialog
of <em class="citetitle">avahi-ui</em> (<span class="type">AuiServiceDialog</span>).
</p>
<p>
The connection is not established until functions like <a class="link" href="libepc-1.0-consumer.html#epc-consumer-lookup" title="epc_consumer_lookup ()"><code class="function">epc_consumer_lookup()</code></a>,
<a class="link" href="libepc-1.0-consumer.html#epc-consumer-list" title="epc_consumer_list ()"><code class="function">epc_consumer_list()</code></a> or <a class="link" href="libepc-1.0-consumer.html#epc-consumer-resolve-publisher" title="epc_consumer_resolve_publisher ()"><span class="type">epc_consumer_resolve_publisher</span></a> are called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td>the publisher's service description</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-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-new-for-name"></a><h3>epc_consumer_new_for_name ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * epc_consumer_new_for_name (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object and associates it with the <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
announcing itself with <em class="parameter"><code>name</code></em> on the local network. The DNS-SD service name
used for searching the <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a> is derived from the application's
program name as returned by <code class="function">g_get_prgname()</code>.
</p>
<p>
See <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name-full" title="epc_consumer_new_for_name_full ()"><code class="function">epc_consumer_new_for_name_full()</code></a> for additional notes
and a method allowing better control over the search process.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>the service name of an <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
</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-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-new-for-name-full"></a><h3>epc_consumer_new_for_name_full ()</h3>
<pre class="programlisting"><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="returnvalue">EpcConsumer</span></a> * epc_consumer_new_for_name_full (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *application</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *domain</code></em>);</pre>
<p>
Creates a new <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object and associates it with the <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
announcing itself with <em class="parameter"><code>name</code></em> on <em class="parameter"><code>domain</code></em>. The DNS-SD service of the
<a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a> is derived from <em class="parameter"><code>application</code></em> using <a class="link" href="libepc-1.0-EpcServiceType.html#epc-service-type-new" title="epc_service_type_new ()"><code class="function">epc_service_type_new()</code></a>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
This function shall be used to re-connect to a formerly used <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>,
selected for instance from a list for recently used services. Therefore
using <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name-full" title="epc_consumer_new_for_name_full ()"><code class="function">epc_consumer_new_for_name_full()</code></a> is a quite optimistic approach for
contacting a publisher: You call it without really knowing if the
publisher you requested really exists. You only know that it existed
in the past when you added it to your list of recently used publishers,
but you do not know if it still exists.
</p>
<p>
To let your users choose from an up-to-date service list, you have to
use a dynamic service list as provided by avahi-ui for choosing a service
and pass the information this widget provides (hostname, port, protocol)
to <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new" title="epc_consumer_new ()"><code class="function">epc_consumer_new()</code></a>.
</p>
</div>
<p>
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
The connection is not established until a function retrieving
data, like for instance <a class="link" href="libepc-1.0-consumer.html#epc-consumer-lookup" title="epc_consumer_lookup ()"><code class="function">epc_consumer_lookup()</code></a>, is called.
</p>
<p>
Explicitly call <a class="link" href="libepc-1.0-consumer.html#epc-consumer-resolve-publisher" title="epc_consumer_resolve_publisher ()"><code class="function">epc_consumer_resolve_publisher()</code></a> or connect to
the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer-publisher-resolved" title='The "publisher-resolved" signal'><span class="type">"publisher-resolved"</span></a> signal, when your application
needs reliable information about the existance of the <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
described by <em class="parameter"><code>name</code></em>.
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>the service name of an <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>application</code></em> :</span></p></td>
<td>the publisher's program name</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the DNS domain of the <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
</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-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> object</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-get-protocol"></a><h3>epc_consumer_get_protocol ()</h3>
<pre class="programlisting"><a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="returnvalue">EpcProtocol</span></a> epc_consumer_get_protocol (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);</pre>
<p>
Queries the transport protocol to use for contacting the publisher.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--protocol" title='The "protocol" property'><span class="type">"protocol"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The transport protocol this consumer uses.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-get-password"></a><h3>epc_consumer_get_password ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * epc_consumer_get_password (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);</pre>
<p>
Queries the password used for authentication.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--password" title='The "password" property'><span class="type">"password"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The password this consumer uses.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-get-username"></a><h3>epc_consumer_get_username ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * epc_consumer_get_username (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);</pre>
<p>
Queries the user name used for authentication.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--username" title='The "username" property'><span class="type">"username"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The user name this consumer uses.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-set-protocol"></a><h3>epc_consumer_set_protocol ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> epc_consumer_set_protocol (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code><a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="type">EpcProtocol</span></a> protocol</code></em>);</pre>
<p>
Changes the transport protocol to use for contacting the publisher.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--protocol" title='The "protocol" property'><span class="type">"protocol"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>protocol</code></em> :</span></p></td>
<td>the new transport protocol</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-set-password"></a><h3>epc_consumer_set_password ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> epc_consumer_set_password (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>);</pre>
<p>
Changes the password used for authentication.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--password" title='The "password" property'><span class="type">"password"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
<td>the new password, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-set-username"></a><h3>epc_consumer_set_username ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> epc_consumer_set_username (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *username</code></em>);</pre>
<p>
Changes the user name used for authentication.
See <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--username" title='The "username" property'><span class="type">"username"</span></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>username</code></em> :</span></p></td>
<td>the new user name, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-resolve-publisher"></a><h3>epc_consumer_resolve_publisher ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> epc_consumer_resolve_publisher (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code><span class="type">guint</span> timeout</code></em>);</pre>
<p>
Waits until the <em class="parameter"><code>consumer</code></em> has found its <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>.
A <em class="parameter"><code>timeout</code></em> of 0 requests infinite waiting.
</p>
<p>
See also: <a class="link" href="libepc-1.0-consumer.html#EpcConsumer-publisher-resolved" title='The "publisher-resolved" signal'><span class="type">"publisher-resolved"</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>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>timeout</code></em> :</span></p></td>
<td>the amount of milliseconds to wait</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<code class="literal">TRUE</code> when a publisher has been found, <code class="literal">FALSE</code> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-is-publisher-resolved"></a><h3>epc_consumer_is_publisher_resolved ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> epc_consumer_is_publisher_resolved (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>);</pre>
<p>
Checks if the host name of this consumer's <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>
has been resolved already.
</p>
<p>
See also: <a class="link" href="libepc-1.0-consumer.html#epc-consumer-resolve-publisher" title="epc_consumer_resolve_publisher ()"><code class="function">epc_consumer_resolve_publisher()</code></a>, <span class="type">"publisher-resolved"</span>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<code class="literal">TRUE</code> when the host name has been resolved, and <code class="literal">FALSE</code> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-lookup"></a><h3>epc_consumer_lookup ()</h3>
<pre class="programlisting"><span class="returnvalue">gpointer</span> epc_consumer_lookup (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *key</code></em>,
<em class="parameter"><code><span class="type">gsize</span> *length</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
If the call was successful, this returns a newly allocated buffer containing
the value the publisher provides for <em class="parameter"><code>key</code></em>. If the call was not
successful it returns <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> and sets <em class="parameter"><code>error</code></em>. The error domain is
<a class="link" href="libepc-1.0-consumer.html#EPC-HTTP-ERROR:CAPS" title="EPC_HTTP_ERROR"><span class="type">EPC_HTTP_ERROR</span></a>. Error codes are taken from the <span class="type">SoupKnownStatusCode</span>
enumeration.
</p>
<p>
For instance, the error code will be <span class="type">SOUP_STATUS_FORBIDDEN</span> if
authentication failed (see <a class="link" href="libepc-1.0-publisher.html#epc-publisher-set-auth-handler" title="epc_publisher_set_auth_handler ()"><code class="function">epc_publisher_set_auth_handler()</code></a>). You must
include <code class="filename">libsoup/soup-status.h</code>
to use this error code.
</p>
<p>
The returned buffer should be freed when no longer needed.
</p>
<p>
See the description of <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a> for discussion of <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> values.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>the consumer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
<td>unique key of the value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>location to store length in bytes of 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>error</code></em> :</span></p></td>
<td>return location for a <span class="type">GError</span>, 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"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A copy of the publisher's value for the the requested <em class="parameter"><code>key</code></em>,
or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> when an error occurred.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="epc-consumer-list"></a><h3>epc_consumer_list ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> * epc_consumer_list (<em class="parameter"><code><a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *pattern</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>
Matches published keys against patterns containing '*' (wildcard) and '?'
(joker). Passing <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> as <em class="parameter"><code>pattern</code></em> is equivalent to passing "*" and returns
all published keys. This function is useful to find and select dynamically
published values. See <span class="type">GPatternSpec</span> for information about glob-style
patterns.
</p>
<p>
If the call was successful, a list of keys matching <em class="parameter"><code>pattern</code></em> is returned.
If the call was not successful, it returns <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> and sets <em class="parameter"><code>error</code></em>.
The error domain is <a class="link" href="libepc-1.0-consumer.html#EPC-HTTP-ERROR:CAPS" title="EPC_HTTP_ERROR"><span class="type">EPC_HTTP_ERROR</span></a>. Error codes are taken from the
<span class="type">SoupKnownStatusCode</span> enumeration.
</p>
<p>
The returned list should be freed when no longer needed:
</p>
<p>
</p>
<pre class="programlisting">
g_list_foreach (keys, (GFunc) g_free, NULL);
g_list_free (keys);
</pre>
<p>
</p>
<p>
See also <a class="link" href="libepc-1.0-publisher.html#epc-publisher-list" title="epc_publisher_list ()"><code class="function">epc_publisher_list()</code></a> for creating custom listings.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>a glob-style pattern, 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>error</code></em> :</span></p></td>
<td>return location for a <span class="type">GError</span>, 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"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated list of keys, or <a href="/opt/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a> when an error occurred.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="EpcConsumer--application"></a><h3>The <code class="literal">"application"</code> property</h3>
<pre class="programlisting"> "application" <span class="type">gchar</span>* : Read / Write / Construct Only</pre>
<p>Program name the publisher to use.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--domain"></a><h3>The <code class="literal">"domain"</code> property</h3>
<pre class="programlisting"> "domain" <span class="type">gchar</span>* : Read / Write / Construct Only</pre>
<p>DNS domain of the publisher to use.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--hostname"></a><h3>The <code class="literal">"hostname"</code> property</h3>
<pre class="programlisting"> "hostname" <span class="type">gchar</span>* : Read / Write / Construct Only</pre>
<p>Host name of the publisher to use.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--name"></a><h3>The <code class="literal">"name"</code> property</h3>
<pre class="programlisting"> "name" <span class="type">gchar</span>* : Read / Write / Construct Only</pre>
<p>Service name of the publisher to use.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--password"></a><h3>The <code class="literal">"password"</code> property</h3>
<pre class="programlisting"> "password" <span class="type">gchar</span>* : Read / Write / Construct</pre>
<p>The password to use for authentication.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--path"></a><h3>The <code class="literal">"path"</code> property</h3>
<pre class="programlisting"> "path" <span class="type">gchar</span>* : Read / Write / Construct Only</pre>
<p>The path the publisher uses for contents.</p>
<p>Default value: "/contents"</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--port"></a><h3>The <code class="literal">"port"</code> property</h3>
<pre class="programlisting"> "port" <span class="type">gint</span> : Read / Write / Construct Only</pre>
<p>TCP/IP port of the publisher to use.</p>
<p>Allowed values: [0,65535]</p>
<p>Default value: 0</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--protocol"></a><h3>The <code class="literal">"protocol"</code> property</h3>
<pre class="programlisting"> "protocol" <a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="type">EpcProtocol</span></a> : Read / Write / Construct</pre>
<p>The transport protocol to use for contacting the publisher.</p>
<p>Default value: EPC_PROTOCOL_UNKNOWN</p>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer--username"></a><h3>The <code class="literal">"username"</code> property</h3>
<pre class="programlisting"> "username" <span class="type">gchar</span>* : Read / Write / Construct</pre>
<p>The user name to use for authentication.</p>
<p>Default value: NULL</p>
</div>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="EpcConsumer-authenticate"></a><h3>The <code class="literal">"authenticate"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> user_function (<a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer,
<span class="type">gchar</span> *realm,
<span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
<p>
Emitted when the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> requires authentication. The signal
handler should provide these credentials, which may come from the
user or from cached information by setting the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--username" title='The "username" property'><span class="type">"username"</span></a>
and <a class="link" href="libepc-1.0-consumer.html#EpcConsumer--password" title='The "password" property'><span class="type">"password"</span></a> properties. When providing credentials
the signal handler should return <code class="literal">TRUE</code> to stop signal emission.
</p>
<p>
If the provided credentials fail then the signal will be emmitted again.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> emitting the signal</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>realm</code></em> :</span></p></td>
<td>the realm being authenticated to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<code class="literal">TRUE</code> when the signal handler handled the authentication request,
and <code class="literal">FALSE</code> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="EpcConsumer-publisher-resolved"></a><h3>The <code class="literal">"publisher-resolved"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> *consumer,
<a class="link" href="EpcProtocol.html" title="EpcProtocol"><span class="type">EpcProtocol</span></a> protocol,
<span class="type">gchar</span> *hostname,
<span class="type">guint</span> port,
<span class="type">gpointer</span> user_data) : <code class="literal">Run First</code></pre>
<p>
This signal is emitted when a <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> created with
<a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name" title="epc_consumer_new_for_name ()"><code class="function">epc_consumer_new_for_name()</code></a> or <a class="link" href="libepc-1.0-consumer.html#epc-consumer-new-for-name-full" title="epc_consumer_new_for_name_full ()"><span class="type">epc_consumer_new_for_name_full</span></a>
has found its <a class="link" href="libepc-1.0-publisher.html#EpcPublisher"><span class="type">EpcPublisher</span></a>.
</p>
<p>
Publisher detection is integrated with the GLib main loop. Therefore the
signal will not be emitted before a main loop is run (<code class="function">g_main_loop_run()</code>,
<code class="function">gtk_main()</code>). So to reliably consume this signal connect to it directly
after creating the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a>.
</p>
<p>
See also: <a class="link" href="libepc-1.0-consumer.html#epc-consumer-resolve-publisher" title="epc_consumer_resolve_publisher ()"><code class="function">epc_consumer_resolve_publisher()</code></a>, <span class="type">epc_consumer_is_pulisher_resolved</span>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>consumer</code></em> :</span></p></td>
<td>the <a class="link" href="libepc-1.0-consumer.html#EpcConsumer"><span class="type">EpcConsumer</span></a> emitting the signal</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>protocol</code></em> :</span></p></td>
<td>the publisher's transport protocol</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hostname</code></em> :</span></p></td>
<td>the publisher's host name</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
<td>the publisher's TCP/IP port</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libepc-1.0-consumer.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>
|