File: charstring.h.html

package info (click to toggle)
rudiments 0.32-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,932 kB
  • ctags: 3,047
  • sloc: cpp: 23,013; sh: 7,769; ansic: 1,769; makefile: 1,057; xml: 169; perl: 19
file content (477 lines) | stat: -rw-r--r-- 55,736 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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/charstring.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2003 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef RUDIMENTS_CHARSTRING_H</font>
<font color="#a020f0">#define RUDIMENTS_CHARSTRING_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;rudiments/private/charstringincludes.h&gt;</font>

<font color="#0000ff">// The charstring class provides methods for manipulating strings.</font>
<font color="#0000ff">//</font>
<font color="#0000ff">// Unlike the functions in string.h, these methods are NULL safe.  If any of</font>
<font color="#0000ff">// the pointer arguments are NULL, your application will not crash.</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> charstring {
        <font color="#a52a2a"><b>public</b></font>:

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>size_t</b></font> length(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                        <font color="#0000ff">// Returns the length of &quot;string&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>size_t</b></font> length(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                        <font color="#0000ff">// Returns the length of &quot;string&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   zero(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Sets &quot;size&quot; bytes of &quot;str&quot; to NULL.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source);
                        <font color="#0000ff">// Appends &quot;source&quot; to &quot;dest&quot;.  Assumes that there</font>
                        <font color="#0000ff">// is enough room remaining in &quot;dest&quot; to accommodate</font>
                        <font color="#0000ff">// the new string.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source,
                                                                <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Appends &quot;size&quot; bytes of &quot;source&quot; to &quot;dest&quot;.  Assumes</font>
                        <font color="#0000ff">// that there is enough room remaining in &quot;dest&quot; to</font>
                        <font color="#0000ff">// accommodate the new string.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>int32_t</b></font> number);
                        <font color="#0000ff">// Converts &quot;number&quot; to a string and appends it to</font>
                        <font color="#0000ff">// &quot;dest&quot;.  Assumes that there is enough room remaining</font>
                        <font color="#0000ff">// in &quot;dest&quot; to accommodate the new string.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>uint32_t</b></font> number);
                        <font color="#0000ff">// Converts &quot;number&quot; to a string and appends it to</font>
                        <font color="#0000ff">// &quot;dest&quot;.  Assumes that there is enough room remaining</font>
                        <font color="#0000ff">// in &quot;dest&quot; to accommodate the new string.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>double</b></font> number);
                        <font color="#0000ff">// Converts &quot;number&quot; to a string and appends it to</font>
                        <font color="#0000ff">// &quot;dest&quot;.  Assumes that there is enough room remaining</font>
                        <font color="#0000ff">// in &quot;dest&quot; to accommodate the new string.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>double</b></font> number,
                                                        <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                        <font color="#0000ff">// Converts &quot;number&quot; to a string using &quot;scale&quot; and</font>
                        <font color="#0000ff">// appends it to &quot;dest&quot;.  Assumes that there is enough</font>
                        <font color="#0000ff">// room remaining in &quot;dest&quot; to accommodate the new</font>
                        <font color="#0000ff">// string.  Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *append(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>double</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> precision,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                        <font color="#0000ff">// Converts &quot;number&quot; to a string using &quot;precision&quot; and</font>
                        <font color="#0000ff">// &quot;scale&quot; and appends it to &quot;dest&quot;.  Assumes that there</font>
                        <font color="#0000ff">// is enough room remaining in &quot;dest&quot; to accommodate</font>
                        <font color="#0000ff">// the new string.  Returns a pointer to &quot;dest&quot;.</font>



                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *copy(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source);
                        <font color="#0000ff">// Replaces &quot;dest&quot; with &quot;source&quot;.  Assumes that there</font>
                        <font color="#0000ff">// is enough room in &quot;dest&quot; to accommodate &quot;source&quot;.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *copy(<font color="#2e8b57"><b>char</b></font> *dest,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source, <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Replaces the first &quot;size&quot; bytes of &quot;dest&quot; with</font>
                        <font color="#0000ff">// &quot;source&quot;.  Assumes that &quot;dest&quot; is at least &quot;size&quot;</font>
                        <font color="#0000ff">// bytes long.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *copy(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>size_t</b></font> location,
                                                <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source);
                        <font color="#0000ff">// Replaces &quot;dest&quot; with &quot;source&quot;, starting &quot;location&quot;</font>
                        <font color="#0000ff">// bytes into &quot;dest&quot;.  Assumes that there is enough</font>
                        <font color="#0000ff">// room in &quot;dest&quot; (after &quot;location&quot; bytes) to</font>
                        <font color="#0000ff">// accommodate &quot;source&quot;.</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *copy(<font color="#2e8b57"><b>char</b></font> *dest, <font color="#2e8b57"><b>size_t</b></font> location,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *source, <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Replaces &quot;size&quot; bytes of &quot;dest&quot; with &quot;source&quot;,</font>
                        <font color="#0000ff">// starting &quot;location&quot; bytes into &quot;dest&quot;.  Assumes that</font>
                        <font color="#0000ff">// there are &quot;size&quot; bytes in &quot;dest&quot; (after &quot;location&quot;</font>
                        <font color="#0000ff">// bytes).</font>
                        <font color="#0000ff">// Returns a pointer to &quot;dest&quot;.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    compare(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str1, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str2);
                        <font color="#0000ff">// Returns -1,0 or 1 if &quot;str1&quot; is greater than, </font>
                        <font color="#0000ff">// equal to or less than &quot;str2&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    compare(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str1, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str2,
                                                                <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Returns -1,0 or 1 if &quot;size&quot; bytes of &quot;str1&quot; are</font>
                        <font color="#0000ff">// greater than, equal to or less than &quot;size&quot; bytes of</font>
                        <font color="#0000ff">// &quot;str2&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    compareIgnoringCase(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str1,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str2);
                        <font color="#0000ff">// Returns -1,0 or 1 if &quot;str1&quot; is greater than, </font>
                        <font color="#0000ff">// equal to or less than &quot;str2&quot;, ignoring case.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    compareIgnoringCase(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str1,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str2,
                                                        <font color="#2e8b57"><b>size_t</b></font> size);
                        <font color="#0000ff">// Returns -1,0 or 1 if &quot;size&quot; bytes of &quot;str1&quot; are</font>
                        <font color="#0000ff">// greater than, equal to or less than &quot;size&quot; bytes of</font>
                        <font color="#0000ff">// &quot;str2&quot;, ignoring case.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   contains(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *needle);
                        <font color="#0000ff">// Returns true if &quot;haystack&quot; contains &quot;needle&quot; or</font>
                        <font color="#0000ff">// false otherwise.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   contains(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack, <font color="#2e8b57"><b>char</b></font> needle);
                        <font color="#0000ff">// Returns true if &quot;haystack&quot; contains &quot;needle&quot; or</font>
                        <font color="#0000ff">// false otherwise.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *findFirst(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *needle);
                        <font color="#0000ff">// Returns a pointer to the first occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *findFirst(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>char</b></font> needle);
                        <font color="#0000ff">// Returns a pointer to the first occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *findLast(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *needle);
                        <font color="#0000ff">// Returns a pointer to the last occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *findLast(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>char</b></font> needle);
                        <font color="#0000ff">// Returns a pointer to the last occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *findFirst(<font color="#2e8b57"><b>char</b></font> *haystack, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *needle);
                        <font color="#0000ff">// Returns a pointer to the first occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *findFirst(<font color="#2e8b57"><b>char</b></font> *haystack, <font color="#2e8b57"><b>char</b></font> needle);
                        <font color="#0000ff">// Returns a pointer to the first occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *findLast(<font color="#2e8b57"><b>char</b></font> *haystack, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *needle);
                        <font color="#0000ff">// Returns a pointer to the last occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *findLast(<font color="#2e8b57"><b>char</b></font> *haystack, <font color="#2e8b57"><b>char</b></font> needle);
                        <font color="#0000ff">// Returns a pointer to the last occurrance of &quot;needle&quot;</font>
                        <font color="#0000ff">// in &quot;haystack&quot; or NULL if not found.</font>

                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *findFirstOfSet(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *set);
                        <font color="#0000ff">// Returns a pointer to the first occurence in</font>
                        <font color="#0000ff">// &quot;haystack&quot; of any of the characters in &quot;set&quot;.</font>
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>char</b></font>           *findFirstOfSet(<font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *set);
                        <font color="#0000ff">// Returns a pointer to the first occurence in</font>
                        <font color="#0000ff">// &quot;haystack&quot; of any of the characters in &quot;set&quot;.</font>


                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>size_t</b></font> lengthContainingSet(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *set);
                        <font color="#0000ff">// Returns the number of characters, starting at the</font>
                        <font color="#0000ff">// beginning of &quot;haystack&quot; which consists entirely of</font>
                        <font color="#0000ff">// characters in &quot;set&quot;.</font>
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>size_t</b></font> lengthNotContainingSet(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *haystack,
                                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *set);
                        <font color="#0000ff">// Returns the number of characters, starting at the</font>
                        <font color="#0000ff">// beginning of &quot;haystack&quot; which consists entirely of</font>
                        <font color="#0000ff">// characters not in &quot;set&quot;.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *duplicate(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Creates a duplicate of &quot;str&quot; and returns a pointer</font>
                        <font color="#0000ff">// to it.  Note that this method allocates a buffer for</font>
                        <font color="#0000ff">// the duplicate string internally and returns it.  The</font>
                        <font color="#0000ff">// calling program must deallocate this buffer.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *duplicate(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>size_t</b></font> length);
                        <font color="#0000ff">// Creates a duplicate of the first &quot;length&quot; bytes of</font>
                        <font color="#0000ff">// &quot;str&quot; and returns a pointer to it.  Note that this</font>
                        <font color="#0000ff">// method allocates a buffer for the duplicate string</font>
                        <font color="#0000ff">// internally and returns it.  The calling program must</font>
                        <font color="#0000ff">// deallocate this buffer.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   upper(<font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Converts &quot;str&quot; to uppercase.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   lower(<font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Converts &quot;str&quot; to lowercase.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   rightTrim(<font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Rrims all spaces off of the right hand side of &quot;str&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   rightTrim(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>char</b></font> character);
                        <font color="#0000ff">// Rrims all &quot;character&quot;'s off of the right hand side</font>
                        <font color="#0000ff">// of &quot;str&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   leftTrim(<font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Trims all spaces off of the left hand side of &quot;str&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   leftTrim(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>char</b></font> character);
                        <font color="#0000ff">// Trims all &quot;character&quot;'s off of the left hand side</font>
                        <font color="#0000ff">// of &quot;str&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   bothTrim(<font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Trims all spaces off of both sides of &quot;str&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   bothTrim(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>char</b></font> character);
                        <font color="#0000ff">// Trims all characters off of both sides of &quot;str&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   strip(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>char</b></font> character);
                        <font color="#0000ff">// Strips all instances of &quot;character&quot; from &quot;str&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   strip(<font color="#2e8b57"><b>char</b></font> *str1, <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str2);
                        <font color="#0000ff">// Strips all instances of &quot;str2&quot; from &quot;str1&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>int16_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>int32_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>int64_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>uint16_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>uint32_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>    integerLength(<font color="#2e8b57"><b>uint64_t</b></font> number);
                        <font color="#0000ff">// Returns the number of characters needed to represent</font>
                        <font color="#0000ff">// &quot;number&quot; as a string.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   isInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *val);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   isInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *val, <font color="#2e8b57"><b>int</b></font> size);
                        <font color="#0000ff">// Returns true if the string &quot;val&quot; is an integer and</font>
                        <font color="#0000ff">// false if it is not an integer.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   isNumber(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *val);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   isNumber(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *val, <font color="#2e8b57"><b>int</b></font> size);
                        <font color="#0000ff">// Returns true the string &quot;val&quot; is a number and false</font>
                        <font color="#0000ff">// if it is not a number</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int16_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint16_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int16_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint16_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int32_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint32_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int32_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint32_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int64_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint64_t</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>int64_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>uint64_t</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> zeropadding);
                        <font color="#0000ff">// Returns a string representing &quot;number&quot;.  The string</font>
                        <font color="#0000ff">// is allocated inside the function and must be deleted</font>
                        <font color="#0000ff">// by the calling program.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>float</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>float</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>float</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> precision,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>double</b></font> number);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>double</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *parseNumber(<font color="#2e8b57"><b>double</b></font> number,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> precision,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>short</b></font> scale);
                        <font color="#0000ff">// Returns a string representing &quot;number&quot;.  The string</font>
                        <font color="#0000ff">// is allocated inside the function and must be deleted</font>
                        <font color="#0000ff">// by the calling program.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int64_t</b></font>        toInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit integer.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int64_t</b></font>        toInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string, <font color="#2e8b57"><b>char</b></font> **endptr);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit integer.  If non-NULL,</font>
                        <font color="#0000ff">// endptr will be set to the first character in the</font>
                        <font color="#0000ff">// string after the number.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int64_t</b></font>        toInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string, <font color="#2e8b57"><b>int</b></font> base);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit integer of base &quot;base&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int64_t</b></font>        toInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                        <font color="#2e8b57"><b>char</b></font> **endptr, <font color="#2e8b57"><b>int</b></font> base);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit integer of base &quot;base&quot;.</font>
                        <font color="#0000ff">// If non-NULL, endptr will be set to the first</font>
                        <font color="#0000ff">// character in the string after the number.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>uint64_t</b></font>       toUnsignedInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit unsigned integer.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>uint64_t</b></font>       toUnsignedInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                                        <font color="#2e8b57"><b>char</b></font> **endptr);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit unsigned integer.  If</font>
                        <font color="#0000ff">// non-NULL, endptr will be set to the first character</font>
                        <font color="#0000ff">// in the string after the number.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>uint64_t</b></font>       toUnsignedInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                                                <font color="#2e8b57"><b>int</b></font> base);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit unsigned integer of</font>
                        <font color="#0000ff">// base &quot;base&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>uint64_t</b></font>       toUnsignedInteger(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                                        <font color="#2e8b57"><b>char</b></font> **endptr,
                                                        <font color="#2e8b57"><b>int</b></font> base);
                        <font color="#0000ff">// Converts &quot;string&quot; to a 64-bit unsigned integer of</font>
                        <font color="#0000ff">// base &quot;base&quot;.</font>
                        <font color="#0000ff">// If non-NULL, endptr will be set to the first</font>
                        <font color="#0000ff">// character in the string after the number.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>long</b></font> <font color="#2e8b57"><b>double</b></font>    toFloat(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string);
                        <font color="#0000ff">// Converts &quot;string&quot; to a floating point number.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>long</b></font> <font color="#2e8b57"><b>double</b></font>    toFloat(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                                        <font color="#2e8b57"><b>char</b></font> **endptr);
                        <font color="#0000ff">// Converts &quot;string&quot; to a floating point number.  If</font>
                        <font color="#0000ff">// non-NULL, endptr will be set to the first character</font>
                        <font color="#0000ff">// in the string after the number.</font>


                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *httpEscape(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input);
                        <font color="#0000ff">// http escapes &quot;input&quot; and returns it in a buffer</font>
                        <font color="#0000ff">// allocated inside the function.  This buffer must be</font>
                        <font color="#0000ff">// deleted by the calling program.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *escape(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *characters);
                        <font color="#0000ff">// escapes all characters in &quot;characters&quot; found in</font>
                        <font color="#0000ff">// &quot;input&quot; using \'s and returns it in a buffer</font>
                        <font color="#0000ff">// allocated inside the function.  This buffer must be</font>
                        <font color="#0000ff">// deleted by the calling program.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *unescape(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input);
                        <font color="#0000ff">// unescapes all \-escaped characters found in</font>
                        <font color="#0000ff">// &quot;input&quot; and returns the result in a buffer</font>
                        <font color="#0000ff">// allocated inside the function.  This buffer must be</font>
                        <font color="#0000ff">// deleted by the calling program.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   escape(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input, <font color="#2e8b57"><b>uint64_t</b></font> inputsize,
                                        <font color="#2e8b57"><b>char</b></font> **output, <font color="#2e8b57"><b>uint64_t</b></font> *outputsize,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *characters);
                        <font color="#0000ff">// similar to escape() above, but takes an &quot;inputsize&quot;</font>
                        <font color="#0000ff">// parameter and returns the result in &quot;output&quot; and</font>
                        <font color="#0000ff">// &quot;outputsize&quot; rather than in a return value</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   unescape(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input, <font color="#2e8b57"><b>uint64_t</b></font> inputsize,
                                        <font color="#2e8b57"><b>char</b></font> **output, <font color="#2e8b57"><b>uint64_t</b></font> *outputsize);
                        <font color="#0000ff">// similar to unescape() above, but takes an &quot;inputsize&quot;</font>
                        <font color="#0000ff">// parameter and returns the result in &quot;output&quot; and</font>
                        <font color="#0000ff">// &quot;outputsize&quot; rather than in a return value</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *base64Encode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *input);
                        <font color="#0000ff">// base64-encodes &quot;input&quot; and returns it in a buffer</font>
                        <font color="#0000ff">// allocated inside the function.  This buffer must be</font>
                        <font color="#0000ff">// deleted by the calling program.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>char</b></font>   *base64Encode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *input,
                                                <font color="#2e8b57"><b>uint64_t</b></font> inputsize);
                        <font color="#0000ff">// similar to base64Encode above but only encodes</font>
                        <font color="#0000ff">// the first &quot;inputsize&quot; characters of &quot;input&quot;</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   base64Encode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *input,
                                                <font color="#2e8b57"><b>uint64_t</b></font> inputsize,
                                                <font color="#2e8b57"><b>char</b></font> **output,
                                                <font color="#2e8b57"><b>uint64_t</b></font> *outputsize);
                        <font color="#0000ff">// similar to base64Encode() above, but returns the</font>
                        <font color="#0000ff">// result in &quot;output&quot; and &quot;outputsize&quot; rather than in a</font>
                        <font color="#0000ff">// return value</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font>  *base64Decode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input);
                        <font color="#0000ff">// base64-decodes &quot;input&quot; and returns it in a buffer</font>
                        <font color="#0000ff">// allocated inside the function.  This buffer must be</font>
                        <font color="#0000ff">// deleted by the calling program.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font>  *base64Decode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input,
                                                        <font color="#2e8b57"><b>uint64_t</b></font> inputsize);
                        <font color="#0000ff">// similar to base64Decode above but only decodes</font>
                        <font color="#0000ff">// the first &quot;inputsize&quot; characters of &quot;input&quot;</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   base64Decode(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *input,
                                                <font color="#2e8b57"><b>uint64_t</b></font> inputsize,
                                                <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> **output,
                                                <font color="#2e8b57"><b>uint64_t</b></font> *outputsize);
                        <font color="#0000ff">// similar to base64Decode() above, but returns the</font>
                        <font color="#0000ff">// result in &quot;output&quot; and &quot;outputsize&quot; rather than in a</font>
                        <font color="#0000ff">// return value</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   leftJustify(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>int</b></font> length);
                        <font color="#0000ff">// Moves leading spaces to the end of &quot;str&quot; for</font>
                        <font color="#0000ff">// &quot;length&quot; characters.</font>
                        <font color="#0000ff">// </font>
                        <font color="#0000ff">// Example:</font>
                        <font color="#0000ff">//   &quot;   hello   &quot; -&gt; &quot;hello      &quot;</font>
                <font color="#2e8b57"><b>static</b></font>  <font color="#2e8b57"><b>void</b></font>    rightPad(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>int</b></font> lngth,
                                        <font color="#2e8b57"><b>char</b></font> padchar, <font color="#2e8b57"><b>bool</b></font> fill);
                        <font color="#0000ff">// Moves trailing spaces to the beginning of &quot;str&quot; for</font>
                        <font color="#0000ff">// &quot;length&quot; characters and replaces them with the</font>
                        <font color="#0000ff">// padchar.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Example when padchar is X:</font>
                        <font color="#0000ff">//      &quot;hello      &quot; -&gt; &quot;XXXXXXhello&quot;</font>
                        <font color="#0000ff">// Example when padchar is X and lngth is 10 and fill</font>
                        <font color="#0000ff">// is true</font>
                        <font color="#0000ff">//   &quot;hello&quot; -&gt; &quot;XXXXhello&quot;</font>
                        <font color="#0000ff">// Example when padchar is X and lngth is 10 and fill</font>
                        <font color="#0000ff">// is false</font>
                        <font color="#0000ff">//      &quot;hello &quot; -&gt; &quot; hello&quot;</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   rightJustify(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>int</b></font> length);
                        <font color="#0000ff">// Moves trailing spaces to the beginning of &quot;str&quot; for</font>
                        <font color="#0000ff">// &quot;length&quot; characters.</font>
                        <font color="#0000ff">// </font>
                        <font color="#0000ff">// Example:</font>
                        <font color="#0000ff">//   &quot;   hello   &quot; -&gt; &quot;      hello&quot;</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   center(<font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>int</b></font> length);
                        <font color="#0000ff">// Centers the text of &quot;str&quot; for &quot;length&quot; characters.</font>
                        <font color="#0000ff">// </font>
                        <font color="#0000ff">// Example:</font>
                        <font color="#0000ff">//   &quot;hello      &quot; -&gt; &quot;   hello   &quot;</font>


                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   safePrint(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str);
                        <font color="#0000ff">// Prints &quot;str&quot;, however all non-printing characters</font>
                        <font color="#0000ff">// are printed as hex values of the format: (0x0a) and</font>
                        <font color="#0000ff">// carriage returns, line feeds and tabs are printed</font>
                        <font color="#0000ff">// as \n, \r and \t.</font>
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   safePrint(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str, <font color="#2e8b57"><b>int</b></font> length);
                        <font color="#0000ff">// safePrint()'s &quot;length&quot; characters of &quot;str&quot; </font>


                <font color="#0000ff">// These methods parse &quot;string&quot; delimited by &quot;delimiter&quot;</font>
                <font color="#0000ff">// and allocate &quot;listlength&quot; elements of &quot;list&quot; to return the</font>
                <font color="#0000ff">// parts.  Each member of &quot;list&quot; and &quot;list&quot; must be deallocated</font>
                <font color="#0000ff">// by the calling program.  In the versions of the method</font>
                <font color="#0000ff">// where &quot;stringlength&quot; or &quot;delimiterlength&quot; are not</font>
                <font color="#0000ff">// supplied, string and/or delimiter are presumed to be</font>
                <font color="#0000ff">// NULL terminated strings.</font>
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   split(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                        <font color="#2e8b57"><b>ssize_t</b></font> stringlength,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *delimiter,
                                        <font color="#2e8b57"><b>ssize_t</b></font> delimiterlength,
                                        <font color="#2e8b57"><b>bool</b></font> collapse,
                                        <font color="#2e8b57"><b>char</b></font> ***list,
                                        <font color="#2e8b57"><b>uint64_t</b></font> *listlength);
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   split(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *delimiter,
                                        <font color="#2e8b57"><b>ssize_t</b></font> delimiterlength,
                                        <font color="#2e8b57"><b>bool</b></font> collapse,
                                        <font color="#2e8b57"><b>char</b></font> ***list,
                                        <font color="#2e8b57"><b>uint64_t</b></font> *listlength);
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   split(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                        <font color="#2e8b57"><b>ssize_t</b></font> stringlength,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *delimiter,
                                        <font color="#2e8b57"><b>bool</b></font> collapse,
                                        <font color="#2e8b57"><b>char</b></font> ***list,
                                        <font color="#2e8b57"><b>uint64_t</b></font> *listlength);
                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font>   split(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *string,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *delimiter,
                                        <font color="#2e8b57"><b>bool</b></font> collapse,
                                        <font color="#2e8b57"><b>char</b></font> ***list,
                                        <font color="#2e8b57"><b>uint64_t</b></font> *listlength);

                <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>char</b></font>   *subString(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *str,
                                                <font color="#2e8b57"><b>size_t</b></font> start, <font color="#2e8b57"><b>size_t</b></font> end);
                                <font color="#0000ff">// Returns a copy of the segment of &quot;str&quot;</font>
                                <font color="#0000ff">// between string indices &quot;start&quot; and &quot;end&quot;.</font>

<font color="#a020f0">        #include </font><font color="#ff00ff">&lt;rudiments/private/charstring.h&gt;</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>