File: libedataserver-e-util.html

package info (click to toggle)
evolution-data-server 1.6.3-5etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 59,384 kB
  • ctags: 43,218
  • sloc: ansic: 319,315; tcl: 30,499; xml: 19,166; sh: 18,776; perl: 11,529; cpp: 8,259; java: 7,653; makefile: 6,448; awk: 1,338; yacc: 1,103; sed: 772; cs: 505; lex: 134; asm: 14
file content (398 lines) | stat: -rw-r--r-- 15,910 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Utility Functions</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Evolution API Reference: libedataserver, utility library">
<link rel="up" href="ch01.html" title="Evolution API Reference: libedataserver, utility library">
<link rel="prev" href="libedataserver-e-uid.html" title="User ID Generation">
<link rel="next" href="libedataserver-e-url.html" title="EUrl">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Evolution API Reference: libedataserver, utility library">
</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="libedataserver-e-uid.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.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">Evolution API Reference: libedataserver, utility library</th>
<td><a accesskey="n" href="libedataserver-e-url.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="#id2555411" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2602408" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libedataserver-e-util"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2555411"></a><span class="refentrytitle">Utility Functions</span>
</h2>
<p>Utility Functions &#8212; Miscellaneous utility functions for evolution-data-server.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">



struct      <a href="libedataserver-e-util.html#tm">tm</a>;
int         <a href="libedataserver-e-util.html#e-util-mkdir-hier">e_util_mkdir_hier</a>               (const char *path,
                                             mode_t mode);
<a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*      <a href="libedataserver-e-util.html#e-util-strstrcase">e_util_strstrcase</a>               (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);
<a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*      <a href="libedataserver-e-util.html#e-util-unicode-get-utf8">e_util_unicode_get_utf8</a>         (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *text,
                                             <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Unicode-Manipulation.html#gunichar"
>gunichar</a> *out);
const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="libedataserver-e-util.html#e-util-utf8-strstrcase">e_util_utf8_strstrcase</a>         (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);
const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="libedataserver-e-util.html#e-util-utf8-strstrcasedecomp">e_util_utf8_strstrcasedecomp</a>   (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);
size_t      <a href="libedataserver-e-util.html#e-utf8-strftime">e_utf8_strftime</a>                 (char *s,
                                             size_t max,
                                             const char *fmt,
                                             const struct tm *tm);
size_t      <a href="libedataserver-e-util.html#e-strftime">e_strftime</a>                      (char *s,
                                             size_t max,
                                             const char *fmt,
                                             const struct tm *tm);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2602408"></a><h2>Description</h2>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="id2602424"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2602435"></a><h3>
<a name="tm"></a>struct tm</h3>
<a class="indexterm" name="id2602447"></a><pre class="programlisting">struct tm;</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2602462"></a><h3>
<a name="e-util-mkdir-hier"></a>e_util_mkdir_hier ()</h3>
<a class="indexterm" name="id2602475"></a><pre class="programlisting">int         e_util_mkdir_hier               (const char *path,
                                             mode_t mode);</pre>
<p>
Creates a directory hierarchy based on the string <em class="parameter"><code>path</code></em>. If <em class="parameter"><code>path</code></em>
is an absolute path, the directories will be created relative to
the root of the file system; otherwise, the directories will be
created relative to the current directory.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></td>
<td> The directory hierarchy to create.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>mode</code></em>&#160;:</span></td>
<td> The permissions to use for the directories.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> 0 on success; -1 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2598821"></a><h3>
<a name="e-util-strstrcase"></a>e_util_strstrcase ()</h3>
<a class="indexterm" name="id2598833"></a><pre class="programlisting"><a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*      e_util_strstrcase               (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);</pre>
<p>
Find the first instance of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, ignoring case for
bytes that are ASCII characters.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>haystack</code></em>&#160;:</span></td>
<td> The string to search in.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>needle</code></em>&#160;:</span></td>
<td> The string to search for.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A pointer to the start of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, or NULL if
         <em class="parameter"><code>needle</code></em> is not found.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2598944"></a><h3>
<a name="e-util-unicode-get-utf8"></a>e_util_unicode_get_utf8 ()</h3>
<a class="indexterm" name="id2598955"></a><pre class="programlisting"><a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*      e_util_unicode_get_utf8         (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *text,
                                             <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Unicode-Manipulation.html#gunichar"
>gunichar</a> *out);</pre>
<p>
Get a UTF-8 character from the beginning of <em class="parameter"><code>text</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>text</code></em>&#160;:</span></td>
<td> The string to take the UTF-8 character from.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>out</code></em>&#160;:</span></td>
<td> The location to store the UTF-8 character in.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A pointer to the next character in <em class="parameter"><code>text</code></em> after <em class="parameter"><code>out</code></em>. 
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2599056"></a><h3>
<a name="e-util-utf8-strstrcase"></a>e_util_utf8_strstrcase ()</h3>
<a class="indexterm" name="id2599067"></a><pre class="programlisting">const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>* e_util_utf8_strstrcase         (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);</pre>
<p>
Find the first instance of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, ignoring case. (No
proper case folding or decomposing is done.) Both <em class="parameter"><code>needle</code></em> and
<em class="parameter"><code>haystack</code></em> are UTF-8 strings.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>haystack</code></em>&#160;:</span></td>
<td> The string to search in.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>needle</code></em>&#160;:</span></td>
<td> The string to search for.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A pointer to the first instance of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, or
         <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if no match is found, or if either of the strings are
         not legal UTF-8 strings.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2597301"></a><h3>
<a name="e-util-utf8-strstrcasedecomp"></a>e_util_utf8_strstrcasedecomp ()</h3>
<a class="indexterm" name="id2597312"></a><pre class="programlisting">const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>* e_util_utf8_strstrcasedecomp   (const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *haystack,
                                             const <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *needle);</pre>
<p>
Find the first instance of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, where both <em class="parameter"><code>needle</code></em>
and <em class="parameter"><code>haystack</code></em> are UTF-8 strings. Both strings are stripped and
decomposed for comparison, and case is ignored.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>haystack</code></em>&#160;:</span></td>
<td> The string to search in.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>needle</code></em>&#160;:</span></td>
<td> The string to search for.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A pointer to the first instance of <em class="parameter"><code>needle</code></em> in <em class="parameter"><code>haystack</code></em>, or
         <a
href="/opt/gnome/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if either of the strings are not legal UTF-8 strings.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2597442"></a><h3>
<a name="e-utf8-strftime"></a>e_utf8_strftime ()</h3>
<a class="indexterm" name="id2597454"></a><pre class="programlisting">size_t      e_utf8_strftime                 (char *s,
                                             size_t max,
                                             const char *fmt,
                                             const struct tm *tm);</pre>
<p>
The UTF-8 equivalent of <a href="libedataserver-e-util.html#e-strftime"><code class="function">e_strftime()</code></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>s</code></em>&#160;:</span></td>
<td> The string array to store the result in.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>max</code></em>&#160;:</span></td>
<td> The size of array <em class="parameter"><code>s</code></em>.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fmt</code></em>&#160;:</span></td>
<td> The formatting to use on <em class="parameter"><code>tm</code></em>.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>tm</code></em>&#160;:</span></td>
<td> The time value to format.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> The number of characters placed in <em class="parameter"><code>s</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2597606"></a><h3>
<a name="e-strftime"></a>e_strftime ()</h3>
<a class="indexterm" name="id2597618"></a><pre class="programlisting">size_t      e_strftime                      (char *s,
                                             size_t max,
                                             const char *fmt,
                                             const struct tm *tm);</pre>
<p>
This function is a wrapper around the strftime(3) function, which
converts the &amp;percnt;l and &amp;percnt;k (12h and 24h) format variables 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>s</code></em>&#160;:</span></td>
<td> The string array to store the result in.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>max</code></em>&#160;:</span></td>
<td> The size of array <em class="parameter"><code>s</code></em>.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fmt</code></em>&#160;:</span></td>
<td> The formatting to use on <em class="parameter"><code>tm</code></em>.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>tm</code></em>&#160;:</span></td>
<td> The time value to format.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> The number of characters placed in <em class="parameter"><code>s</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>