This file is indexed.

/usr/share/gtk-doc/html/libtranslate/libtranslate-translate-util.html is in libtranslate-dev 0.99-0ubuntu9.

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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>translate-util</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="libtranslate Reference Manual"><link rel="up" href="api-reference.html" title="API Reference"><link rel="prev" href="TranslateSession.html" title="TranslateSession"><link rel="next" href="rfc3066-builtin.html" title="Appendix A. Built-in RFC 3066 Tag to Name Mappings"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><style type="text/css">
        .synopsis, .classsynopsis {
            background: #eeeeee;
            border: solid 1px #aaaaaa;
            padding: 0.5em;
        }
        .programlisting {
            background: #eeeeff;
            border: solid 1px #aaaaff;
            padding: 0.5em;
        }
        .variablelist {
            padding: 4px;
            margin-left: 3em;
        }
        .navigation {
            background: #ffeeee;
            border: solid 1px #ffaaaa;
            margin-top: 0.5em;
            margin-bottom: 0.5em;
        }
        .navigation a {
            color: #770000;
        }
        .navigation a:visited {
            color: #550000;
        }
        .navigation .title {
            font-size: 200%;
        }
      </style></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="TranslateSession.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="api-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">libtranslate Reference Manual</th><td><a accesskey="n" href="rfc3066-builtin.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libtranslate-translate-util"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">translate-util</span></h2><p>translate-util &#8212; miscellaneous utility functions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">



gboolean    <a href="libtranslate-translate-util.html#translate-ascii-strcase-equal">translate_ascii_strcase_equal</a>   (gconstpointer s1,
                                             gconstpointer s2);
unsigned int <a href="libtranslate-translate-util.html#translate-ascii-strcase-hash">translate_ascii_strcase_hash</a>   (gconstpointer key);
char*       <a href="libtranslate-translate-util.html#translate-ascii-strcasestr">translate_ascii_strcasestr</a>      (const char *big,
                                             const char *little);
char*       <a href="libtranslate-translate-util.html#translate-ascii-strcasestr-len">translate_ascii_strcasestr_len</a>  (const char *big,
                                             unsigned int big_len,
                                             const char *little);
int         <a href="libtranslate-translate-util.html#translate-ascii-strcasecoll">translate_ascii_strcasecoll</a>     (const char *s1,
                                             const char *s2);
int         <a href="libtranslate-translate-util.html#translate-utf8-strcasecoll">translate_utf8_strcasecoll</a>      (const char *s1,
                                             const char *s2);
int         <a href="libtranslate-translate-util.html#translate-utf8-strcmp">translate_utf8_strcmp</a>           (const char *s1,
                                             const char *s2);
int         <a href="libtranslate-translate-util.html#translate-utf8-strcasecmp">translate_utf8_strcasecmp</a>       (const char *s1,
                                             const char *s2);
char*       <a href="libtranslate-translate-util.html#translate-utf8-strpbrk">translate_utf8_strpbrk</a>          (const char *p,
                                             gssize len,
                                             const char *charset);
char*       <a href="libtranslate-translate-util.html#translate-utf8-strrpbrk">translate_utf8_strrpbrk</a>         (const char *p,
                                             gssize len,
                                             const char *charset);
time_t      <a href="libtranslate-translate-util.html#translate-time">translate_time</a>                  (void);
char*       <a href="libtranslate-translate-util.html#translate-sgml-ref-expand">translate_sgml_ref_expand</a>       (const char *str);
</pre></div><div class="refsect1" lang="en"><a name="id2613136"></a><h2>Description</h2><p>
The following functions may come in handy to manipulate ASCII or UTF-8
strings, get the current time, or expand SGML character references and
XHTML character entities.
</p></div><div class="refsect1" lang="en"><a name="id2613145"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2613150"></a><h3><a name="translate-ascii-strcase-equal"></a>translate_ascii_strcase_equal ()</h3><a class="indexterm" name="id2613160"></a><pre class="programlisting">gboolean    translate_ascii_strcase_equal   (gconstpointer s1,
                                             gconstpointer s2);</pre><p>
Compares two strings, ignoring the case of ASCII characters of both
strings, and returns <tt class="literal">TRUE</tt> if they are equal. It can be passed to
<tt class="function">g_hash_table_new()</tt> as the <i class="parameter"><tt>key_equal_func</tt></i> parameter, when using
strings as case-insensitive keys in a <span class="type">GHashTable</span>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">TRUE</tt> if the two strings match.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613267"></a><h3><a name="translate-ascii-strcase-hash"></a>translate_ascii_strcase_hash ()</h3><a class="indexterm" name="id2613275"></a><pre class="programlisting">unsigned int translate_ascii_strcase_hash   (gconstpointer key);</pre><p>
Converts a string to a hash value, ignoring the case of ASCII
characters of the string. It can be passed to <tt class="function">g_hash_table_new()</tt> as
the <i class="parameter"><tt>hash_func</tt></i> parameter, when using strings as case-insensitive
keys in a <span class="type">GHashTable</span>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>key</tt></i> :</span></td><td> a string key.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a hash value corresponding to the key.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613421"></a><h3><a name="translate-ascii-strcasestr"></a>translate_ascii_strcasestr ()</h3><a class="indexterm" name="id2613430"></a><pre class="programlisting">char*       translate_ascii_strcasestr      (const char *big,
                                             const char *little);</pre><p>
Locates the first occurrence of <i class="parameter"><tt>little</tt></i> in <i class="parameter"><tt>big</tt></i>, ignoring the case
of ASCII characters of both strings.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>big</tt></i> :</span></td><td> a nul-terminated string, which may not be encoded in UTF-8.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>little</tt></i> :</span></td><td> the nul-terminated string to search for, which may not be
encoded in UTF-8.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> if <i class="parameter"><tt>little</tt></i> is an empty string, <i class="parameter"><tt>big</tt></i> is returned; if
<i class="parameter"><tt>little</tt></i> occurs nowhere in <i class="parameter"><tt>big</tt></i>, <tt class="literal">NULL</tt> is returned; otherwise a
pointer to the first character of the first occurrence of <i class="parameter"><tt>little</tt></i>
in <i class="parameter"><tt>big</tt></i> is returned.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613555"></a><h3><a name="translate-ascii-strcasestr-len"></a>translate_ascii_strcasestr_len ()</h3><a class="indexterm" name="id2613564"></a><pre class="programlisting">char*       translate_ascii_strcasestr_len  (const char *big,
                                             unsigned int big_len,
                                             const char *little);</pre><p>
Locates the first occurrence of <i class="parameter"><tt>little</tt></i> in <i class="parameter"><tt>big</tt></i>, ignoring the case
of ASCII characters of both strings, and limiting the length of the
search to <i class="parameter"><tt>big_len</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>big</tt></i> :</span></td><td> a nul-terminated string, which may not be encoded in UTF-8.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>big_len</tt></i> :</span></td><td> length of <i class="parameter"><tt>big</tt></i> in bytes, or -1 if <i class="parameter"><tt>big</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>little</tt></i> :</span></td><td> the nul-terminated string to search for, which may not be
encoded in UTF-8.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> if <i class="parameter"><tt>little</tt></i> is an empty string, <i class="parameter"><tt>big</tt></i> is returned; if
<i class="parameter"><tt>little</tt></i> occurs nowhere in <i class="parameter"><tt>big</tt></i>, <tt class="literal">NULL</tt> is returned; otherwise a
pointer to the first character of the first occurrence of <i class="parameter"><tt>little</tt></i>
in <i class="parameter"><tt>big</tt></i> is returned.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613723"></a><h3><a name="translate-ascii-strcasecoll"></a>translate_ascii_strcasecoll ()</h3><a class="indexterm" name="id2613732"></a><pre class="programlisting">int         translate_ascii_strcasecoll     (const char *s1,
                                             const char *s2);</pre><p>
Compares two strings for ordering using the linguistically correct
rules for the current locale, ignoring the case of ASCII characters
of both strings.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a nul-terminated string, which may not be encoded in UTF-8.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a nul-terminated string, which may not be encoded in UTF-8.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer greater than, equal to, or less than 0,
according as <i class="parameter"><tt>s1</tt></i> is greater than, equal to, or less than <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613888"></a><h3><a name="translate-utf8-strcasecoll"></a>translate_utf8_strcasecoll ()</h3><a class="indexterm" name="id2613896"></a><pre class="programlisting">int         translate_utf8_strcasecoll      (const char *s1,
                                             const char *s2);</pre><p>
Compares two UTF-8 strings for ordering using the linguistically
correct rules for the current locale, ignoring the case of both
strings.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer greater than, equal to, or less than 0,
according as <i class="parameter"><tt>s1</tt></i> is greater than, equal to, or less than <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2613981"></a><h3><a name="translate-utf8-strcmp"></a>translate_utf8_strcmp ()</h3><a class="indexterm" name="id2613990"></a><pre class="programlisting">int         translate_utf8_strcmp           (const char *s1,
                                             const char *s2);</pre><p>
Compares two UTF-8 strings for ordering.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer greater than, equal to, or less than 0,
according as <i class="parameter"><tt>s1</tt></i> is greater than, equal to, or less than <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2614145"></a><h3><a name="translate-utf8-strcasecmp"></a>translate_utf8_strcasecmp ()</h3><a class="indexterm" name="id2614153"></a><pre class="programlisting">int         translate_utf8_strcasecmp       (const char *s1,
                                             const char *s2);</pre><p>
Compares two UTF-8 strings for ordering, ignoring the case of both
strings.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>s1</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>s2</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer greater than, equal to, or less than 0,
according as <i class="parameter"><tt>s1</tt></i> is greater than, equal to, or less than <i class="parameter"><tt>s2</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2614238"></a><h3><a name="translate-utf8-strpbrk"></a>translate_utf8_strpbrk ()</h3><a class="indexterm" name="id2614247"></a><pre class="programlisting">char*       translate_utf8_strpbrk          (const char *p,
                                             gssize len,
                                             const char *charset);</pre><p>
Locates in <i class="parameter"><tt>p</tt></i> the first occurrence of any character in the string
<i class="parameter"><tt>charset</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>p</tt></i> in bytes, or -1 if <i class="parameter"><tt>p</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>charset</tt></i> :</span></td><td> the set of characters to search for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the first occurrence of any character of <i class="parameter"><tt>charset</tt></i> in
<i class="parameter"><tt>p</tt></i>, or <tt class="literal">NULL</tt> if no characters from <i class="parameter"><tt>charset</tt></i> occur anywhere in <i class="parameter"><tt>p</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2614391"></a><h3><a name="translate-utf8-strrpbrk"></a>translate_utf8_strrpbrk ()</h3><a class="indexterm" name="id2614400"></a><pre class="programlisting">char*       translate_utf8_strrpbrk         (const char *p,
                                             gssize len,
                                             const char *charset);</pre><p>
Locates in <i class="parameter"><tt>p</tt></i> the last occurrence of any character in the string
<i class="parameter"><tt>charset</tt></i>.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>p</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> length of <i class="parameter"><tt>p</tt></i> in bytes, or -1 if <i class="parameter"><tt>p</tt></i> is nul-terminated.
</td></tr><tr><td><span class="term"><i class="parameter"><tt>charset</tt></i> :</span></td><td> the set of characters to search for.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the last occurrence of any character of <i class="parameter"><tt>charset</tt></i> in
<i class="parameter"><tt>p</tt></i>, or <tt class="literal">NULL</tt> if no characters from <i class="parameter"><tt>charset</tt></i> occur anywhere in <i class="parameter"><tt>p</tt></i>.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2614544"></a><h3><a name="translate-time"></a>translate_time ()</h3><a class="indexterm" name="id2614552"></a><pre class="programlisting">time_t      translate_time                  (void);</pre><p>
Returns the current time, issuing a warning if an error occurs.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of seconds since 0 hours, 0 minutes, 0
seconds, January 1, 1970, Coordinated Universal Time, or 0 if an
error has occurred.
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2614588"></a><h3><a name="translate-sgml-ref-expand"></a>translate_sgml_ref_expand ()</h3><a class="indexterm" name="id2614597"></a><pre class="programlisting">char*       translate_sgml_ref_expand       (const char *str);</pre><p>
Parses <i class="parameter"><tt>str</tt></i>, expanding its SGML character references and XHTML
character entities into their Unicode character value.
</p><p>
Numerical SGML character references as well as XHTML entities are
supported. Unsupported entities will be inserted verbatim into the
result.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> a nul-terminated string.
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the expansion of str. The returned string should be
freed when no longer needed.
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="TranslateSession.html"><b>&lt;&lt; TranslateSession</b></a></td><td align="right"><a accesskey="n" href="rfc3066-builtin.html"><b>Appendix A. Built-in RFC 3066 Tag to Name Mappings &gt;&gt;</b></a></td></tr></table></body></html>