AVR Libc Home Page AVRs AVR Libc Development Pages
Main Page User Manual Reference FAQ Example Projects

string.h

Go to the documentation of this file.
01	1 Copyright (c) 2002,2007 Marek Michalkiewicz
	022All rights reserved.
	033
044Redistribution and use in source and binary forms, with or without 055modification, are permitted provided that the following conditions are met: 066 077* Redistributions of source code must retain the above copyright 088notice, this list of conditions and the following disclaimer. 099 1010* Redistributions in binary form must reproduce the above copyright 1111notice, this list of conditions and the following disclaimer in 1212the documentation and/or other materials provided with the 1313distribution. 1414 1515* Neither the name of the copyright holders nor the names of 1616contributors may be used to endorse or promote products derived 1717from this software without specific prior written permission. 1818 1919THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2020AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2121IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2222ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2323LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2424CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2525SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2626INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2727CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2828ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2929POSSIBILITY OF SUCH DAMAGE. */ 3030 3131/* $Id: string.h 2515 2016-02-08 22:46:42Z joerg_wunsch $ */ 3232 3333/* 3434string.h 3535 3636Contributors: 3737Created by Marek Michalkiewicz <marekm@linux.org.pl> 3838*/ 3939 4040#ifndef _STRING_H_ 4141#define _STRING_H_ 1 4242 4343#ifndef __DOXYGEN__ 4444#define __need_NULL 4545#define __need_size_t 4646#include <stddef.h> 4747 4848#ifndef __ATTR_PURE__ 4949#define __ATTR_PURE__ __attribute__((__pure__)) 5050#endif 5151 5252#ifndef __ATTR_CONST__ 5353# define __ATTR_CONST__ __attribute__((__const__)) 5454#endif 5555#endif /* !__DOXYGEN__ */ 5656 5757#ifdef __cplusplus 5858extern "C" { 5959#endif 6060 6161/** \file */ 6262/** \defgroup avr_string <string.h>: Strings 6363\code #include <string.h> \endcode 6464 6565The string functions perform string operations on NULL terminated 6666strings. 6767 6868\note If the strings you are working on resident in program space (flash), 6969you will need to use the string functions described in \ref avr_pgmspace. */ 7070 7171 7272/** \ingroup avr_string 7373 7474This macro finds the first (least significant) bit set in the 7575input value. 7676 7777This macro is very similar to the function ffs() except that 7878it evaluates its argument at compile-time, so it should only 7979be applied to compile-time constant expressions where it will 8080reduce to a constant itself. 8181Application of this macro to expressions that are not constant 8282at compile-time is not recommended, and might result in a huge 8383amount of code generated. 8484 8585\returns The _FFS() macro returns the position of the first 8686(least significant) bit set in the word val, or 0 if no bits are set. 8787The least significant bit is position 1. Only 16 bits of argument 8888are evaluted. 8989*/ 9090#if defined(__DOXYGEN__) 91 91#define _FFS(x) 9292#else /* !DOXYGEN */ 9393#define _FFS(x) \ 9494(1 \ 9595+ (((x) & 1) == 0) \ 9696+ (((x) & 3) == 0) \ 9797+ (((x) & 7) == 0) \ 9898+ (((x) & 017) == 0) \ 9999+ (((x) & 037) == 0) \ 100100+ (((x) & 077) == 0) \ 101101+ (((x) & 0177) == 0) \ 102102+ (((x) & 0377) == 0) \ 103103+ (((x) & 0777) == 0) \ 104104+ (((x) & 01777) == 0) \ 105105+ (((x) & 03777) == 0) \ 106106+ (((x) & 07777) == 0) \ 107107+ (((x) & 017777) == 0) \ 108108+ (((x) & 037777) == 0) \ 109109+ (((x) & 077777) == 0) \ 110110- (((x) & 0177777) == 0) * 16) 111111#endif /* DOXYGEN */ 112112 113113/** \ingroup avr_string 114114\fn int ffs(int val); 115115 116116\brief This function finds the first (least significant) bit set in the input value. 117117 118118\returns The ffs() function returns the position of the first 119119(least significant) bit set in the word val, or 0 if no bits are set. 120120The least significant bit is position 1. 121121 122122\note For expressions that are constant at compile time, consider 123123using the \ref _FFS macro instead. 124124*/ 125125extern int ffs(int __val) __ATTR_CONST__; 126126 127127/** \ingroup avr_string 128128\fn int ffsl(long val); 129129 130130\brief Same as ffs(), for an argument of type long. */ 131131extern int ffsl(long __val) __ATTR_CONST__; 132132 133133/** \ingroup avr_string 134134\fn int ffsll(long long val); 135135 136136\brief Same as ffs(), for an argument of type long long. */ 137137__extension__ extern int ffsll(long long __val) __ATTR_CONST__; 138138 139139/** \ingroup avr_string 140140\fn void *memccpy(void *dest, const void *src, int val, size_t len) 141141\brief Copy memory area. 142142 143143The memccpy() function copies no more than \p len bytes from memory 144144area \p src to memory area \p dest, stopping when the character \p val 145145is found. 146146 147147\returns The memccpy() function returns a pointer to the next character 148148in \p dest after \p val, or NULL if \p val was not found in the first 149149\p len characters of \p src. */ 150150extern void *memccpy(void *, const void *, int, size_t); 151151 152152/** \ingroup avr_string 153153\fn void *memchr(const void *src, int val, size_t len) 154154\brief Scan memory for a character. 155155 156156The memchr() function scans the first len bytes of the memory area pointed 157157to by src for the character val. The first byte to match val (interpreted 158158as an unsigned character) stops the operation. 159159 160160\returns The memchr() function returns a pointer to the matching byte or 161161NULL if the character does not occur in the given memory area. */ 162162extern void *memchr(const void *, int, size_t) __ATTR_PURE__; 163163 164164/** \ingroup avr_string 165165\fn int memcmp(const void *s1, const void *s2, size_t len) 166166\brief Compare memory areas 167167 168168The memcmp() function compares the first len bytes of the memory areas s1 169169and s2. The comparision is performed using unsigned char operations. 170170 171171\returns The memcmp() function returns an integer less than, equal to, or 172172greater than zero if the first len bytes of s1 is found, respectively, to be 173173less than, to match, or be greater than the first len bytes of s2. 174174 175175\note Be sure to store the result in a 16 bit variable since you may get 176176incorrect results if you use an unsigned char or char due to truncation. 177177 178178\warning This function is not -mint8 compatible, although if you only care 179179about testing for equality, this function should be safe to use. */ 180180 extern int memcmp(const void *, const void *, size_t) __ATTR_PURE__; 181181 182182/** \ingroup avr_string 183183\fn void *memcpy(void *dest, const void *src, size_t len) 184184\brief Copy a memory area. 185185 186186The memcpy() function copies len bytes from memory area src to memory area 187187dest. The memory areas may not overlap. Use memmove() if the memory 188188areas do overlap. 189189 190190\returns The memcpy() function returns a pointer to dest. */ 191191 extern void *memcpy(void *, const void *, size_t); 192192 193193/** \ingroup avr_string 194194\fn void *memmem(const void *s1, size_t len1, const void *s2, size_t len2) 195195 196196The memmem() function finds the start of the first occurrence of the 197197substring \p s2 of length \p len2 in the memory area \p s1 of length 198198\p len1. 199199 200200\return The memmem() function returns a pointer to the beginning of 201201the substring, or \c NULL if the substring is not found. If \p len2 202202is zero, the function returns \p s1. */ 203203 extern void *memmem(const void *, size_t, const void *, size_t) __ATTR_PURE__; 204204 205205/** \ingroup avr_string 206206\fn void *memmove(void *dest, const void *src, size_t len) 207207\brief Copy memory area. 208208 209209The memmove() function copies len bytes from memory area src to memory area 210210dest. The memory areas may overlap. 211211 212212\returns The memmove() function returns a pointer to dest. */ 213213 extern void *memmove(void *, const void *, size_t); 214214 215215/** \ingroup avr_string 216216\fn void *memrchr(const void *src, int val, size_t len) 217217 218218The memrchr() function is like the memchr() function, except that it 219219searches backwards from the end of the \p len bytes pointed to by \p 220220src instead of forwards from the front. (Glibc, GNU extension.) 221221 222222\return The memrchr() function returns a pointer to the matching 223223byte or \c NULL if the character does not occur in the given memory 224224area. */ 225225 extern void *memrchr(const void *, int, size_t) __ATTR_PURE__; 226226 227227/** \ingroup avr_string 228228\fn void *memset(void *dest, int val, size_t len) 229229\brief Fill memory with a constant byte. 230230 231231The memset() function fills the first len bytes of the memory area pointed 232232to by dest with the constant byte val. 233233 234234\returns The memset() function returns a pointer to the memory area dest. */ 235235 extern void *memset(void *, int, size_t); 236236 237237/** \ingroup avr_string 238238\fn char *strcat(char *dest, const char *src) 239239\brief Concatenate two strings. 240240 241241The strcat() function appends the src string to the dest string 242242overwriting the '\\0' character at the end of dest, and then adds a 243243terminating '\\0' character. The strings may not overlap, and the dest 244244string must have enough space for the result. 245245 246246\returns The strcat() function returns a pointer to the resulting string 247247dest. */ 248248 extern char *strcat(char *, const char *); 249249 250250/** \ingroup avr_string 251251\fn char *strchr(const char *src, int val) 252252\brief Locate character in string. 253253 254254The strchr() function returns a pointer to the first occurrence of 255255the character \p val in the string \p src. 256256 257257Here "character" means "byte" - these functions do not work with 258258wide or multi-byte characters. 259259 260260\returns The strchr() function returns a pointer to the matched 261261character or \c NULL if the character is not found. */ 262262 extern char *strchr(const char *, int) __ATTR_PURE__; 263263 264264/** \ingroup avr_string 265265\fn char *strchrnul(const char *s, int c) 266266 267267The strchrnul() function is like strchr() except that if \p c is not 268268found in \p s, then it returns a pointer to the null byte at the end 269269of \p s, rather than \c NULL. (Glibc, GNU extension.) 270270 271271\return The strchrnul() function returns a pointer to the matched 272272character, or a pointer to the null byte at the end of \p s (i.e., 273273\c s+strlen(s)) if the character is not found. */ 274274 extern char *strchrnul(const char *, int) __ATTR_PURE__; 275275 276276/** \ingroup avr_string 277277\fn int strcmp(const char *s1, const char *s2) 278278\brief Compare two strings. 279279 280280The strcmp() function compares the two strings \p s1 and \p s2. 281281 282282\returns The strcmp() function returns an integer less than, equal 283283to, or greater than zero if \p s1 is found, respectively, to be less 284284than, to match, or be greater than \p s2. A consequence of the 285285ordering used by strcmp() is that if \p s1 is an initial substring 286286of \p s2, then \p s1 is considered to be "less than" \p s2. */ 287287 extern int strcmp(const char *, const char *) __ATTR_PURE__; 288288 289289/** \ingroup avr_string 290290\fn char *strcpy(char *dest, const char *src) 291291\brief Copy a string. 292292 293293The strcpy() function copies the string pointed to by src (including the 294294terminating '\\0' character) to the array pointed to by dest. The strings 295295may not overlap, and the destination string dest must be large enough to 296296receive the copy. 297297 298298\returns The strcpy() function returns a pointer to the destination 299299string dest. 300300 301301\note If the destination string of a strcpy() is not large enough (that 302302is, if the programmer was stupid/lazy, and failed to check the size before 303303copying) then anything might happen. Overflowing fixed length strings is 304304a favourite cracker technique. */ 305305 extern char *strcpy(char *, const char *); 306306 307307/** \ingroup avr_string 308308\fn int strcasecmp(const char *s1, const char *s2) 309309\brief Compare two strings ignoring case. 310310 311311The strcasecmp() function compares the two strings \p s1 and \p s2, 312312ignoring the case of the characters. 313313 314314\returns The strcasecmp() function returns an integer less than, 315315equal to, or greater than zero if \p s1 is found, respectively, to 316316be less than, to match, or be greater than \p s2. A consequence of 317317the ordering used by strcasecmp() is that if \p s1 is an initial 318318substring of \p s2, then \p s1 is considered to be "less than" 319319\p s2. */ 320320 extern int strcasecmp(const char *, const char *) __ATTR_PURE__; 321321 322322/** \ingroup avr_string 323323\fn char *strcasestr(const char *s1, const char *s2) 324324 325325The strcasestr() function finds the first occurrence of the 326326substring \p s2 in the string \p s1. This is like strstr(), except 327327that it ignores case of alphabetic symbols in searching for the 328328substring. (Glibc, GNU extension.) 329329 330330\return The strcasestr() function returns a pointer to the beginning 331331of the substring, or \c NULL if the substring is not found. If \p s2 332332points to a string of zero length, the function returns \p s1. */ 333333 extern char *strcasestr(const char *, const char *) __ATTR_PURE__; 334334 335335/** \ingroup avr_string 336336\fn size_t strcspn(const char *s, const char *reject) 337337 338338The strcspn() function calculates the length of the initial segment 339339of \p s which consists entirely of characters not in \p reject. 340340 341341\return The strcspn() function returns the number of characters in 342342the initial segment of \p s which are not in the string \p reject. 343343The terminating zero is not considered as a part of string. */ 344344 extern size_t strcspn(const char *__s, const char *__reject) __ATTR_PURE__; 345345 346346/** \ingroup avr_string 347347\fn char *strdup(const char *s1) 348348\brief Duplicate a string. 349349 350350The strdup() function allocates memory and copies into it the string 351351addressed by s1, including the terminating null character. 352352 353353\warning The strdup() function calls malloc() to allocate the memory 354354for the duplicated string! The user is responsible for freeing the 355355memory by calling free(). 356356 357357\returns The strdup() function returns a pointer to the resulting string 358358dest. If malloc() cannot allocate enough storage for the string, strdup() 359359will return NULL. 360360 361361\warning Be sure to check the return value of the strdup() function to 362362make sure that the function has succeeded in allocating the memory! 363363*/ 364364 extern char *strdup(const char *s1); 365365 366366/** \ingroup avr_string 367367\fn size_t strlcat(char *dst, const char *src, size_t siz) 368368\brief Concatenate two strings. 369369 370370Appends \p src to string \p dst of size \p siz (unlike strncat(), 371371\p siz is the full size of \p dst, not space left). At most \p siz-1 372372characters will be copied. Always NULL terminates (unless \p siz <= 373373\p strlen(dst)). 374374 375375\returns The strlcat() function returns strlen(src) + MIN(siz, 376376strlen(initial dst)). If retval >> = siz, truncation occurred. */ 377377 extern size_t strlcat(char *, const char *, size_t); 378378 379379/** \ingroup avr_string 380380\fn size_t strlcpy(char *dst, const char *src, size_t siz) 381381\brief Copy a string. 382382 383383Copy \p src to string \p dst of size \p siz. At most \p siz-1 384384characters will be copied. Always NULL terminates (unless \p siz == 0). 385385 386386\returns The strlcpy() function returns strlen(src). If retval >> = siz, 387387truncation occurred. */ 388388 extern size_t strlcpy(char *, const char *, size_t); 389389 390390/** \ingroup avr_string 391391\fn size_t strlen(const char *src) 392392\brief Calculate the length of a string. 393393 394394The strlen() function calculates the length of the string src, not 395395including the terminating '\\0' character. 396396 397397\returns The strlen() function returns the number of characters in 398398src. */ 399399 extern size_t strlen(const char *) __ATTR_PURE__; 400400 401401/** \ingroup avr_string 402402\fn char *strlwr(char *s) 403403\brief Convert a string to lower case. 404404 405405The strlwr() function will convert a string to lower case. Only the upper 406406case alphabetic characters [A .. Z] are converted. Non-alphabetic 407407characters will not be changed. 408408 409409\returns The strlwr() function returns a pointer to the converted 410410string. */ 411411 extern char *strlwr(char *); 412412 413413/** \ingroup avr_string 414414\fn char *strncat(char *dest, const char *src, size_t len) 415415\brief Concatenate two strings. 416416 417417The strncat() function is similar to strcat(), except that only the first 418418n characters of src are appended to dest. 419419 420420\returns The strncat() function returns a pointer to the resulting string 421421dest. */ 422422 extern char *strncat(char *, const char *, size_t); 423423 424424/** \ingroup avr_string 425425\fn int strncmp(const char *s1, const char *s2, size_t len) 426426\brief Compare two strings. 427427 428428The strncmp() function is similar to strcmp(), except it only compares the 429429first (at most) n characters of s1 and s2. 430430 431431\returns The strncmp() function returns an integer less than, equal to, or 432432greater than zero if s1 (or the first n bytes thereof) is found, 433433respectively, to be less than, to match, or be greater than s2. */ 434434 extern int strncmp(const char *, const char *, size_t) __ATTR_PURE__; 435435 436436/** \ingroup avr_string 437437\fn char *strncpy(char *dest, const char *src, size_t len) 438438\brief Copy a string. 439439 440440The strncpy() function is similar to strcpy(), except that not more than n 441441bytes of src are copied. Thus, if there is no null byte among the first n 442442bytes of src, the result will not be null-terminated. 443443 444444In the case where the length of src is less than that of n, the remainder 445445of dest will be padded with nulls. 446446 447447\returns The strncpy() function returns a pointer to the destination 448448string dest. */ 449449 extern char *strncpy(char *, const char *, size_t); 450450 451451/** \ingroup avr_string 452452\fn int strncasecmp(const char *s1, const char *s2, size_t len) 453453\brief Compare two strings ignoring case. 454454 455455The strncasecmp() function is similar to strcasecmp(), except it 456456only compares the first \p len characters of \p s1. 457457 458458\returns The strncasecmp() function returns an integer less than, 459459equal to, or greater than zero if \p s1 (or the first \p len bytes 460460thereof) is found, respectively, to be less than, to match, or be 461461greater than \p s2. A consequence of the ordering used by 462462strncasecmp() is that if \p s1 is an initial substring of \p s2, 463463then \p s1 is considered to be "less than" \p s2. */ 464464 extern int strncasecmp(const char *, const char *, size_t) __ATTR_PURE__; 465465 466466/** \ingroup avr_string 467467\fn size_t strnlen(const char *src, size_t len) 468468\brief Determine the length of a fixed-size string. 469469 470470The strnlen function returns the number of characters in the string 471471pointed to by src, not including the terminating '\\0' character, but at 472472most len. In doing this, strnlen looks only at the first len characters at 473473src and never beyond src+len. 474474 475475\returns The strnlen function returns strlen(src), if that is less than 476476len, or len if there is no '\\0' character among the first len 477477characters pointed to by src. */ 478478 extern size_t strnlen(const char *, size_t) __ATTR_PURE__; 479479 480480/** \ingroup avr_string 481481\fn char *strpbrk(const char *s, const char *accept) 482482 483483The strpbrk() function locates the first occurrence in the string 484484\p s of any of the characters in the string \p accept. 485485 486486\return The strpbrk() function returns a pointer to the character 487487in \p s that matches one of the characters in \p accept, or \c NULL 488488if no such character is found. The terminating zero is not 489489considered as a part of string: if one or both args are empty, the 490490result will be \c NULL. */ 491491 extern char *strpbrk(const char *__s, const char *__accept) __ATTR_PURE__; 492492 493493/** \ingroup avr_string 494494\fn char *strrchr(const char *src, int val) 495495\brief Locate character in string. 496496 497497The strrchr() function returns a pointer to the last occurrence of the 498498character val in the string src. 499499 500500Here "character" means "byte" - these functions do not work with wide or 501501multi-byte characters. 502502 503503\returns The strrchr() function returns a pointer to the matched character 504504or NULL if the character is not found. */ 505505 extern char *strrchr(const char *, int) __ATTR_PURE__; 506506 507507/** \ingroup avr_string 508508\fn char *strrev(char *s) 509509\brief Reverse a string. 510510 511511The strrev() function reverses the order of the string. 512512 513513\returns The strrev() function returns a pointer to the beginning of the 514514reversed string. */ 515515 extern char *strrev(char *); 516516 517517/** \ingroup avr_string 518518\fn char *strsep(char **sp, const char *delim) 519519\brief Parse a string into tokens. 520520 521521The strsep() function locates, in the string referenced by \p *sp, 522522the first occurrence of any character in the string \p delim (or the 523523terminating '\\0' character) and replaces it with a '\\0'. The 524524location of the next character after the delimiter character (or \c 525525NULL, if the end of the string was reached) is stored in \p *sp. An 526526``empty'' field, i.e. one caused by two adjacent delimiter 527527characters, can be detected by comparing the location referenced by 528528the pointer returned in \p *sp to '\\0'. 529529 530530\return The strsep() function returns a pointer to the original 531531value of \p *sp. If \p *sp is initially \c NULL, strsep() returns 532532\c NULL. */ 533533 extern char *strsep(char **, const char *); 534534 535535/** \ingroup avr_string 536536\fn size_t strspn(const char *s, const char *accept) 537537 538538The strspn() function calculates the length of the initial segment 539539of \p s which consists entirely of characters in \p accept. 540540 541541\return The strspn() function returns the number of characters in 542542the initial segment of \p s which consist only of characters from \p 543543accept. The terminating zero is not considered as a part of string. */ 544544 extern size_t strspn(const char *__s, const char *__accept) __ATTR_PURE__; 545545 546546/** \ingroup avr_string 547547\fn char *strstr(const char *s1, const char *s2) 548548\brief Locate a substring. 549549 550550The strstr() function finds the first occurrence of the substring \p 551551s2 in the string \p s1. The terminating '\\0' characters are not 552552compared. 553553 554554\returns The strstr() function returns a pointer to the beginning of 555555the substring, or \c NULL if the substring is not found. If \p s2 556556points to a string of zero length, the function returns \p s1. */ 557557 extern char *strstr(const char *, const char *) __ATTR_PURE__; 558558 559559/** \ingroup avr_string 560560\fn char *strtok(char *s, const char *delim) 561561\brief Parses the string s into tokens. 562562 563563strtok parses the string s into tokens. The first call to strtok 564564should have s as its first argument. Subsequent calls should have 565565the first argument set to NULL. If a token ends with a delimiter, this 566566delimiting character is overwritten with a '\\0' and a pointer to the next 567567character is saved for the next call to strtok. The delimiter string 568568delim may be different for each call. 569569 570570\returns The strtok() function returns a pointer to the next token or 571571NULL when no more tokens are found. 572572 573573\note strtok() is NOT reentrant. For a reentrant version of this function 574574see \c strtok_r(). 575575*/ 576576 extern char *strtok(char *, const char *); 577577 578578/** \ingroup avr_string 579579\fn char *strtok_r(char *string, const char *delim, char **last) 580580\brief Parses string into tokens. 581581 582582strtok_r parses string into tokens. The first call to strtok_r 583583should have string as its first argument. Subsequent calls should have 584584the first argument set to NULL. If a token ends with a delimiter, this 585585delimiting character is overwritten with a '\\0' and a pointer to the next 586586character is saved for the next call to strtok_r. The delimiter string 587587\p delim may be different for each call. \p last is a user allocated char* 588588pointer. It must be the same while parsing the same string. strtok_r is 589589a reentrant version of strtok(). 590590 591591\returns The strtok_r() function returns a pointer to the next token or 592592NULL when no more tokens are found. */ 593593 extern char *strtok_r(char *, const char *, char **); 594594 595595/** \ingroup avr_string 596596\fn char *strupr(char *s) 597597\brief Convert a string to upper case. 598598 599599The strupr() function will convert a string to upper case. Only the lower 600600case alphabetic characters [a .. z] are converted. Non-alphabetic 601601characters will not be changed. 602602 603603\returns The strupr() function returns a pointer to the converted 604604string. The pointer is the same as that passed in since the operation is 605605perform in place. */ 606606 extern char *strupr(char *); 607607 608608#ifndef __DOXYGEN__ 609609/* libstdc++ compatibility, dummy declarations */ 610610extern int strcoll(const char *s1, const char *s2); 611611extern char *strerror(int errnum); 612612extern size_t strxfrm(char *dest, const char *src, size_t n); 613613#endif /* !__DOXYGEN__ */ 614614 615615#ifdef __cplusplus 616616} 617617#endif 618618 619619#endif /* _STRING_H_ */ 620620

memmem void * memmem(const void *, size_t, const void *, size_t) __ATTR_PURE__

memmove void * memmove(void *, const void *, size_t) Copy memory area.

strsep char * strsep(char **, const char *) Parse a string into tokens.

strstr char * strstr(const char *, const char *) __ATTR_PURE__ Locate a substring.

strlwr char * strlwr(char *) Convert a string to lower case.

memcpy void * memcpy(void *, const void *, size_t) Copy a memory area.

strnlen size_t strnlen(const char *, size_t) __ATTR_PURE__ Determine the length of a fixed-size string.

strpbrk char * strpbrk(const char *__s, const char *__accept) __ATTR_PURE__

strncmp int strncmp(const char *, const char *, size_t) __ATTR_PURE__ Compare two strings.

strncasecmp int strncasecmp(const char *, const char *, size_t) __ATTR_PURE__ Compare two strings ignoring case.

memset void * memset(void *, int, size_t) Fill memory with a constant byte.

strcasecmp int strcasecmp(const char *, const char *) __ATTR_PURE__ Compare two strings ignoring case.

strncat char * strncat(char *, const char *, size_t) Concatenate two strings.

strlcpy size_t strlcpy(char *, const char *, size_t) Copy a string.> Definition: strlcpy.c:49

strtok char * strtok(char *, const char *) Parses the string s into tokens.> Definition: strtok.c:41

strchr char * strchr(const char *, int) __ATTR_PURE__ Locate character in string.

memcmp int memcmp(const void *, const void *, size_t) __ATTR_PURE__ Compare memory areas.

memchr void * memchr(const void *, int, size_t) __ATTR_PURE__ Scan memory for a character.

strchrnul char * strchrnul(const char *, int) __ATTR_PURE__

strlen size_t strlen(const char *) __ATTR_PURE__ Calculate the length of a string.

strrev char * strrev(char *) Reverse a string.

ffs int ffs(int __val) This function finds the first (least significant) bit set in the input value.

strcspn size_t strcspn(const char *__s, const char *__reject) __ATTR_PURE__

ffsl int ffsl(long __val) Same as ffs(), for an argument of type long.

memccpy void * memccpy(void *, const void *, int, size_t) Copy memory area.

strdup char * strdup(const char *s1) Duplicate a string.> Definition: strdup.c:37

strcasestr char * strcasestr(const char *, const char *) __ATTR_PURE__

ffsll __extension__ int ffsll(long long __val) Same as ffs(), for an argument of type long long.

strcmp int strcmp(const char *, const char *) __ATTR_PURE__ Compare two strings.

strupr char * strupr(char *) Convert a string to upper case.

memrchr void * memrchr(const void *, int, size_t) __ATTR_PURE__

strrchr char * strrchr(const char *, int) __ATTR_PURE__ Locate character in string.

strtok_r char * strtok_r(char *, const char *, char **) Parses string into tokens.

strcat char * strcat(char *, const char *) Concatenate two strings.

strspn size_t strspn(const char *__s, const char *__accept) __ATTR_PURE__

strcpy char * strcpy(char *, const char *) Copy a string.

strlcat size_t strlcat(char *, const char *, size_t) Concatenate two strings.> Definition: strlcat.c:50

strncpy char * strncpy(char *, const char *, size_t) Copy a string.