Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | #ifndef _UNISTR_H | - |
19 | #define _UNISTR_H | - |
20 | | - |
21 | #include "unitypes.h" | - |
22 | | - |
23 | | - |
24 | #include "unused-parameter.h" | - |
25 | | - |
26 | | - |
27 | #include <stdbool.h> | - |
28 | | - |
29 | | - |
30 | #include <stddef.h> | - |
31 | | - |
32 | #ifdef __cplusplus | - |
33 | extern "C" { | - |
34 | #endif | - |
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 | extern const uint8_t * | - |
70 | u8_check (const uint8_t *s, size_t n) | - |
71 | _UC_ATTRIBUTE_PURE; | - |
72 | | - |
73 | | - |
74 | | - |
75 | extern const uint16_t * | - |
76 | u16_check (const uint16_t *s, size_t n) | - |
77 | _UC_ATTRIBUTE_PURE; | - |
78 | | - |
79 | | - |
80 | | - |
81 | extern const uint32_t * | - |
82 | u32_check (const uint32_t *s, size_t n) | - |
83 | _UC_ATTRIBUTE_PURE; | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | extern uint16_t * | - |
90 | u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf, | - |
91 | size_t *lengthp); | - |
92 | | - |
93 | | - |
94 | extern uint32_t * | - |
95 | u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf, | - |
96 | size_t *lengthp); | - |
97 | | - |
98 | | - |
99 | extern uint8_t * | - |
100 | u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf, | - |
101 | size_t *lengthp); | - |
102 | | - |
103 | | - |
104 | extern uint32_t * | - |
105 | u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf, | - |
106 | size_t *lengthp); | - |
107 | | - |
108 | | - |
109 | extern uint8_t * | - |
110 | u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf, | - |
111 | size_t *lengthp); | - |
112 | | - |
113 | | - |
114 | extern uint16_t * | - |
115 | u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf, | - |
116 | size_t *lengthp); | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | | - |
125 | extern int | - |
126 | u8_mblen (const uint8_t *s, size_t n) | - |
127 | _UC_ATTRIBUTE_PURE; | - |
128 | extern int | - |
129 | u16_mblen (const uint16_t *s, size_t n) | - |
130 | _UC_ATTRIBUTE_PURE; | - |
131 | extern int | - |
132 | u32_mblen (const uint32_t *s, size_t n) | - |
133 | _UC_ATTRIBUTE_PURE; | - |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | #if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING | - |
145 | # if !HAVE_INLINE | - |
146 | extern int | - |
147 | u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n); | - |
148 | # else | - |
149 | extern int | - |
150 | u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n); | - |
151 | static inline int | - |
152 | u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n) | - |
153 | { | - |
154 | uint8_t c = *s; | - |
155 | | - |
156 | if (c < 0x80) | - |
157 | { | - |
158 | *puc = c; | - |
159 | return 1; | - |
160 | } | - |
161 | else | - |
162 | return u8_mbtouc_unsafe_aux (puc, s, n); | - |
163 | } | - |
164 | # endif | - |
165 | #endif | - |
166 | | - |
167 | #if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING | - |
168 | # if !HAVE_INLINE | - |
169 | extern int | - |
170 | u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n); | - |
171 | # else | - |
172 | extern int | - |
173 | u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n); | - |
174 | static inline int | - |
175 | u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n) | - |
176 | { | - |
177 | uint16_t c = *s; | - |
178 | | - |
179 | if (c < 0xd800 || c >= 0xe000) | - |
180 | { | - |
181 | *puc = c; | - |
182 | return 1; | - |
183 | } | - |
184 | else | - |
185 | return u16_mbtouc_unsafe_aux (puc, s, n); | - |
186 | } | - |
187 | # endif | - |
188 | #endif | - |
189 | | - |
190 | #if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING | - |
191 | # if !HAVE_INLINE | - |
192 | extern int | - |
193 | u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n); | - |
194 | # else | - |
195 | static inline int | - |
196 | u32_mbtouc_unsafe (ucs4_t *puc, | - |
197 | const uint32_t *s, size_t n _GL_UNUSED_PARAMETER) | - |
198 | { | - |
199 | uint32_t c = *s; | - |
200 | | - |
201 | if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) | - |
202 | *puc = c; | - |
203 | else | - |
204 | | - |
205 | *puc = 0xfffd; | - |
206 | return 1; | - |
207 | } | - |
208 | # endif | - |
209 | #endif | - |
210 | | - |
211 | #if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING | - |
212 | # if !HAVE_INLINE | - |
213 | extern int | - |
214 | u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n); | - |
215 | # else | - |
216 | extern int | - |
217 | u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n); | - |
218 | static inline int | - |
219 | u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n) | - |
220 | { | - |
221 | uint8_t c = *s; | - |
222 | | - |
223 | if (c < 0x80) | - |
224 | { | - |
225 | *puc = c; | - |
226 | return 1; | - |
227 | } | - |
228 | else | - |
229 | return u8_mbtouc_aux (puc, s, n); | - |
230 | } | - |
231 | # endif | - |
232 | #endif | - |
233 | | - |
234 | #if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING | - |
235 | # if !HAVE_INLINE | - |
236 | extern int | - |
237 | u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n); | - |
238 | # else | - |
239 | extern int | - |
240 | u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n); | - |
241 | static inline int | - |
242 | u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n) | - |
243 | { | - |
244 | uint16_t c = *s; | - |
245 | | - |
246 | if (c < 0xd800 || c >= 0xe000) | - |
247 | { | - |
248 | *puc = c; | - |
249 | return 1; | - |
250 | } | - |
251 | else | - |
252 | return u16_mbtouc_aux (puc, s, n); | - |
253 | } | - |
254 | # endif | - |
255 | #endif | - |
256 | | - |
257 | #if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING | - |
258 | # if !HAVE_INLINE | - |
259 | extern int | - |
260 | u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n); | - |
261 | # else | - |
262 | static inline int | - |
263 | u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER) | - |
264 | { | - |
265 | uint32_t c = *s; | - |
266 | | - |
267 | if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) | - |
268 | *puc = c; | - |
269 | else | - |
270 | | - |
271 | *puc = 0xfffd; | - |
272 | return 1; | - |
273 | } | - |
274 | # endif | - |
275 | #endif | - |
276 | | - |
277 | | - |
278 | | - |
279 | | - |
280 | | - |
281 | | - |
282 | | - |
283 | | - |
284 | | - |
285 | #if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING | - |
286 | extern int | - |
287 | u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n); | - |
288 | #endif | - |
289 | | - |
290 | #if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING | - |
291 | extern int | - |
292 | u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n); | - |
293 | #endif | - |
294 | | - |
295 | #if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING | - |
296 | extern int | - |
297 | u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n); | - |
298 | #endif | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | | - |
305 | | - |
306 | #if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING | - |
307 | | - |
308 | extern int | - |
309 | u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n); | - |
310 | # if !HAVE_INLINE | - |
311 | extern int | - |
312 | u8_uctomb (uint8_t *s, ucs4_t uc, int n); | - |
313 | # else | - |
314 | static inline int | - |
315 | u8_uctomb (uint8_t *s, ucs4_t uc, int n) | - |
316 | { | - |
317 | if (uc < 0x80 && n > 0)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
318 | { | - |
319 | s[0] = uc; | - |
320 | return 1; never executed: return 1; | 0 |
321 | } | - |
322 | else | - |
323 | return u8_uctomb_aux (s, uc, n); never executed: return u8_uctomb_aux (s, uc, n); | 0 |
324 | } | - |
325 | # endif | - |
326 | #endif | - |
327 | | - |
328 | #if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING | - |
329 | | - |
330 | extern int | - |
331 | u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n); | - |
332 | # if !HAVE_INLINE | - |
333 | extern int | - |
334 | u16_uctomb (uint16_t *s, ucs4_t uc, int n); | - |
335 | # else | - |
336 | static inline int | - |
337 | u16_uctomb (uint16_t *s, ucs4_t uc, int n) | - |
338 | { | - |
339 | if (uc < 0xd800 && n > 0) | - |
340 | { | - |
341 | s[0] = uc; | - |
342 | return 1; | - |
343 | } | - |
344 | else | - |
345 | return u16_uctomb_aux (s, uc, n); | - |
346 | } | - |
347 | # endif | - |
348 | #endif | - |
349 | | - |
350 | #if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING | - |
351 | # if !HAVE_INLINE | - |
352 | extern int | - |
353 | u32_uctomb (uint32_t *s, ucs4_t uc, int n); | - |
354 | # else | - |
355 | static inline int | - |
356 | u32_uctomb (uint32_t *s, ucs4_t uc, int n) | - |
357 | { | - |
358 | if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000)) | - |
359 | { | - |
360 | if (n > 0) | - |
361 | { | - |
362 | *s = uc; | - |
363 | return 1; | - |
364 | } | - |
365 | else | - |
366 | return -2; | - |
367 | } | - |
368 | else | - |
369 | return -1; | - |
370 | } | - |
371 | # endif | - |
372 | #endif | - |
373 | | - |
374 | | - |
375 | | - |
376 | extern uint8_t * | - |
377 | u8_cpy (uint8_t *dest, const uint8_t *src, size_t n); | - |
378 | extern uint16_t * | - |
379 | u16_cpy (uint16_t *dest, const uint16_t *src, size_t n); | - |
380 | extern uint32_t * | - |
381 | u32_cpy (uint32_t *dest, const uint32_t *src, size_t n); | - |
382 | | - |
383 | | - |
384 | | - |
385 | | - |
386 | extern uint8_t * | - |
387 | u8_move (uint8_t *dest, const uint8_t *src, size_t n); | - |
388 | extern uint16_t * | - |
389 | u16_move (uint16_t *dest, const uint16_t *src, size_t n); | - |
390 | extern uint32_t * | - |
391 | u32_move (uint32_t *dest, const uint32_t *src, size_t n); | - |
392 | | - |
393 | | - |
394 | | - |
395 | | - |
396 | extern uint8_t * | - |
397 | u8_set (uint8_t *s, ucs4_t uc, size_t n); | - |
398 | extern uint16_t * | - |
399 | u16_set (uint16_t *s, ucs4_t uc, size_t n); | - |
400 | extern uint32_t * | - |
401 | u32_set (uint32_t *s, ucs4_t uc, size_t n); | - |
402 | | - |
403 | | - |
404 | | - |
405 | extern int | - |
406 | u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n) | - |
407 | _UC_ATTRIBUTE_PURE; | - |
408 | extern int | - |
409 | u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n) | - |
410 | _UC_ATTRIBUTE_PURE; | - |
411 | extern int | - |
412 | u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n) | - |
413 | _UC_ATTRIBUTE_PURE; | - |
414 | | - |
415 | | - |
416 | | - |
417 | extern int | - |
418 | u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2) | - |
419 | _UC_ATTRIBUTE_PURE; | - |
420 | extern int | - |
421 | u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2) | - |
422 | _UC_ATTRIBUTE_PURE; | - |
423 | extern int | - |
424 | u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2) | - |
425 | _UC_ATTRIBUTE_PURE; | - |
426 | | - |
427 | | - |
428 | | - |
429 | extern uint8_t * | - |
430 | u8_chr (const uint8_t *s, size_t n, ucs4_t uc) | - |
431 | _UC_ATTRIBUTE_PURE; | - |
432 | extern uint16_t * | - |
433 | u16_chr (const uint16_t *s, size_t n, ucs4_t uc) | - |
434 | _UC_ATTRIBUTE_PURE; | - |
435 | extern uint32_t * | - |
436 | u32_chr (const uint32_t *s, size_t n, ucs4_t uc) | - |
437 | _UC_ATTRIBUTE_PURE; | - |
438 | | - |
439 | | - |
440 | | - |
441 | extern size_t | - |
442 | u8_mbsnlen (const uint8_t *s, size_t n) | - |
443 | _UC_ATTRIBUTE_PURE; | - |
444 | extern size_t | - |
445 | u16_mbsnlen (const uint16_t *s, size_t n) | - |
446 | _UC_ATTRIBUTE_PURE; | - |
447 | extern size_t | - |
448 | u32_mbsnlen (const uint32_t *s, size_t n) | - |
449 | _UC_ATTRIBUTE_PURE; | - |
450 | | - |
451 | | - |
452 | | - |
453 | | - |
454 | extern uint8_t * | - |
455 | u8_cpy_alloc (const uint8_t *s, size_t n); | - |
456 | extern uint16_t * | - |
457 | u16_cpy_alloc (const uint16_t *s, size_t n); | - |
458 | extern uint32_t * | - |
459 | u32_cpy_alloc (const uint32_t *s, size_t n); | - |
460 | | - |
461 | | - |
462 | | - |
463 | | - |
464 | | - |
465 | extern int | - |
466 | u8_strmblen (const uint8_t *s) | - |
467 | _UC_ATTRIBUTE_PURE; | - |
468 | extern int | - |
469 | u16_strmblen (const uint16_t *s) | - |
470 | _UC_ATTRIBUTE_PURE; | - |
471 | extern int | - |
472 | u32_strmblen (const uint32_t *s) | - |
473 | _UC_ATTRIBUTE_PURE; | - |
474 | | - |
475 | | - |
476 | | - |
477 | | - |
478 | extern int | - |
479 | u8_strmbtouc (ucs4_t *puc, const uint8_t *s); | - |
480 | extern int | - |
481 | u16_strmbtouc (ucs4_t *puc, const uint16_t *s); | - |
482 | extern int | - |
483 | u32_strmbtouc (ucs4_t *puc, const uint32_t *s); | - |
484 | | - |
485 | | - |
486 | | - |
487 | | - |
488 | extern const uint8_t * | - |
489 | u8_next (ucs4_t *puc, const uint8_t *s); | - |
490 | extern const uint16_t * | - |
491 | u16_next (ucs4_t *puc, const uint16_t *s); | - |
492 | extern const uint32_t * | - |
493 | u32_next (ucs4_t *puc, const uint32_t *s); | - |
494 | | - |
495 | | - |
496 | | - |
497 | | - |
498 | extern const uint8_t * | - |
499 | u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start); | - |
500 | extern const uint16_t * | - |
501 | u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start); | - |
502 | extern const uint32_t * | - |
503 | u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start); | - |
504 | | - |
505 | | - |
506 | | - |
507 | extern size_t | - |
508 | u8_strlen (const uint8_t *s) | - |
509 | _UC_ATTRIBUTE_PURE; | - |
510 | extern size_t | - |
511 | u16_strlen (const uint16_t *s) | - |
512 | _UC_ATTRIBUTE_PURE; | - |
513 | extern size_t | - |
514 | u32_strlen (const uint32_t *s) | - |
515 | _UC_ATTRIBUTE_PURE; | - |
516 | | - |
517 | | - |
518 | | - |
519 | extern size_t | - |
520 | u8_strnlen (const uint8_t *s, size_t maxlen) | - |
521 | _UC_ATTRIBUTE_PURE; | - |
522 | extern size_t | - |
523 | u16_strnlen (const uint16_t *s, size_t maxlen) | - |
524 | _UC_ATTRIBUTE_PURE; | - |
525 | extern size_t | - |
526 | u32_strnlen (const uint32_t *s, size_t maxlen) | - |
527 | _UC_ATTRIBUTE_PURE; | - |
528 | | - |
529 | | - |
530 | | - |
531 | extern uint8_t * | - |
532 | u8_strcpy (uint8_t *dest, const uint8_t *src); | - |
533 | extern uint16_t * | - |
534 | u16_strcpy (uint16_t *dest, const uint16_t *src); | - |
535 | extern uint32_t * | - |
536 | u32_strcpy (uint32_t *dest, const uint32_t *src); | - |
537 | | - |
538 | | - |
539 | | - |
540 | extern uint8_t * | - |
541 | u8_stpcpy (uint8_t *dest, const uint8_t *src); | - |
542 | extern uint16_t * | - |
543 | u16_stpcpy (uint16_t *dest, const uint16_t *src); | - |
544 | extern uint32_t * | - |
545 | u32_stpcpy (uint32_t *dest, const uint32_t *src); | - |
546 | | - |
547 | | - |
548 | | - |
549 | extern uint8_t * | - |
550 | u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n); | - |
551 | extern uint16_t * | - |
552 | u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n); | - |
553 | extern uint32_t * | - |
554 | u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n); | - |
555 | | - |
556 | | - |
557 | | - |
558 | | - |
559 | extern uint8_t * | - |
560 | u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n); | - |
561 | extern uint16_t * | - |
562 | u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n); | - |
563 | extern uint32_t * | - |
564 | u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n); | - |
565 | | - |
566 | | - |
567 | | - |
568 | extern uint8_t * | - |
569 | u8_strcat (uint8_t *dest, const uint8_t *src); | - |
570 | extern uint16_t * | - |
571 | u16_strcat (uint16_t *dest, const uint16_t *src); | - |
572 | extern uint32_t * | - |
573 | u32_strcat (uint32_t *dest, const uint32_t *src); | - |
574 | | - |
575 | | - |
576 | | - |
577 | extern uint8_t * | - |
578 | u8_strncat (uint8_t *dest, const uint8_t *src, size_t n); | - |
579 | extern uint16_t * | - |
580 | u16_strncat (uint16_t *dest, const uint16_t *src, size_t n); | - |
581 | extern uint32_t * | - |
582 | u32_strncat (uint32_t *dest, const uint32_t *src, size_t n); | - |
583 | | - |
584 | | - |
585 | | - |
586 | #ifdef __sun | - |
587 | | - |
588 | extern int | - |
589 | u8_strcmp_gnu (const uint8_t *s1, const uint8_t *s2) | - |
590 | _UC_ATTRIBUTE_PURE; | - |
591 | # define u8_strcmp u8_strcmp_gnu | - |
592 | #else | - |
593 | extern int | - |
594 | u8_strcmp (const uint8_t *s1, const uint8_t *s2) | - |
595 | _UC_ATTRIBUTE_PURE; | - |
596 | #endif | - |
597 | extern int | - |
598 | u16_strcmp (const uint16_t *s1, const uint16_t *s2) | - |
599 | _UC_ATTRIBUTE_PURE; | - |
600 | extern int | - |
601 | u32_strcmp (const uint32_t *s1, const uint32_t *s2) | - |
602 | _UC_ATTRIBUTE_PURE; | - |
603 | | - |
604 | | - |
605 | | - |
606 | | - |
607 | | - |
608 | extern int | - |
609 | u8_strcoll (const uint8_t *s1, const uint8_t *s2); | - |
610 | extern int | - |
611 | u16_strcoll (const uint16_t *s1, const uint16_t *s2); | - |
612 | extern int | - |
613 | u32_strcoll (const uint32_t *s1, const uint32_t *s2); | - |
614 | | - |
615 | | - |
616 | | - |
617 | extern int | - |
618 | u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n) | - |
619 | _UC_ATTRIBUTE_PURE; | - |
620 | extern int | - |
621 | u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n) | - |
622 | _UC_ATTRIBUTE_PURE; | - |
623 | extern int | - |
624 | u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n) | - |
625 | _UC_ATTRIBUTE_PURE; | - |
626 | | - |
627 | | - |
628 | | - |
629 | extern uint8_t * | - |
630 | u8_strdup (const uint8_t *s); | - |
631 | extern uint16_t * | - |
632 | u16_strdup (const uint16_t *s); | - |
633 | extern uint32_t * | - |
634 | u32_strdup (const uint32_t *s); | - |
635 | | - |
636 | | - |
637 | | - |
638 | extern uint8_t * | - |
639 | u8_strchr (const uint8_t *str, ucs4_t uc) | - |
640 | _UC_ATTRIBUTE_PURE; | - |
641 | extern uint16_t * | - |
642 | u16_strchr (const uint16_t *str, ucs4_t uc) | - |
643 | _UC_ATTRIBUTE_PURE; | - |
644 | extern uint32_t * | - |
645 | u32_strchr (const uint32_t *str, ucs4_t uc) | - |
646 | _UC_ATTRIBUTE_PURE; | - |
647 | | - |
648 | | - |
649 | | - |
650 | extern uint8_t * | - |
651 | u8_strrchr (const uint8_t *str, ucs4_t uc) | - |
652 | _UC_ATTRIBUTE_PURE; | - |
653 | extern uint16_t * | - |
654 | u16_strrchr (const uint16_t *str, ucs4_t uc) | - |
655 | _UC_ATTRIBUTE_PURE; | - |
656 | extern uint32_t * | - |
657 | u32_strrchr (const uint32_t *str, ucs4_t uc) | - |
658 | _UC_ATTRIBUTE_PURE; | - |
659 | | - |
660 | | - |
661 | | - |
662 | | - |
663 | extern size_t | - |
664 | u8_strcspn (const uint8_t *str, const uint8_t *reject) | - |
665 | _UC_ATTRIBUTE_PURE; | - |
666 | extern size_t | - |
667 | u16_strcspn (const uint16_t *str, const uint16_t *reject) | - |
668 | _UC_ATTRIBUTE_PURE; | - |
669 | extern size_t | - |
670 | u32_strcspn (const uint32_t *str, const uint32_t *reject) | - |
671 | _UC_ATTRIBUTE_PURE; | - |
672 | | - |
673 | | - |
674 | | - |
675 | | - |
676 | extern size_t | - |
677 | u8_strspn (const uint8_t *str, const uint8_t *accept) | - |
678 | _UC_ATTRIBUTE_PURE; | - |
679 | extern size_t | - |
680 | u16_strspn (const uint16_t *str, const uint16_t *accept) | - |
681 | _UC_ATTRIBUTE_PURE; | - |
682 | extern size_t | - |
683 | u32_strspn (const uint32_t *str, const uint32_t *accept) | - |
684 | _UC_ATTRIBUTE_PURE; | - |
685 | | - |
686 | | - |
687 | | - |
688 | extern uint8_t * | - |
689 | u8_strpbrk (const uint8_t *str, const uint8_t *accept) | - |
690 | _UC_ATTRIBUTE_PURE; | - |
691 | extern uint16_t * | - |
692 | u16_strpbrk (const uint16_t *str, const uint16_t *accept) | - |
693 | _UC_ATTRIBUTE_PURE; | - |
694 | extern uint32_t * | - |
695 | u32_strpbrk (const uint32_t *str, const uint32_t *accept) | - |
696 | _UC_ATTRIBUTE_PURE; | - |
697 | | - |
698 | | - |
699 | | - |
700 | extern uint8_t * | - |
701 | u8_strstr (const uint8_t *haystack, const uint8_t *needle) | - |
702 | _UC_ATTRIBUTE_PURE; | - |
703 | extern uint16_t * | - |
704 | u16_strstr (const uint16_t *haystack, const uint16_t *needle) | - |
705 | _UC_ATTRIBUTE_PURE; | - |
706 | extern uint32_t * | - |
707 | u32_strstr (const uint32_t *haystack, const uint32_t *needle) | - |
708 | _UC_ATTRIBUTE_PURE; | - |
709 | | - |
710 | | - |
711 | extern bool | - |
712 | u8_startswith (const uint8_t *str, const uint8_t *prefix) | - |
713 | _UC_ATTRIBUTE_PURE; | - |
714 | extern bool | - |
715 | u16_startswith (const uint16_t *str, const uint16_t *prefix) | - |
716 | _UC_ATTRIBUTE_PURE; | - |
717 | extern bool | - |
718 | u32_startswith (const uint32_t *str, const uint32_t *prefix) | - |
719 | _UC_ATTRIBUTE_PURE; | - |
720 | | - |
721 | | - |
722 | extern bool | - |
723 | u8_endswith (const uint8_t *str, const uint8_t *suffix) | - |
724 | _UC_ATTRIBUTE_PURE; | - |
725 | extern bool | - |
726 | u16_endswith (const uint16_t *str, const uint16_t *suffix) | - |
727 | _UC_ATTRIBUTE_PURE; | - |
728 | extern bool | - |
729 | u32_endswith (const uint32_t *str, const uint32_t *suffix) | - |
730 | _UC_ATTRIBUTE_PURE; | - |
731 | | - |
732 | | - |
733 | | - |
734 | | - |
735 | extern uint8_t * | - |
736 | u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr); | - |
737 | extern uint16_t * | - |
738 | u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr); | - |
739 | extern uint32_t * | - |
740 | u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr); | - |
741 | | - |
742 | | - |
743 | #ifdef __cplusplus | - |
744 | } | - |
745 | #endif | - |
746 | | - |
747 | #endif /* _UNISTR_H */ | - |
| | |