AVR-LibC  2.2.0
Standard C library for AVR-GCC
 

AVR-LibC Documentation

Logo

AVR-LibC Development Pages

Main Page

User Manual

Library Reference

FAQ

Example Projects

File List

Loading...
Searching...
No Matches
string.h
Go to the documentation of this file.
1/* Copyright (c) 2002,2007 Marek Michalkiewicz
2 All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
13 distribution.
14
15 * Neither the name of the copyright holders nor the names of
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE. */
30
31/* $Id$ */
32
33/*
34 string.h
35
36 Contributors:
37 Created by Marek Michalkiewicz <marekm@linux.org.pl>
38 */
39
40#ifndef _STRING_H_
41#define _STRING_H_ 1
42
43#ifndef __DOXYGEN__
44#define __need_NULL
45#define __need_size_t
46#include <stddef.h>
47
48#ifndef __ATTR_PURE__
49#define __ATTR_PURE__ __attribute__((__pure__))
50#endif
51
52#ifndef __ATTR_CONST__
53# define __ATTR_CONST__ __attribute__((__const__))
54#endif
55#endif /* !__DOXYGEN__ */
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61/** \file */
62/** \defgroup avr_string <string.h>: Strings
63 \code #include <string.h> \endcode
64
65 The string functions perform string operations on \c NULL terminated
66 strings.
67
68 \note If the strings you are working on resident in program space (flash),
69 you will need to use the string functions described in \ref avr_pgmspace. */
70
71
72/** \ingroup avr_string
73
74 This macro finds the first (least significant) bit set in the
75 input value.
76
77 This macro is very similar to the function ffs() except that
78 it evaluates its argument at compile-time, so it should only
79 be applied to compile-time constant expressions where it will
80 reduce to a constant itself.
81 Application of this macro to expressions that are not constant
82 at compile-time is not recommended, and might result in a huge
83 amount of code generated.
84
85 \returns The _FFS() macro returns the position of the first
86 (least significant) bit set in the word val, or 0 if no bits are set.
87 The least significant bit is position 1. Only 16 bits of argument
88 are evaluted.
89*/
90#if defined(__DOXYGEN__)
91#define _FFS(x)
92#else /* !DOXYGEN */
93#define _FFS(x) \
94 (1 \
95 + (((x) & 1) == 0) \
96 + (((x) & 3) == 0) \
97 + (((x) & 7) == 0) \
98 + (((x) & 017) == 0) \
99 + (((x) & 037) == 0) \
100 + (((x) & 077) == 0) \
101 + (((x) & 0177) == 0) \
102 + (((x) & 0377) == 0) \
103 + (((x) & 0777) == 0) \
104 + (((x) & 01777) == 0) \
105 + (((x) & 03777) == 0) \
106 + (((x) & 07777) == 0) \
107 + (((x) & 017777) == 0) \
108 + (((x) & 037777) == 0) \
109 + (((x) & 077777) == 0) \
110 - (((x) & 0177777) == 0) * 16)
111#endif /* DOXYGEN */
112
113/** \ingroup avr_string
114 \fn int ffs(int val);
115
116 \brief This function finds the first (least significant) bit set in the input value.
117
118 \returns The ffs() function returns the position of the first
119 (least significant) bit set in the word \p val, or 0 if no bits are set.
120 The least significant bit is position 1.
121
122 \note For expressions that are constant at compile time, consider
123 using the \ref _FFS macro instead.
124*/
125extern int ffs(int __val) __ATTR_CONST__;
126
127/** \ingroup avr_string
128 \fn int ffsl(long val);
129
130 \brief Same as ffs(), for an argument of type long. */
131extern int ffsl(long __val) __ATTR_CONST__;
132
133/** \ingroup avr_string
134 \fn int ffsll(long long val);
135
136 \brief Same as ffs(), for an argument of type <tt>long long</tt>. */
137__extension__ extern int ffsll(long long __val) __ATTR_CONST__;
138
139/** \ingroup avr_string
140 \fn void *memccpy(void *dest, const void *src, int val, size_t len)
141 \brief Copy memory area.
142
143 The memccpy() function copies no more than \p len bytes from memory
144 area \p src to memory area \p dest, stopping when the character \p val
145 is found.
146
147 \returns The memccpy() function returns a pointer to the next character
148 in \p dest after \p val, or \c NULL if \p val was not found in the first
149 \p len characters of \p src. */
150extern void *memccpy(void *, const void *, int, size_t);
151
152/** \ingroup avr_string
153 \fn void *memchr(const void *src, int val, size_t len)
154 \brief Scan memory for a character.
155
156 The memchr() function scans the first len bytes of the memory area pointed
157 to by src for the character val. The first byte to match val (interpreted
158 as an unsigned character) stops the operation.
159
160 \returns The memchr() function returns a pointer to the matching byte or
161 NULL if the character does not occur in the given memory area. */
162extern void *memchr(const void *, int, size_t) __ATTR_PURE__;
163
164/** \ingroup avr_string
165 \fn int memcmp(const void *s1, const void *s2, size_t len)
166 \brief Compare memory areas
167
168 The memcmp() function compares the first len bytes of the memory areas s1
169 and s2. The comparision is performed using unsigned char operations.
170
171 \returns The memcmp() function returns an integer less than, equal to, or
172 greater than zero if the first len bytes of s1 is found, respectively, to be
173 less than, to match, or be greater than the first len bytes of s2.
174
175 \note Be sure to store the result in a 16 bit variable since you may get
176 incorrect results if you use an unsigned char or char due to truncation.
177
178 \warning This function is not -mint8 compatible, although if you only care
179 about testing for equality, this function should be safe to use. */
180extern int memcmp(const void *, const void *, size_t) __ATTR_PURE__;
181
182/** \ingroup avr_string
183 \fn void *memcpy(void *dest, const void *src, size_t len)
184 \brief Copy a memory area.
185
186 The memcpy() function copies len bytes from memory area src to memory area
187 dest. The memory areas may not overlap. Use memmove() if the memory
188 areas do overlap.
189
190 \returns The memcpy() function returns a pointer to dest. */
191extern void *memcpy(void *, const void *, size_t);
192
193/** \ingroup avr_string
194 \fn void *memmem(const void *s1, size_t len1, const void *s2, size_t len2)
195
196 The memmem() function finds the start of the first occurrence of the
197 substring \p s2 of length \p len2 in the memory area \p s1 of length
198 \p len1.
199
200 \return The memmem() function returns a pointer to the beginning of
201 the substring, or \c NULL if the substring is not found. If \p len2
202 is zero, the function returns \p s1. */
203extern void *memmem(const void *, size_t, const void *, size_t) __ATTR_PURE__;
204
205/** \ingroup avr_string
206 \fn void *memmove(void *dest, const void *src, size_t len)
207 \brief Copy memory area.
208
209 The memmove() function copies len bytes from memory area src to memory area
210 dest. The memory areas may overlap.
211
212 \returns The memmove() function returns a pointer to dest. */
213extern void *memmove(void *, const void *, size_t);
214
215/** \ingroup avr_string
216 \fn void *memrchr(const void *src, int val, size_t len)
217
218 The memrchr() function is like the memchr() function, except that it
219 searches backwards from the end of the \p len bytes pointed to by \p
220 src instead of forwards from the front. (Glibc, GNU extension.)
221
222 \return The memrchr() function returns a pointer to the matching
223 byte or \c NULL if the character does not occur in the given memory
224 area. */
225extern void *memrchr(const void *, int, size_t) __ATTR_PURE__;
226
227/** \ingroup avr_string
228 \fn void *memset(void *dest, int val, size_t len)
229 \brief Fill memory with a constant byte.
230
231 The memset() function fills the first len bytes of the memory area pointed
232 to by dest with the constant byte val.
233
234 \returns The memset() function returns a pointer to the memory area dest. */
235extern void *memset(void *, int, size_t);
236
237/** \ingroup avr_string
238 \fn char *strcat(char *dest, const char *src)
239 \brief Concatenate two strings.
240
241 The strcat() function appends the src string to the dest string
242 overwriting the '\\0' character at the end of dest, and then adds a
243 terminating '\\0' character. The strings may not overlap, and the dest
244 string must have enough space for the result.
245
246 \returns The strcat() function returns a pointer to the resulting string
247 dest. */
248extern char *strcat(char *, const char *);
249
250/** \ingroup avr_string
251 \fn char *strchr(const char *src, int val)
252 \brief Locate character in string.
253
254 \returns The strchr() function returns a pointer to the first occurrence of
255 the character \p val in the string \p src, or \c NULL if the character
256 is not found.
257 <br><br>
258 Here "character" means "byte" -- these functions do not work with
259 wide or multi-byte characters. */
260extern char *strchr(const char *, int) __ATTR_PURE__;
261
262/** \ingroup avr_string
263 \fn char *strchrnul(const char *s, int c)
264
265 The strchrnul() function is like strchr() except that if \p c is not
266 found in \p s, then it returns a pointer to the null byte at the end
267 of \p s, rather than \c NULL. (Glibc, GNU extension.)
268
269 \return The strchrnul() function returns a pointer to the matched
270 character, or a pointer to the null byte at the end of \p s (i.e.,
271 \c s+strlen(s)) if the character is not found. */
272extern char *strchrnul(const char *, int) __ATTR_PURE__;
273
274/** \ingroup avr_string
275 \fn int strcmp(const char *s1, const char *s2)
276 \brief Compare two strings.
277
278 The strcmp() function compares the two strings \p s1 and \p s2.
279
280 \returns The strcmp() function returns an integer less than, equal
281 to, or greater than zero if \p s1 is found, respectively, to be less
282 than, to match, or be greater than \p s2. A consequence of the
283 ordering used by strcmp() is that if \p s1 is an initial substring
284 of \p s2, then \p s1 is considered to be "less than" \p s2. */
285extern int strcmp(const char *, const char *) __ATTR_PURE__;
286
287/** \ingroup avr_string
288 \fn char *strcpy(char *dest, const char *src)
289 \brief Copy a string.
290
291 The strcpy() function copies the string pointed to by src (including the
292 terminating '\\0' character) to the array pointed to by dest. The strings
293 may not overlap, and the destination string dest must be large enough to
294 receive the copy.
295
296 \returns The strcpy() function returns a pointer to the destination
297 string dest.
298
299 \note If the destination string of a strcpy() is not large enough (that
300 is, if the programmer was stupid/lazy, and failed to check the size before
301 copying) then anything might happen. Overflowing fixed length strings is
302 a favourite cracker technique. */
303extern char *strcpy(char *, const char *);
304
305/** \ingroup avr_string
306 \fn int strcasecmp(const char *s1, const char *s2)
307 \brief Compare two strings ignoring case.
308
309 The strcasecmp() function compares the two strings \p s1 and \p s2,
310 ignoring the case of the characters.
311
312 \returns The strcasecmp() function returns an integer less than,
313 equal to, or greater than zero if \p s1 is found, respectively, to
314 be less than, to match, or be greater than \p s2. A consequence of
315 the ordering used by strcasecmp() is that if \p s1 is an initial
316 substring of \p s2, then \p s1 is considered to be "less than"
317 \p s2. */
318extern int strcasecmp(const char *, const char *) __ATTR_PURE__;
319
320/** \ingroup avr_string
321 \fn char *strcasestr(const char *s1, const char *s2)
322
323 The strcasestr() function finds the first occurrence of the
324 substring \p s2 in the string \p s1. This is like strstr(), except
325 that it ignores case of alphabetic symbols in searching for the
326 substring. (Glibc, GNU extension.)
327
328 \return The strcasestr() function returns a pointer to the beginning
329 of the substring, or \c NULL if the substring is not found. If \p s2
330 points to a string of zero length, the function returns \p s1. */
331extern char *strcasestr(const char *, const char *) __ATTR_PURE__;
332
333/** \ingroup avr_string
334 \fn size_t strcspn(const char *s, const char *reject)
335
336 The strcspn() function calculates the length of the initial segment
337 of \p s which consists entirely of characters not in \p reject.
338
339 \return The strcspn() function returns the number of characters in
340 the initial segment of \p s which are not in the string \p reject.
341 The terminating zero is not considered as a part of string. */
342extern size_t strcspn(const char *__s, const char *__reject) __ATTR_PURE__;
343
344/** \ingroup avr_string
345 \fn char *strdup(const char *s1)
346 \brief Duplicate a string.
347
348 The strdup() function allocates memory and copies into it the string
349 addressed by \p s1, including the terminating null character.
350
351 \warning The strdup() function calls malloc() to allocate the memory
352 for the duplicated string! The user is responsible for freeing the
353 memory by calling free().
354
355 \returns The strdup() function returns a pointer to the resulting string
356 dest. If malloc() cannot allocate enough storage for the string, strdup()
357 will return \c NULL.
358
359 \warning Be sure to check the return value of the strdup() function to
360 make sure that the function has succeeded in allocating the memory!
361*/
362extern char *strdup(const char *s1);
363
364/** \ingroup avr_string
365 \fn char *strndup(const char *s, size_t len)
366 \brief Duplicate a string.
367
368 The strndup() function is similar to strdup(), but copies at most
369 \p len bytes. If \p s is longer than \p len, only \p len bytes are copied,
370 and a terminating null byte (<tt>'\0'</tt>) is added.
371
372 Memory for the new string is obtained with malloc(), and can be freed
373 with free().
374
375 \returns The strndup() function returns the location of the newly malloc'ed
376 memory, or \c NULL if the allocation failed.
377*/
378extern char *strndup(const char *s, size_t n);
379
380/** \ingroup avr_string
381 \fn size_t strlcat(char *dst, const char *src, size_t siz)
382 \brief Concatenate two strings.
383
384 Appends \p src to string \p dst of size \p siz (unlike strncat(),
385 \p siz is the full size of \p dst, not space left). At most \p siz-1
386 characters will be copied. Always \p '\\0' terminated (unless \p siz <=
387 \p strlen(dst)).
388
389 \returns The strlcat() function returns strlen(src) + MIN(siz,
390 strlen(initial dst)). If retval >= siz, truncation occurred. */
391extern size_t strlcat(char *, const char *, size_t);
392
393/** \ingroup avr_string
394 \fn size_t strlcpy(char *dst, const char *src, size_t siz)
395 \brief Copy a string.
396
397 Copy \p src to string \p dst of size \p siz. At most \p siz-1
398 characters will be copied. Always '\\0' terminated (unless \p siz == 0).
399
400 \returns The strlcpy() function returns strlen(src). If retval >= siz,
401 truncation occurred. */
402extern size_t strlcpy(char *, const char *, size_t);
403
404/** \ingroup avr_string
405 \fn size_t strlen(const char *src)
406 \brief Calculate the length of a string.
407
408 The strlen() function calculates the length of the string \p src, not
409 including the terminating '\\0' character.
410
411 \returns The strlen() function returns the number of characters in
412 \p src. */
413extern size_t strlen(const char *) __ATTR_PURE__;
414
415/** \ingroup avr_string
416 \fn char *strlwr(char *s)
417 \brief Convert a string to lower case.
418
419 The strlwr() function will convert a string to lower case. Only the upper
420 case alphabetic characters [A .. Z] are converted. Non-alphabetic
421 characters will not be changed.
422
423 \returns The strlwr() function returns a pointer to the converted
424 string. Conversion is perfomed in-place. */
425extern char *strlwr(char *);
426
427/** \ingroup avr_string
428 \fn char *strncat(char *dest, const char *src, size_t len)
429 \brief Concatenate two strings.
430
431 The strncat() function is similar to strcat(), except that only the first
432 \p len characters of \p src are appended to \p dest.
433
434 \returns The strncat() function returns a pointer to the resulting string
435 \p dest. */
436extern char *strncat(char *, const char *, size_t);
437
438/** \ingroup avr_string
439 \fn int strncmp(const char *s1, const char *s2, size_t len)
440 \brief Compare two strings.
441
442 The strncmp() function is similar to strcmp(), except it only compares the
443 first (at most) \p len characters of \p s1 and \p s2.
444
445 \returns The strncmp() function returns an integer less than, equal to, or
446 greater than zero if \p s1 (or the first \p len bytes thereof) is found,
447 respectively, to be less than, to match, or be greater than \p s2. */
448extern int strncmp(const char *, const char *, size_t) __ATTR_PURE__;
449
450/** \ingroup avr_string
451 \fn char *strncpy(char *dest, const char *src, size_t len)
452 \brief Copy a string.
453
454 The strncpy() function is similar to strcpy(), except that not more than
455 \p len bytes of \p src are copied. Thus, if there is no null byte among
456 the first \p len bytes of \p src, the result will not be null-terminated.
457
458 In the case where the length of \p src is less than that of \p len,
459 the remainder of \p dest will be padded with nulls (<tt>'\0'</tt>).
460
461 \returns The strncpy() function returns a pointer to the destination
462 string \p dest. */
463extern char *strncpy(char *, const char *, size_t);
464
465/** \ingroup avr_string
466 \fn int strncasecmp(const char *s1, const char *s2, size_t len)
467 \brief Compare two strings ignoring case.
468
469 The strncasecmp() function is similar to strcasecmp(), except it
470 only compares the first \p len characters of \p s1.
471
472 \returns The strncasecmp() function returns an integer less than,
473 equal to, or greater than zero if \p s1 (or the first \p len bytes
474 thereof) is found, respectively, to be less than, to match, or be
475 greater than \p s2. A consequence of the ordering used by
476 strncasecmp() is that if \p s1 is an initial substring of \p s2,
477 then \p s1 is considered to be "less than" \p s2. */
478extern int strncasecmp(const char *, const char *, size_t) __ATTR_PURE__;
479
480/** \ingroup avr_string
481 \fn size_t strnlen(const char *src, size_t len)
482 \brief Determine the length of a fixed-size string.
483
484 The strnlen() function returns the number of characters in the string
485 pointed to by \p src, not including the terminating '\\0' character, but at
486 most \p len. In doing this, strnlen() looks only at the first \p len
487 characters at \p src and never beyond \p src + \p len.
488
489 \returns The strnlen function returns strlen(src), if that is less than
490 \p len, or \p len if there is no '\\0' character among the first \p len
491 characters pointed to by \p src. */
492extern size_t strnlen(const char *, size_t) __ATTR_PURE__;
493
494/** \ingroup avr_string
495 \fn char *strpbrk(const char *s, const char *accept)
496
497 The strpbrk() function locates the first occurrence in the string
498 \p s of any of the characters in the string \p accept.
499
500 \return The strpbrk() function returns a pointer to the character
501 in \p s that matches one of the characters in \p accept, or \c NULL
502 if no such character is found. The terminating zero is not
503 considered as a part of string: if one or both args are empty, the
504 result will be \c NULL. */
505extern char *strpbrk(const char *__s, const char *__accept) __ATTR_PURE__;
506
507/** \ingroup avr_string
508 \fn char *strrchr(const char *src, int val)
509 \brief Locate character in string.
510
511 The strrchr() function returns a pointer to the last occurrence of the
512 character val in the string src.
513
514 Here "character" means "byte" -- these functions do not work with wide or
515 multi-byte characters.
516
517 \returns The strrchr() function returns a pointer to the matched character
518 or \c NULL if the character is not found. */
519extern char *strrchr(const char *, int) __ATTR_PURE__;
520
521/** \ingroup avr_string
522 \fn char *strrev(char *s)
523 \brief Reverse a string.
524
525 The strrev() function reverses the order of the string.
526
527 \returns The strrev() function returns a pointer to the beginning of the
528 reversed string. */
529extern char *strrev(char *);
530
531/** \ingroup avr_string
532 \fn char *strsep(char **sp, const char *delim)
533 \brief Parse a string into tokens.
534
535 The strsep() function locates, in the string referenced by \p *sp,
536 the first occurrence of any character in the string \p delim (or the
537 terminating '\\0' character) and replaces it with a '\\0'. The
538 location of the next character after the delimiter character (or \c
539 NULL, if the end of the string was reached) is stored in \p *sp. An
540 ``empty'' field, i.e. one caused by two adjacent delimiter
541 characters, can be detected by comparing the location referenced by
542 the pointer returned in \p *sp to '\\0'.
543
544 \return The strsep() function returns a pointer to the original
545 value of \p *sp. If \p *sp is initially \c NULL, strsep() returns
546 \c NULL. */
547extern char *strsep(char **, const char *);
548
549/** \ingroup avr_string
550 \fn size_t strspn(const char *s, const char *accept)
551
552 The strspn() function calculates the length of the initial segment
553 of \p s which consists entirely of characters in \p accept.
554
555 \return The strspn() function returns the number of characters in
556 the initial segment of \p s which consist only of characters from \p
557 accept. The terminating zero is not considered as a part of string. */
558extern size_t strspn(const char *__s, const char *__accept) __ATTR_PURE__;
559
560/** \ingroup avr_string
561 \fn char *strstr(const char *s1, const char *s2)
562 \brief Locate a substring.
563
564 The strstr() function finds the first occurrence of the substring \p
565 s2 in the string \p s1. The terminating '\\0' characters are not
566 compared.
567
568 \returns The strstr() function returns a pointer to the beginning of
569 the substring, or \c NULL if the substring is not found. If \p s2
570 points to a string of zero length, the function returns \p s1. */
571extern char *strstr(const char *, const char *) __ATTR_PURE__;
572
573/** \ingroup avr_string
574 \fn char *strtok(char *s, const char *delim)
575 \brief Parses the string s into tokens.
576
577 strtok parses the string s into tokens. The first call to strtok
578 should have s as its first argument. Subsequent calls should have
579 the first argument set to \c NULL. If a token ends with a delimiter, this
580 delimiting character is overwritten with a '\\0' and a pointer to the next
581 character is saved for the next call to strtok. The delimiter string
582 delim may be different for each call.
583
584 \returns The strtok() function returns a pointer to the next token or
585 \c NULL when no more tokens are found.
586
587 \note strtok() is NOT reentrant. For a reentrant version of this function
588 see \c strtok_r().
589*/
590extern char *strtok(char *, const char *);
591
592/** \ingroup avr_string
593 \fn char *strtok_r(char *string, const char *delim, char **last)
594 \brief Parses string into tokens.
595
596 strtok_r parses string into tokens. The first call to strtok_r
597 should have string as its first argument. Subsequent calls should have
598 the first argument set to \c NULL. If a token ends with a delimiter, this
599 delimiting character is overwritten with a '\\0' and a pointer to the next
600 character is saved for the next call to strtok_r. The delimiter string
601 \p delim may be different for each call. \p last is a user allocated char*
602 pointer. It must be the same while parsing the same string. strtok_r is
603 a reentrant version of strtok().
604
605 \returns The strtok_r() function returns a pointer to the next token or
606 \c NULL when no more tokens are found. */
607extern char *strtok_r(char *, const char *, char **);
608
609/** \ingroup avr_string
610 \fn char *strupr(char *s)
611 \brief Convert a string to upper case.
612
613 The strupr() function will convert a string to upper case. Only the lower
614 case alphabetic characters [a .. z] are converted. Non-alphabetic
615 characters will not be changed.
616
617 \returns The strupr() function returns a pointer to the converted
618 string. The pointer is the same as that passed in since the operation is
619 perform in place. */
620extern char *strupr(char *);
621
622#ifndef __DOXYGEN__
623/* libstdc++ compatibility, dummy declarations */
624extern int strcoll(const char *s1, const char *s2);
625extern char *strerror(int errnum);
626extern size_t strxfrm(char *dest, const char *src, size_t n);
627#endif /* !__DOXYGEN__ */
628
629#ifdef __cplusplus
630}
631#endif
632
633#endif /* _STRING_H_ */
634
int strncasecmp(const char *, const char *, size_t)
Compare two strings ignoring case.
void * memchr(const void *, int, size_t)
Scan memory for a character.
int memcmp(const void *, const void *, size_t)
Compare memory areas.
char * strlwr(char *)
Convert a string to lower case.
char * strstr(const char *, const char *)
Locate a substring.
char * strcat(char *, const char *)
Concatenate two strings.
size_t strlen(const char *)
Calculate the length of a string.
int strcmp(const char *, const char *)
Compare two strings.
char * strchrnul(const char *, int)
char * strpbrk(const char *__s, const char *__accept)
char * strrchr(const char *, int)
Locate character in string.
char * strcpy(char *, const char *)
Copy a string.
void * memcpy(void *, const void *, size_t)
Copy a memory area.
size_t strlcat(char *, const char *, size_t)
Concatenate two strings.
Definition: strlcat.c:50
size_t strlcpy(char *, const char *, size_t)
Copy a string.
Definition: strlcpy.c:49
char * strtok(char *, const char *)
Parses the string s into tokens.
Definition: strtok.c:41
int strncmp(const char *, const char *, size_t)
Compare two strings.
char * strncpy(char *, const char *, size_t)
Copy a string.
char * strdup(const char *s1)
Duplicate a string.
Definition: strdup.c:37
void * memmove(void *, const void *, size_t)
Copy memory area.
void * memccpy(void *, const void *, int, size_t)
Copy memory area.
void * memset(void *, int, size_t)
Fill memory with a constant byte.
int strcasecmp(const char *, const char *)
Compare two strings ignoring case.
char * strchr(const char *, int)
Locate character in string.
char * strupr(char *)
Convert a string to upper case.
int ffs(int __val)
This function finds the first (least significant) bit set in the input value.
char * strtok_r(char *, const char *, char **)
Parses string into tokens.
void * memrchr(const void *, int, size_t)
void * memmem(const void *, size_t, const void *, size_t)
char * strcasestr(const char *, const char *)
int ffsl(long __val)
Same as ffs(), for an argument of type long.
char * strrev(char *)
Reverse a string.
size_t strcspn(const char *__s, const char *__reject)
int ffsll(long long __val)
Same as ffs(), for an argument of type long long.
size_t strnlen(const char *, size_t)
Determine the length of a fixed-size string.
size_t strspn(const char *__s, const char *__accept)
char * strndup(const char *s, size_t n)
Duplicate a string.
Definition: strndup.c:34
char * strncat(char *, const char *, size_t)
Concatenate two strings.
char * strsep(char **, const char *)
Parse a string into tokens.