OpenCoverage

unistr.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/lib/unistr.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7extern const uint8_t *-
8 u8_check (const uint8_t *s, size_t n)-
9 __attribute__ ((__pure__));-
10-
11-
12-
13extern const uint16_t *-
14 u16_check (const uint16_t *s, size_t n)-
15 __attribute__ ((__pure__));-
16-
17-
18-
19extern const uint32_t *-
20 u32_check (const uint32_t *s, size_t n)-
21 __attribute__ ((__pure__));-
22-
23-
24-
25-
26-
27extern uint16_t *-
28 u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf,-
29 size_t *lengthp);-
30-
31-
32extern uint32_t *-
33 u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf,-
34 size_t *lengthp);-
35-
36-
37extern uint8_t *-
38 u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf,-
39 size_t *lengthp);-
40-
41-
42extern uint32_t *-
43 u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf,-
44 size_t *lengthp);-
45-
46-
47extern uint8_t *-
48 u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf,-
49 size_t *lengthp);-
50-
51-
52extern uint16_t *-
53 u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf,-
54 size_t *lengthp);-
55extern int-
56 u8_mblen (const uint8_t *s, size_t n)-
57 __attribute__ ((__pure__));-
58extern int-
59 u16_mblen (const uint16_t *s, size_t n)-
60 __attribute__ ((__pure__));-
61extern int-
62 u32_mblen (const uint32_t *s, size_t n)-
63 __attribute__ ((__pure__));-
64extern int-
65 u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);-
66extern int-
67 u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);-
68-
69-
70-
71-
72static inline int-
73u8_uctomb (uint8_t *s, ucs4_t uc, int n)-
74{-
75 if (uc < 0x80
uc < 0x80Description
TRUEnever evaluated
FALSEnever evaluated
&& n > 0
n > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
76 {-
77 s[0] = uc;-
78 return
never executed: return 1;
1;
never executed: return 1;
0
79 }-
80 else-
81 return
never executed: return u8_uctomb_aux (s, uc, n);
u8_uctomb_aux (s, uc, n);
never executed: return u8_uctomb_aux (s, uc, n);
0
82}-
83extern uint8_t *-
84 u8_cpy (uint8_t *dest, const uint8_t *src, size_t n);-
85extern uint16_t *-
86 u16_cpy (uint16_t *dest, const uint16_t *src, size_t n);-
87extern uint32_t *-
88 u32_cpy (uint32_t *dest, const uint32_t *src, size_t n);-
89-
90-
91-
92-
93extern uint8_t *-
94 u8_move (uint8_t *dest, const uint8_t *src, size_t n);-
95extern uint16_t *-
96 u16_move (uint16_t *dest, const uint16_t *src, size_t n);-
97extern uint32_t *-
98 u32_move (uint32_t *dest, const uint32_t *src, size_t n);-
99-
100-
101-
102-
103extern uint8_t *-
104 u8_set (uint8_t *s, ucs4_t uc, size_t n);-
105extern uint16_t *-
106 u16_set (uint16_t *s, ucs4_t uc, size_t n);-
107extern uint32_t *-
108 u32_set (uint32_t *s, ucs4_t uc, size_t n);-
109-
110-
111-
112extern int-
113 u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n)-
114 __attribute__ ((__pure__));-
115extern int-
116 u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n)-
117 __attribute__ ((__pure__));-
118extern int-
119 u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n)-
120 __attribute__ ((__pure__));-
121-
122-
123-
124extern int-
125 u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2)-
126 __attribute__ ((__pure__));-
127extern int-
128 u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2)-
129 __attribute__ ((__pure__));-
130extern int-
131 u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2)-
132 __attribute__ ((__pure__));-
133-
134-
135-
136extern uint8_t *-
137 u8_chr (const uint8_t *s, size_t n, ucs4_t uc)-
138 __attribute__ ((__pure__));-
139extern uint16_t *-
140 u16_chr (const uint16_t *s, size_t n, ucs4_t uc)-
141 __attribute__ ((__pure__));-
142extern uint32_t *-
143 u32_chr (const uint32_t *s, size_t n, ucs4_t uc)-
144 __attribute__ ((__pure__));-
145-
146-
147-
148extern size_t-
149 u8_mbsnlen (const uint8_t *s, size_t n)-
150 __attribute__ ((__pure__));-
151extern size_t-
152 u16_mbsnlen (const uint16_t *s, size_t n)-
153 __attribute__ ((__pure__));-
154extern size_t-
155 u32_mbsnlen (const uint32_t *s, size_t n)-
156 __attribute__ ((__pure__));-
157-
158-
159-
160-
161extern uint8_t *-
162 u8_cpy_alloc (const uint8_t *s, size_t n);-
163extern uint16_t *-
164 u16_cpy_alloc (const uint16_t *s, size_t n);-
165extern uint32_t *-
166 u32_cpy_alloc (const uint32_t *s, size_t n);-
167-
168-
169-
170-
171-
172extern int-
173 u8_strmblen (const uint8_t *s)-
174 __attribute__ ((__pure__));-
175extern int-
176 u16_strmblen (const uint16_t *s)-
177 __attribute__ ((__pure__));-
178extern int-
179 u32_strmblen (const uint32_t *s)-
180 __attribute__ ((__pure__));-
181-
182-
183-
184-
185extern int-
186 u8_strmbtouc (ucs4_t *puc, const uint8_t *s);-
187extern int-
188 u16_strmbtouc (ucs4_t *puc, const uint16_t *s);-
189extern int-
190 u32_strmbtouc (ucs4_t *puc, const uint32_t *s);-
191-
192-
193-
194-
195extern const uint8_t *-
196 u8_next (ucs4_t *puc, const uint8_t *s);-
197extern const uint16_t *-
198 u16_next (ucs4_t *puc, const uint16_t *s);-
199extern const uint32_t *-
200 u32_next (ucs4_t *puc, const uint32_t *s);-
201-
202-
203-
204-
205extern const uint8_t *-
206 u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start);-
207extern const uint16_t *-
208 u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start);-
209extern const uint32_t *-
210 u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start);-
211-
212-
213-
214extern size_t-
215 u8_strlen (const uint8_t *s)-
216 __attribute__ ((__pure__));-
217extern size_t-
218 u16_strlen (const uint16_t *s)-
219 __attribute__ ((__pure__));-
220extern size_t-
221 u32_strlen (const uint32_t *s)-
222 __attribute__ ((__pure__));-
223-
224-
225-
226extern size_t-
227 u8_strnlen (const uint8_t *s, size_t maxlen)-
228 __attribute__ ((__pure__));-
229extern size_t-
230 u16_strnlen (const uint16_t *s, size_t maxlen)-
231 __attribute__ ((__pure__));-
232extern size_t-
233 u32_strnlen (const uint32_t *s, size_t maxlen)-
234 __attribute__ ((__pure__));-
235-
236-
237-
238extern uint8_t *-
239 u8_strcpy (uint8_t *dest, const uint8_t *src);-
240extern uint16_t *-
241 u16_strcpy (uint16_t *dest, const uint16_t *src);-
242extern uint32_t *-
243 u32_strcpy (uint32_t *dest, const uint32_t *src);-
244-
245-
246-
247extern uint8_t *-
248 u8_stpcpy (uint8_t *dest, const uint8_t *src);-
249extern uint16_t *-
250 u16_stpcpy (uint16_t *dest, const uint16_t *src);-
251extern uint32_t *-
252 u32_stpcpy (uint32_t *dest, const uint32_t *src);-
253-
254-
255-
256extern uint8_t *-
257 u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n);-
258extern uint16_t *-
259 u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n);-
260extern uint32_t *-
261 u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n);-
262-
263-
264-
265-
266extern uint8_t *-
267 u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n);-
268extern uint16_t *-
269 u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n);-
270extern uint32_t *-
271 u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n);-
272-
273-
274-
275extern uint8_t *-
276 u8_strcat (uint8_t *dest, const uint8_t *src);-
277extern uint16_t *-
278 u16_strcat (uint16_t *dest, const uint16_t *src);-
279extern uint32_t *-
280 u32_strcat (uint32_t *dest, const uint32_t *src);-
281-
282-
283-
284extern uint8_t *-
285 u8_strncat (uint8_t *dest, const uint8_t *src, size_t n);-
286extern uint16_t *-
287 u16_strncat (uint16_t *dest, const uint16_t *src, size_t n);-
288extern uint32_t *-
289 u32_strncat (uint32_t *dest, const uint32_t *src, size_t n);-
290extern int-
291 u8_strcmp (const uint8_t *s1, const uint8_t *s2)-
292 __attribute__ ((__pure__));-
293-
294extern int-
295 u16_strcmp (const uint16_t *s1, const uint16_t *s2)-
296 __attribute__ ((__pure__));-
297extern int-
298 u32_strcmp (const uint32_t *s1, const uint32_t *s2)-
299 __attribute__ ((__pure__));-
300-
301-
302-
303-
304-
305extern int-
306 u8_strcoll (const uint8_t *s1, const uint8_t *s2);-
307extern int-
308 u16_strcoll (const uint16_t *s1, const uint16_t *s2);-
309extern int-
310 u32_strcoll (const uint32_t *s1, const uint32_t *s2);-
311-
312-
313-
314extern int-
315 u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n)-
316 __attribute__ ((__pure__));-
317extern int-
318 u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n)-
319 __attribute__ ((__pure__));-
320extern int-
321 u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n)-
322 __attribute__ ((__pure__));-
323-
324-
325-
326extern uint8_t *-
327 u8_strdup (const uint8_t *s);-
328extern uint16_t *-
329 u16_strdup (const uint16_t *s);-
330extern uint32_t *-
331 u32_strdup (const uint32_t *s);-
332-
333-
334-
335extern uint8_t *-
336 u8_strchr (const uint8_t *str, ucs4_t uc)-
337 __attribute__ ((__pure__));-
338extern uint16_t *-
339 u16_strchr (const uint16_t *str, ucs4_t uc)-
340 __attribute__ ((__pure__));-
341extern uint32_t *-
342 u32_strchr (const uint32_t *str, ucs4_t uc)-
343 __attribute__ ((__pure__));-
344-
345-
346-
347extern uint8_t *-
348 u8_strrchr (const uint8_t *str, ucs4_t uc)-
349 __attribute__ ((__pure__));-
350extern uint16_t *-
351 u16_strrchr (const uint16_t *str, ucs4_t uc)-
352 __attribute__ ((__pure__));-
353extern uint32_t *-
354 u32_strrchr (const uint32_t *str, ucs4_t uc)-
355 __attribute__ ((__pure__));-
356-
357-
358-
359-
360extern size_t-
361 u8_strcspn (const uint8_t *str, const uint8_t *reject)-
362 __attribute__ ((__pure__));-
363extern size_t-
364 u16_strcspn (const uint16_t *str, const uint16_t *reject)-
365 __attribute__ ((__pure__));-
366extern size_t-
367 u32_strcspn (const uint32_t *str, const uint32_t *reject)-
368 __attribute__ ((__pure__));-
369-
370-
371-
372-
373extern size_t-
374 u8_strspn (const uint8_t *str, const uint8_t *accept)-
375 __attribute__ ((__pure__));-
376extern size_t-
377 u16_strspn (const uint16_t *str, const uint16_t *accept)-
378 __attribute__ ((__pure__));-
379extern size_t-
380 u32_strspn (const uint32_t *str, const uint32_t *accept)-
381 __attribute__ ((__pure__));-
382-
383-
384-
385extern uint8_t *-
386 u8_strpbrk (const uint8_t *str, const uint8_t *accept)-
387 __attribute__ ((__pure__));-
388extern uint16_t *-
389 u16_strpbrk (const uint16_t *str, const uint16_t *accept)-
390 __attribute__ ((__pure__));-
391extern uint32_t *-
392 u32_strpbrk (const uint32_t *str, const uint32_t *accept)-
393 __attribute__ ((__pure__));-
394-
395-
396-
397extern uint8_t *-
398 u8_strstr (const uint8_t *haystack, const uint8_t *needle)-
399 __attribute__ ((__pure__));-
400extern uint16_t *-
401 u16_strstr (const uint16_t *haystack, const uint16_t *needle)-
402 __attribute__ ((__pure__));-
403extern uint32_t *-
404 u32_strstr (const uint32_t *haystack, const uint32_t *needle)-
405 __attribute__ ((__pure__));-
406-
407-
408extern -
409 _Bool-
410 -
411 u8_startswith (const uint8_t *str, const uint8_t *prefix)-
412 __attribute__ ((__pure__));-
413extern -
414 _Bool-
415 -
416 u16_startswith (const uint16_t *str, const uint16_t *prefix)-
417 __attribute__ ((__pure__));-
418extern -
419 _Bool-
420 -
421 u32_startswith (const uint32_t *str, const uint32_t *prefix)-
422 __attribute__ ((__pure__));-
423-
424-
425extern -
426 _Bool-
427 -
428 u8_endswith (const uint8_t *str, const uint8_t *suffix)-
429 __attribute__ ((__pure__));-
430extern -
431 _Bool-
432 -
433 u16_endswith (const uint16_t *str, const uint16_t *suffix)-
434 __attribute__ ((__pure__));-
435extern -
436 _Bool-
437 -
438 u32_endswith (const uint32_t *str, const uint32_t *suffix)-
439 __attribute__ ((__pure__));-
440-
441-
442-
443-
444extern uint8_t *-
445 u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr);-
446extern uint16_t *-
447 u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr);-
448extern uint32_t *-
449 u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr);-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2