/usr/share/gtk-doc/html/gnet/gnet-uri.html is in libgnet-dev 2.0.8-2.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 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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>URI</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GNet Network Library Reference Manual">
<link rel="up" href="libgnet-reference.html" title="GNet Library Reference">
<link rel="prev" href="gnet-iochannel.html" title="IOChannel">
<link rel="next" href="gnet-base64.html" title="Base64">
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="gnet-overview.html" title="GNet Overview">
<link rel="chapter" href="gnet-developers.html" title="GNet for developers">
<link rel="chapter" href="gnet-examples.html" title="GNet Examples">
<link rel="chapter" href="libgnet-reference.html" title="GNet Library Reference">
</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="gnet-iochannel.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgnet-reference.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">GNet Network Library Reference Manual</th>
<td><a accesskey="n" href="gnet-base64.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id381230" class="shortcut">Top</a>
 | 
<a href="#id382130" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gnet-uri"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id381230"></a><span class="refentrytitle">URI</span>
</h2>
<p>URI — Uniform Resource Identifier (URI)</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gnet.h>
<a href="gnet-uri.html#GURI:CAPS">GURI</a>;
<a href="gnet-uri.html#GURI:CAPS">GURI</a>* <a href="gnet-uri.html#gnet-uri-new">gnet_uri_new</a> (const gchar *uri);
<a href="gnet-uri.html#GURI:CAPS">GURI</a>* <a href="gnet-uri.html#gnet-uri-new-fields">gnet_uri_new_fields</a> (const gchar *scheme,
const gchar *hostname,
const gint port,
const gchar *path);
<a href="gnet-uri.html#GURI:CAPS">GURI</a>* <a href="gnet-uri.html#gnet-uri-new-fields-all">gnet_uri_new_fields_all</a> (const gchar *scheme,
const gchar *userinfo,
const gchar *hostname,
const gint port,
const gchar *path,
const gchar *query,
const gchar *fragment);
<a href="gnet-uri.html#GURI:CAPS">GURI</a>* <a href="gnet-uri.html#gnet-uri-clone">gnet_uri_clone</a> (const <a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);
void <a href="gnet-uri.html#gnet-uri-delete">gnet_uri_delete</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);
void <a href="gnet-uri.html#gnet-uri-escape">gnet_uri_escape</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);
void <a href="gnet-uri.html#gnet-uri-unescape">gnet_uri_unescape</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);
gchar* <a href="gnet-uri.html#gnet-uri-get-string">gnet_uri_get_string</a> (const <a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);
void <a href="gnet-uri.html#gnet-uri-set-scheme">gnet_uri_set_scheme</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *scheme);
void <a href="gnet-uri.html#gnet-uri-set-userinfo">gnet_uri_set_userinfo</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *userinfo);
void <a href="gnet-uri.html#gnet-uri-set-hostname">gnet_uri_set_hostname</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *hostname);
void <a href="gnet-uri.html#gnet-uri-set-port">gnet_uri_set_port</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
gint port);
void <a href="gnet-uri.html#gnet-uri-set-path">gnet_uri_set_path</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *path);
void <a href="gnet-uri.html#gnet-uri-set-query">gnet_uri_set_query</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *query);
void <a href="gnet-uri.html#gnet-uri-set-fragment">gnet_uri_set_fragment</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *fragment);
guint <a href="gnet-uri.html#gnet-uri-hash">gnet_uri_hash</a> (gconstpointer p);
gboolean <a href="gnet-uri.html#gnet-uri-equal">gnet_uri_equal</a> (gconstpointer p1,
gconstpointer p2);
gboolean <a href="gnet-uri.html#gnet-uri-parse-inplace">gnet_uri_parse_inplace</a> (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *guri,
gchar *uri,
gchar *hostname,
gsize len);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id382130"></a><h2>Description</h2>
<p>
A URI is a Uniform Resource Identifier, similar to a URL. This module
provides functions for creating and manipulating URIs. A URI is
represented by <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>. All fields in the <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> structure are publicly
readable.
</p>
<p>
Create a URI from a string by calling <a href="gnet-uri.html#gnet-uri-new"><code class="function">gnet_uri_new()</code></a>. To get the
string representation back, call <a href="gnet-uri.html#gnet-uri-get-string"><code class="function">gnet_uri_get_string()</code></a>. To escape a
URI call <a href="gnet-uri.html#gnet-uri-escape"><code class="function">gnet_uri_escape()</code></a>, and to unescape it call
<a href="gnet-uri.html#gnet-uri-unescape"><code class="function">gnet_uri_unescape()</code></a>. Network protocols use escaped URIs. People use
unescaped URIs.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id382208"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id382218"></a><h3>
<a name="GURI:CAPS"></a>GURI</h3>
<a class="indexterm" name="id382230"></a><pre class="programlisting">typedef struct {
gchar* scheme;
gchar* userinfo;
gchar* hostname;
gint port;
gchar* path;
gchar* query;
gchar* fragment;
} GURI;
</pre>
<p>
The <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> structure represents a URI. All fields in this
structure are publicly readable.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>scheme</code></em>;</span></td>
<td> Scheme (or protocol)
</td>
</tr>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>userinfo</code></em>;</span></td>
<td> User info
</td>
</tr>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>hostname</code></em>;</span></td>
<td> Host name
</td>
</tr>
<tr>
<td><span class="term">gint <em class="structfield"><code>port</code></em>;</span></td>
<td> Port number
</td>
</tr>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>path</code></em>;</span></td>
<td> Path
</td>
</tr>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>query</code></em>;</span></td>
<td> Query
</td>
</tr>
<tr>
<td><span class="term">gchar *<em class="structfield"><code>fragment</code></em>;</span></td>
<td> Fragment
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id382404"></a><h3>
<a name="gnet-uri-new"></a>gnet_uri_new ()</h3>
<a class="indexterm" name="id382416"></a><pre class="programlisting"><a href="gnet-uri.html#GURI:CAPS">GURI</a>* gnet_uri_new (const gchar *uri);</pre>
<p>
Creates a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> from a string. Empty fields are set to NULL. The
parser does not validate the URI -- it will accept some malformed
URI. URIs are usually in the form
scheme://userinfo<em class="parameter"><code>hostname</code></em>:port/path?query<span class="type">fragment</span>
</p>
<p>
URIs created from user input are typically unescaped. URIs
created from machine input (e.g. received over the internet) are
typically escaped.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> URI string
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>, or NULL if there was a failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id382512"></a><h3>
<a name="gnet-uri-new-fields"></a>gnet_uri_new_fields ()</h3>
<a class="indexterm" name="id382524"></a><pre class="programlisting"><a href="gnet-uri.html#GURI:CAPS">GURI</a>* gnet_uri_new_fields (const gchar *scheme,
const gchar *hostname,
const gint port,
const gchar *path);</pre>
<p>
Creates a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> from the fields. This function uses the most
common fields. Use <a href="gnet-uri.html#gnet-uri-new-fields-all"><code class="function">gnet_uri_new_fields_all()</code></a> to specify all
fields.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>scheme</code></em> :</span></td>
<td> scheme
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> path
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id382674"></a><h3>
<a name="gnet-uri-new-fields-all"></a>gnet_uri_new_fields_all ()</h3>
<a class="indexterm" name="id382686"></a><pre class="programlisting"><a href="gnet-uri.html#GURI:CAPS">GURI</a>* gnet_uri_new_fields_all (const gchar *scheme,
const gchar *userinfo,
const gchar *hostname,
const gint port,
const gchar *path,
const gchar *query,
const gchar *fragment);</pre>
<p>
Creates a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> from all fields.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>scheme</code></em> :</span></td>
<td> scheme
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>userinfo</code></em> :</span></td>
<td> user info
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> path
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> query
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fragment</code></em> :</span></td>
<td> fragment
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id382888"></a><h3>
<a name="gnet-uri-clone"></a>gnet_uri_clone ()</h3>
<a class="indexterm" name="id382900"></a><pre class="programlisting"><a href="gnet-uri.html#GURI:CAPS">GURI</a>* gnet_uri_clone (const <a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);</pre>
<p>
Copies a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a copy of <em class="parameter"><code>uri</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id382980"></a><h3>
<a name="gnet-uri-delete"></a>gnet_uri_delete ()</h3>
<a class="indexterm" name="id382993"></a><pre class="programlisting">void gnet_uri_delete (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);</pre>
<p>
Deletes a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383057"></a><h3>
<a name="gnet-uri-escape"></a>gnet_uri_escape ()</h3>
<a class="indexterm" name="id383070"></a><pre class="programlisting">void gnet_uri_escape (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);</pre>
<p>
Escapes the fields in a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>. Network protocols use escaped
URIs. People use unescaped URIs.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383134"></a><h3>
<a name="gnet-uri-unescape"></a>gnet_uri_unescape ()</h3>
<a class="indexterm" name="id383147"></a><pre class="programlisting">void gnet_uri_unescape (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);</pre>
<p>
Unescapes the fields in the URI. Network protocols use escaped
URIs. People use unescaped URIs.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383204"></a><h3>
<a name="gnet-uri-get-string"></a>gnet_uri_get_string ()</h3>
<a class="indexterm" name="id383216"></a><pre class="programlisting">gchar* gnet_uri_get_string (const <a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri);</pre>
<p>
Gets a string representation of a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>. This function does not
escape or unescape the fields first. Call <a href="gnet-uri.html#gnet-uri-escape"><code class="function">gnet_uri_escape()</code></a> or
gnet_uri_unescape first if necessary.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a string.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383302"></a><h3>
<a name="gnet-uri-set-scheme"></a>gnet_uri_set_scheme ()</h3>
<a class="indexterm" name="id383315"></a><pre class="programlisting">void gnet_uri_set_scheme (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *scheme);</pre>
<p>
Sets a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s scheme.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>scheme</code></em> :</span></td>
<td> scheme
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383400"></a><h3>
<a name="gnet-uri-set-userinfo"></a>gnet_uri_set_userinfo ()</h3>
<a class="indexterm" name="id383412"></a><pre class="programlisting">void gnet_uri_set_userinfo (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *userinfo);</pre>
<p>
Sets a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s user info.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>userinfo</code></em> :</span></td>
<td> user info
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383498"></a><h3>
<a name="gnet-uri-set-hostname"></a>gnet_uri_set_hostname ()</h3>
<a class="indexterm" name="id383510"></a><pre class="programlisting">void gnet_uri_set_hostname (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *hostname);</pre>
<p>
Sets a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s host name.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> host name
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383596"></a><h3>
<a name="gnet-uri-set-port"></a>gnet_uri_set_port ()</h3>
<a class="indexterm" name="id383608"></a><pre class="programlisting">void gnet_uri_set_port (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
gint port);</pre>
<p>
Set a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s port.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>port</code></em> :</span></td>
<td> port
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383693"></a><h3>
<a name="gnet-uri-set-path"></a>gnet_uri_set_path ()</h3>
<a class="indexterm" name="id383705"></a><pre class="programlisting">void gnet_uri_set_path (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *path);</pre>
<p>
Set a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s path.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>path</code></em> :</span></td>
<td> path
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383791"></a><h3>
<a name="gnet-uri-set-query"></a>gnet_uri_set_query ()</h3>
<a class="indexterm" name="id383803"></a><pre class="programlisting">void gnet_uri_set_query (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *query);</pre>
<p>
Set a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> query
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383889"></a><h3>
<a name="gnet-uri-set-fragment"></a>gnet_uri_set_fragment ()</h3>
<a class="indexterm" name="id383901"></a><pre class="programlisting">void gnet_uri_set_fragment (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *uri,
const gchar *fragment);</pre>
<p>
Set a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s fragment.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fragment</code></em> :</span></td>
<td> fragment
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id383986"></a><h3>
<a name="gnet-uri-hash"></a>gnet_uri_hash ()</h3>
<a class="indexterm" name="id383999"></a><pre class="programlisting">guint gnet_uri_hash (gconstpointer p);</pre>
<p>
Creates a hash code for <em class="parameter"><code>p</code></em> for use with GHashTable.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>p</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> hash code for <em class="parameter"><code>p</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id384077"></a><h3>
<a name="gnet-uri-equal"></a>gnet_uri_equal ()</h3>
<a class="indexterm" name="id384089"></a><pre class="programlisting">gboolean gnet_uri_equal (gconstpointer p1,
gconstpointer p2);</pre>
<p>
Compares two <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>'s for equality.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>p1</code></em> :</span></td>
<td> a <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>p2</code></em> :</span></td>
<td> another <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if they are equal; FALSE otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id384192"></a><h3>
<a name="gnet-uri-parse-inplace"></a>gnet_uri_parse_inplace ()</h3>
<a class="indexterm" name="id384207"></a><pre class="programlisting">gboolean gnet_uri_parse_inplace (<a href="gnet-uri.html#GURI:CAPS">GURI</a> *guri,
gchar *uri,
gchar *hostname,
gsize len);</pre>
<p>
This function parses an URI string very efficiently and without allocating
any memory on the heap. It does this by modifying the passed-in string
<em class="parameter"><code>uri</code></em> and changing field separators into string terminators in place. The
result will then be put into the already-allocated and usually
uninitialised, GURI structure <em class="parameter"><code>guri</code></em>.
</p>
<p>
Because the slash (') which separates the hostname from the path in an URI
is needed as the first character of the path, it cannot be turned into a
string terminator for the hostname. This makes it necessary for the caller
(ie. you) to pass in an array where the hostname can be put.
</p>
<p>
If the URI has been parsed successfully, the fields of the GURI structure
will either point into the given string <em class="parameter"><code>uri</code></em> (or to <em class="parameter"><code>hostname</code></em> in case of
the hostname field), or be NULL. No freeing or de-initialising of the
GURI structure is required.
</p>
<p>
The only gnet_uri_*() functions you are allowed to call with this URI
structure are <a href="gnet-uri.html#gnet-uri-clone"><code class="function">gnet_uri_clone()</code></a>, <a href="gnet-uri.html#gnet-uri-equal"><code class="function">gnet_uri_equal()</code></a>, <a href="gnet-uri.html#gnet-uri-hash"><code class="function">gnet_uri_hash()</code></a>,
<a href="gnet-uri.html#gnet-uri-get-string"><code class="function">gnet_uri_get_string()</code></a> and <a href="gnet-uri.html#gnet-uri-unescape"><code class="function">gnet_uri_unescape()</code></a> (the latter unescapes the
string fragments in place, so is safe to use here).
</p>
<p>
You must not call any other gnet_uri_*() functions with this GURI,
especially not any <code class="function">gnet_uri_set()</code> functions.
</p>
<p>
Under normal circumstances, you should never need to use this function.
Use <a href="gnet-uri.html#gnet-uri-new"><code class="function">gnet_uri_new()</code></a> instead.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>guri</code></em> :</span></td>
<td> pointer to an uninitialised <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> structure (usually on the stack)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> a writable URI string (which will be modified by this function!)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>hostname</code></em> :</span></td>
<td> a preallocated array of size <em class="parameter"><code>len</code></em>, into which the hostname will
be copied if the URI has a hostname. This array should live
as long as <em class="parameter"><code>guri</code></em> may be used, since <em class="parameter"><code>guri</code></em> might reference it.
You may pass NULL here if you know your URIs won't contain a
hostname field
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>len</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> TRUE if <em class="parameter"><code>uri</code></em> was parsed successfully and <a href="gnet-uri.html#GURI:CAPS"><span class="type">GURI</span></a> is usable,
or FALSE if there was a failure.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.0.8
</p>
</div>
</div>
</div>
</body>
</html>
|