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