]> git.sur5r.net Git - glabels/blob - docs/libglabels/html/libglabels-3.0-str.html
Imported Upstream version 3.4.0
[glabels] / docs / libglabels / html / libglabels-3.0-str.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>String Utility Functions: LibGlabels 3.0 Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="LibGlabels 3.0 Reference Manual">
8 <link rel="up" href="ch03.html" title="Miscellaneous">
9 <link rel="prev" href="libglabels-3.0-units.html" title="Units">
10 <meta name="generator" content="GTK-Doc V1.24 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 </head>
13 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
15 <td width="100%" align="left" class="shortcuts">
16 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
17                   <a href="#libglabels-3.0-str.description" class="shortcut">Description</a></span>
18 </td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
20 <td><a accesskey="u" href="ch03.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
21 <td><a accesskey="p" href="libglabels-3.0-units.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
22 <td><img src="right-insensitive.png" width="16" height="16" border="0"></td>
23 </tr></table>
24 <div class="refentry">
25 <a name="libglabels-3.0-str"></a><div class="titlepage"></div>
26 <div class="refnamediv"><table width="100%"><tr>
27 <td valign="top">
28 <h2><span class="refentrytitle"><a name="libglabels-3.0-str.top_of_page"></a>String Utility Functions</span></h2>
29 <p>String Utility Functions — String utility functions provided by libglabels</p>
30 </td>
31 <td class="gallery_image" valign="top" align="right"></td>
32 </tr></table></div>
33 <div class="refsect1">
34 <a name="libglabels-3.0-str.functions"></a><h2>Functions</h2>
35 <div class="informaltable"><table width="100%" border="0">
36 <colgroup>
37 <col width="150px" class="functions_return">
38 <col class="functions_name">
39 </colgroup>
40 <tbody>
41 <tr>
42 <td class="function_type">
43 <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
44 </td>
45 <td class="function_name">
46 <a class="link" href="libglabels-3.0-str.html#lgl-str-utf8-casecmp" title="lgl_str_utf8_casecmp ()">lgl_str_utf8_casecmp</a> <span class="c_punctuation">()</span>
47 </td>
48 </tr>
49 <tr>
50 <td class="function_type">
51 <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
52 </td>
53 <td class="function_name">
54 <a class="link" href="libglabels-3.0-str.html#lgl-str-part-name-cmp" title="lgl_str_part_name_cmp ()">lgl_str_part_name_cmp</a> <span class="c_punctuation">()</span>
55 </td>
56 </tr>
57 <tr>
58 <td class="function_type">
59 <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
60 </td>
61 <td class="function_name">
62 <a class="link" href="libglabels-3.0-str.html#lgl-str-format-fraction" title="lgl_str_format_fraction ()">lgl_str_format_fraction</a> <span class="c_punctuation">()</span>
63 </td>
64 </tr>
65 </tbody>
66 </table></div>
67 </div>
68 <div class="refsect1">
69 <a name="libglabels-3.0-str.includes"></a><h2>Includes</h2>
70 <pre class="synopsis">#include &lt;libglabels/lgl-str.h&gt;
71 </pre>
72 </div>
73 <div class="refsect1">
74 <a name="libglabels-3.0-str.description"></a><h2>Description</h2>
75 <p>
76 This section defines string utility functions used by libglabels and of
77 possible use to a user of libglabels.
78 </p>
79 </div>
80 <div class="refsect1">
81 <a name="libglabels-3.0-str.functions_details"></a><h2>Functions</h2>
82 <div class="refsect2">
83 <a name="lgl-str-utf8-casecmp"></a><h3>lgl_str_utf8_casecmp ()</h3>
84 <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
85 lgl_str_utf8_casecmp (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *s1</code></em>,
86                       <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *s2</code></em>);</pre>
87 <p>Compare two UTF-8 strings, ignoring the case of characters.</p>
88 <p>This function should be used only on strings that are known to be encoded
89 in UTF-8 or a compatible UTF-8 subset.</p>
90 <div class="refsect3">
91 <a name="id-1.4.3.6.2.6"></a><h4>Parameters</h4>
92 <div class="informaltable"><table width="100%" border="0">
93 <colgroup>
94 <col width="150px" class="parameters_name">
95 <col class="parameters_description">
96 <col width="200px" class="parameters_annotations">
97 </colgroup>
98 <tbody>
99 <tr>
100 <td class="parameter_name"><p>s1</p></td>
101 <td class="parameter_description"><p>string to compare with s2.</p></td>
102 <td class="parameter_annotations"> </td>
103 </tr>
104 <tr>
105 <td class="parameter_name"><p>s2</p></td>
106 <td class="parameter_description"><p>string to compare with s1.</p></td>
107 <td class="parameter_annotations"> </td>
108 </tr>
109 </tbody>
110 </table></div>
111 </div>
112 <div class="refsect3">
113 <a name="id-1.4.3.6.2.7"></a><h4>Returns</h4>
114 <p> 0 if the strings match, a negative value if s1 &lt; s2,
115 or a positive value if s1 &gt; s2.</p>
116 </div>
117 </div>
118 <hr>
119 <div class="refsect2">
120 <a name="lgl-str-part-name-cmp"></a><h3>lgl_str_part_name_cmp ()</h3>
121 <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
122 lgl_str_part_name_cmp (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *s1</code></em>,
123                        <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *s2</code></em>);</pre>
124 <p>Compare two UTF-8 strings representing part names or numbers.  This function
125 uses a natural sort order:</p>
126 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
127 <li class="listitem"><p>Ignores case.</p></li>
128 <li class="listitem"><p>Strings are divided into chunks (numeric and non-numeric)</p></li>
129 <li class="listitem"><p>Non-numeric chunks are compared character by character</p></li>
130 <li class="listitem"><p>Numerical chunks are compared numerically, so that "20" precedes "100".</p></li>
131 <li class="listitem"><p>Comparison of chunks is performed left to right until the first difference
132 is encountered or all chunks evaluate as equal.</p></li>
133 </ul></div>
134 <p>This function should be used only on strings that are known to be encoded
135 in UTF-8 or a compatible UTF-8 subset.</p>
136 <p>Numeric chunks are converted to 64 bit unsigned integers for comparison,
137 so the behaviour may be unpredictable for numeric chunks that exceed
138 18446744073709551615.</p>
139 <div class="refsect3">
140 <a name="id-1.4.3.6.3.8"></a><h4>Parameters</h4>
141 <div class="informaltable"><table width="100%" border="0">
142 <colgroup>
143 <col width="150px" class="parameters_name">
144 <col class="parameters_description">
145 <col width="200px" class="parameters_annotations">
146 </colgroup>
147 <tbody>
148 <tr>
149 <td class="parameter_name"><p>s1</p></td>
150 <td class="parameter_description"><p>string to compare with s2.</p></td>
151 <td class="parameter_annotations"> </td>
152 </tr>
153 <tr>
154 <td class="parameter_name"><p>s2</p></td>
155 <td class="parameter_description"><p>string to compare with s1.</p></td>
156 <td class="parameter_annotations"> </td>
157 </tr>
158 </tbody>
159 </table></div>
160 </div>
161 <div class="refsect3">
162 <a name="id-1.4.3.6.3.9"></a><h4>Returns</h4>
163 <p> 0 if the strings match, a negative value if s1 &lt; s2,
164 or a positive value if s1 &gt; s2.</p>
165 </div>
166 </div>
167 <hr>
168 <div class="refsect2">
169 <a name="lgl-str-format-fraction"></a><h3>lgl_str_format_fraction ()</h3>
170 <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
171 lgl_str_format_fraction (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>);</pre>
172 <p>Create fractional representation of number, if possible.  Uses UTF-8 superscripts and
173 subscripts for numerator and denominator values respecively.</p>
174 <div class="refsect3">
175 <a name="id-1.4.3.6.4.5"></a><h4>Parameters</h4>
176 <div class="informaltable"><table width="100%" border="0">
177 <colgroup>
178 <col width="150px" class="parameters_name">
179 <col class="parameters_description">
180 <col width="200px" class="parameters_annotations">
181 </colgroup>
182 <tbody><tr>
183 <td class="parameter_name"><p>x</p></td>
184 <td class="parameter_description"><p>Floating point number to convert to fractional notation</p></td>
185 <td class="parameter_annotations"> </td>
186 </tr></tbody>
187 </table></div>
188 </div>
189 <div class="refsect3">
190 <a name="id-1.4.3.6.4.6"></a><h4>Returns</h4>
191 <p> UTF-8 string containing fractional representation of x.</p>
192 </div>
193 </div>
194 </div>
195 <div class="refsect1">
196 <a name="libglabels-3.0-str.other_details"></a><h2>Types and Values</h2>
197 </div>
198 </div>
199 <div class="footer">
200 <hr>Generated by GTK-Doc V1.24</div>
201 </body>
202 </html>