/usr/share/gtk-doc/html/libsoup-2.4/libsoup-2.4-Top-Level-Domain-utils.html is in libsoup2.4-doc 2.44.2-1ubuntu2.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Top Level Domain utils</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="libsoup-2.4-soup-status.html" title="soup-status">
<link rel="next" href="SoupURI.html" title="SoupURI">
<meta name="generator" content="GTK-Doc V1.19 (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="libsoup-2.4-soup-status.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.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">libsoup Reference Manual</th>
<td><a accesskey="n" href="SoupURI.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libsoup-2.4-Top-Level-Domain-utils.synopsis" class="shortcut">Top</a>
|
<a href="#libsoup-2.4-Top-Level-Domain-utils.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libsoup-2.4-Top-Level-Domain-utils"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libsoup-2.4-Top-Level-Domain-utils.top_of_page"></a>Top Level Domain utils</span></h2>
<p>Top Level Domain utils — Top-Level Domain Utilities</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libsoup-2.4-Top-Level-Domain-utils.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <libsoup/soup.h>
const <span class="returnvalue">char</span> * <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#soup-tld-get-base-domain" title="soup_tld_get_base_domain ()">soup_tld_get_base_domain</a> (<em class="parameter"><code>const <span class="type">char</span> *hostname</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#soup-tld-domain-is-public-suffix" title="soup_tld_domain_is_public_suffix ()">soup_tld_domain_is_public_suffix</a> (<em class="parameter"><code>const <span class="type">char</span> *domain</code></em>);
#define <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#SOUP-TLD-ERROR:CAPS" title="SOUP_TLD_ERROR">SOUP_TLD_ERROR</a>
enum <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#SoupTLDError" title="enum SoupTLDError">SoupTLDError</a>;
</pre>
</div>
<div class="refsect1">
<a name="libsoup-2.4-Top-Level-Domain-utils.description"></a><h2>Description</h2>
<p>
These functions can be used to parse hostnames to attempt to determine
what part of the name belongs to the domain owner, and what part is
simply a "public suffix" such as ".com".
</p>
</div>
<div class="refsect1">
<a name="libsoup-2.4-Top-Level-Domain-utils.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="soup-tld-get-base-domain"></a><h3>soup_tld_get_base_domain ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * soup_tld_get_base_domain (<em class="parameter"><code>const <span class="type">char</span> *hostname</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Finds the base domain for a given <em class="parameter"><code>hostname</code></em>. The base domain is
composed by the top level domain (such as .org, .com, .co.uk, etc)
plus the second level domain, for example for myhost.mydomain.com
it will return mydomain.com.
</p>
<p>
Note that <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> will be returned for private URLs (those not ending
with any well known TLD) because choosing a base domain for them
would be totally arbitrary.
</p>
<p>
This method only works for valid UTF-8 hostnames in their canonical
representation form, so you should use <a href="/usr/share/gtk-doc/html/glib/glib-Hostname-Utilities.html#g-hostname-to-unicode"><code class="function">g_hostname_to_unicode()</code></a> to
get the canonical representation if that is not the case.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>hostname</code></em> :</span></p></td>
<td>a UTF-8 hostname in its canonical representation form</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore
errors. See <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#SoupTLDError" title="enum SoupTLDError"><span class="type">SoupTLDError</span></a> for the available error codes</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to the start of the base domain in <em class="parameter"><code>hostname</code></em>. If
an error occurs, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> will be returned and <em class="parameter"><code>error</code></em> set.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.40</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-tld-domain-is-public-suffix"></a><h3>soup_tld_domain_is_public_suffix ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> soup_tld_domain_is_public_suffix (<em class="parameter"><code>const <span class="type">char</span> *domain</code></em>);</pre>
<p>
Looks whether the <em class="parameter"><code>domain</code></em> passed as argument is a public domain
suffix (.org, .com, .co.uk, etc) or not.
</p>
<p>
This method only works for valid UTF-8 domains in their canonical
representation form, so you should use <a href="/usr/share/gtk-doc/html/glib/glib-Hostname-Utilities.html#g-hostname-to-unicode"><code class="function">g_hostname_to_unicode()</code></a> to
get the canonical representation if that is not the case.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>a UTF-8 domain in its canonical representation form</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if it is a public domain, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.40</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-TLD-ERROR:CAPS"></a><h3>SOUP_TLD_ERROR</h3>
<pre class="programlisting">#define SOUP_TLD_ERROR soup_tld_error_quark()
</pre>
<p>
The <a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> domain for soup-tld-related errors.
</p>
<p class="since">Since 2.40</p>
</div>
<hr>
<div class="refsect2">
<a name="SoupTLDError"></a><h3>enum SoupTLDError</h3>
<pre class="programlisting">typedef enum {
SOUP_TLD_ERROR_INVALID_HOSTNAME,
SOUP_TLD_ERROR_IS_IP_ADDRESS,
SOUP_TLD_ERROR_NOT_ENOUGH_DOMAINS,
SOUP_TLD_ERROR_NO_BASE_DOMAIN
} SoupTLDError;
</pre>
<p>
Error codes for <a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#SOUP-TLD-ERROR:CAPS" title="SOUP_TLD_ERROR"><code class="literal">SOUP_TLD_ERROR</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="SOUP-TLD-ERROR-INVALID-HOSTNAME:CAPS"></a><span class="term"><code class="literal">SOUP_TLD_ERROR_INVALID_HOSTNAME</code></span></p></td>
<td>A hostname was syntactically
invalid.
</td>
</tr>
<tr>
<td><p><a name="SOUP-TLD-ERROR-IS-IP-ADDRESS:CAPS"></a><span class="term"><code class="literal">SOUP_TLD_ERROR_IS_IP_ADDRESS</code></span></p></td>
<td>The passed-in "hostname" was
actually an IP address (and thus has no base domain or
public suffix).
</td>
</tr>
<tr>
<td><p><a name="SOUP-TLD-ERROR-NOT-ENOUGH-DOMAINS:CAPS"></a><span class="term"><code class="literal">SOUP_TLD_ERROR_NOT_ENOUGH_DOMAINS</code></span></p></td>
<td>The passed-in hostname
did not have enough components. Eg, calling
<a class="link" href="libsoup-2.4-Top-Level-Domain-utils.html#soup-tld-get-base-domain" title="soup_tld_get_base_domain ()"><code class="function">soup_tld_get_base_domain()</code></a> on <code class="literal">"co.uk"</code>.
</td>
</tr>
<tr>
<td><p><a name="SOUP-TLD-ERROR-NO-BASE-DOMAIN:CAPS"></a><span class="term"><code class="literal">SOUP_TLD_ERROR_NO_BASE_DOMAIN</code></span></p></td>
<td>The passed-in hostname has
no recognized public suffix.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.40</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|