modernc.org/cc@v1.0.1/v2/headers/linux_arm/usr/include/string.h (about) 1 /* Copyright (C) 1991-2016 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * ISO C99 Standard: 7.21 String handling <string.h> 20 */ 21 22 #ifndef _STRING_H 23 #define _STRING_H 1 24 25 #include <features.h> 26 27 __BEGIN_DECLS 28 /* Get size_t and NULL from <stddef.h>. */ 29 #define __need_size_t 30 #define __need_NULL 31 #include <stddef.h> 32 /* Tell the caller that we provide correct C++ prototypes. */ 33 #if defined __cplusplus && __GNUC_PREREQ (4, 4) 34 #define __CORRECT_ISO_CPP_STRING_H_PROTO 35 #endif 36 __BEGIN_NAMESPACE_STD 37 /* Copy N bytes of SRC to DEST. */ 38 extern void *memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) 39 __THROW __nonnull((1, 2)); 40 /* Copy N bytes of SRC to DEST, guaranteeing 41 correct behavior for overlapping strings. */ 42 extern void *memmove(void *__dest, const void *__src, size_t __n) 43 __THROW __nonnull((1, 2)); 44 __END_NAMESPACE_STD 45 /* Copy no more than N bytes of SRC to DEST, stopping when C is found. 46 Return the position in DEST one byte past where C was copied, 47 or NULL if C was not found in the first N bytes of SRC. */ 48 #if defined __USE_MISC || defined __USE_XOPEN 49 extern void *memccpy(void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) 50 __THROW __nonnull((1, 2)); 51 #endif /* Misc || X/Open. */ 52 53 __BEGIN_NAMESPACE_STD 54 /* Set N bytes of S to C. */ 55 extern void *memset(void *__s, int __c, size_t __n) 56 __THROW __nonnull((1)); 57 58 /* Compare N bytes of S1 and S2. */ 59 extern int memcmp(const void *__s1, const void *__s2, size_t __n) 60 __THROW __attribute_pure__ __nonnull((1, 2)); 61 62 /* Search N bytes of S for C. */ 63 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 64 extern "C++" { 65 extern void *memchr(void *__s, int __c, size_t __n) 66 __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); 67 extern const void *memchr(const void *__s, int __c, size_t __n) 68 __THROW __asm("memchr") __attribute_pure__ __nonnull((1)); 69 70 #ifdef __OPTIMIZE__ 71 __extern_always_inline void *memchr(void *__s, int __c, size_t __n) __THROW 72 { 73 return __builtin_memchr(__s, __c, __n); 74 } 75 __extern_always_inline const void *memchr(const void *__s, int __c, size_t __n) __THROW { 76 return __builtin_memchr(__s, __c, __n); 77 } 78 #endif 79 } 80 #else 81 extern void *memchr(const void *__s, int __c, size_t __n) 82 __THROW __attribute_pure__ __nonnull((1)); 83 #endif 84 __END_NAMESPACE_STD 85 #ifdef __USE_GNU 86 /* Search in S for C. This is similar to `memchr' but there is no 87 length limit. */ 88 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 89 extern "C++" void *rawmemchr(void *__s, int __c) 90 __THROW __asm("rawmemchr") 91 __attribute_pure__ __nonnull((1)); 92 extern "C++" const void *rawmemchr(const void *__s, int __c) 93 __THROW __asm("rawmemchr") 94 __attribute_pure__ __nonnull((1)); 95 #else 96 extern void *rawmemchr(const void *__s, int __c) 97 __THROW __attribute_pure__ __nonnull((1)); 98 #endif 99 100 /* Search N bytes of S for the final occurrence of C. */ 101 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 102 extern "C++" void *memrchr(void *__s, int __c, size_t __n) 103 __THROW __asm("memrchr") 104 __attribute_pure__ __nonnull((1)); 105 extern "C++" const void *memrchr(const void *__s, int __c, size_t __n) 106 __THROW __asm("memrchr") 107 __attribute_pure__ __nonnull((1)); 108 #else 109 extern void *memrchr(const void *__s, int __c, size_t __n) 110 __THROW __attribute_pure__ __nonnull((1)); 111 #endif 112 #endif 113 114 __BEGIN_NAMESPACE_STD 115 /* Copy SRC to DEST. */ 116 extern char *strcpy(char *__restrict __dest, const char *__restrict __src) 117 __THROW __nonnull((1, 2)); 118 /* Copy no more than N characters of SRC to DEST. */ 119 extern char *strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) 120 __THROW __nonnull((1, 2)); 121 122 /* Append SRC onto DEST. */ 123 extern char *strcat(char *__restrict __dest, const char *__restrict __src) 124 __THROW __nonnull((1, 2)); 125 /* Append no more than N characters from SRC onto DEST. */ 126 extern char *strncat(char *__restrict __dest, const char *__restrict __src, size_t __n) 127 __THROW __nonnull((1, 2)); 128 129 /* Compare S1 and S2. */ 130 extern int strcmp(const char *__s1, const char *__s2) 131 __THROW __attribute_pure__ __nonnull((1, 2)); 132 /* Compare N characters of S1 and S2. */ 133 extern int strncmp(const char *__s1, const char *__s2, size_t __n) 134 __THROW __attribute_pure__ __nonnull((1, 2)); 135 136 /* Compare the collated forms of S1 and S2. */ 137 extern int strcoll(const char *__s1, const char *__s2) 138 __THROW __attribute_pure__ __nonnull((1, 2)); 139 /* Put a transformation of SRC into no more than N bytes of DEST. */ 140 extern size_t strxfrm(char *__restrict __dest, const char *__restrict __src, size_t __n) 141 __THROW __nonnull((2)); 142 __END_NAMESPACE_STD 143 #ifdef __USE_XOPEN2K8 144 /* The following functions are equivalent to the both above but they 145 take the locale they use for the collation as an extra argument. 146 This is not standardsized but something like will come. */ 147 #include <xlocale.h> 148 /* Compare the collated forms of S1 and S2 using rules from L. */ 149 extern int strcoll_l(const char *__s1, const char *__s2, __locale_t __l) 150 __THROW __attribute_pure__ __nonnull((1, 2, 3)); 151 /* Put a transformation of SRC into no more than N bytes of DEST. */ 152 extern size_t strxfrm_l(char *__dest, const char *__src, size_t __n, __locale_t __l) 153 __THROW __nonnull((2, 4)); 154 #endif 155 156 #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 157 /* Duplicate S, returning an identical malloc'd string. */ 158 extern char *strdup(const char *__s) 159 __THROW __attribute_malloc__ __nonnull((1)); 160 #endif 161 162 /* Return a malloc'd copy of at most N bytes of STRING. The 163 resultant string is terminated even if no null terminator 164 appears before STRING[N]. */ 165 #if defined __USE_XOPEN2K8 166 extern char *strndup(const char *__string, size_t __n) 167 __THROW __attribute_malloc__ __nonnull((1)); 168 #endif 169 170 #if defined __USE_GNU && defined __GNUC__ 171 /* Duplicate S, returning an identical alloca'd string. */ 172 #define strdupa(s) \ 173 (__extension__ \ 174 ({ \ 175 const char *__old = (s); \ 176 size_t __len = strlen (__old) + 1; \ 177 char *__new = (char *) __builtin_alloca (__len); \ 178 (char *) memcpy (__new, __old, __len); \ 179 })) 180 181 /* Return an alloca'd copy of at most N bytes of string. */ 182 #define strndupa(s, n) \ 183 (__extension__ \ 184 ({ \ 185 const char *__old = (s); \ 186 size_t __len = strnlen (__old, (n)); \ 187 char *__new = (char *) __builtin_alloca (__len + 1); \ 188 __new[__len] = '\0'; \ 189 (char *) memcpy (__new, __old, __len); \ 190 })) 191 #endif 192 193 __BEGIN_NAMESPACE_STD 194 /* Find the first occurrence of C in S. */ 195 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 196 extern "C++" { 197 extern char *strchr(char *__s, int __c) 198 __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); 199 extern const char *strchr(const char *__s, int __c) 200 __THROW __asm("strchr") __attribute_pure__ __nonnull((1)); 201 202 #ifdef __OPTIMIZE__ 203 __extern_always_inline char *strchr(char *__s, int __c) __THROW 204 { 205 return __builtin_strchr(__s, __c); 206 } 207 __extern_always_inline const char *strchr(const char *__s, int __c) __THROW { 208 return __builtin_strchr(__s, __c); 209 } 210 #endif 211 } 212 #else 213 extern char *strchr(const char *__s, int __c) 214 __THROW __attribute_pure__ __nonnull((1)); 215 #endif 216 /* Find the last occurrence of C in S. */ 217 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 218 extern "C++" { 219 extern char *strrchr(char *__s, int __c) 220 __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); 221 extern const char *strrchr(const char *__s, int __c) 222 __THROW __asm("strrchr") __attribute_pure__ __nonnull((1)); 223 224 #ifdef __OPTIMIZE__ 225 __extern_always_inline char *strrchr(char *__s, int __c) __THROW 226 { 227 return __builtin_strrchr(__s, __c); 228 } 229 __extern_always_inline const char *strrchr(const char *__s, int __c) __THROW { 230 return __builtin_strrchr(__s, __c); 231 } 232 #endif 233 } 234 #else 235 extern char *strrchr(const char *__s, int __c) 236 __THROW __attribute_pure__ __nonnull((1)); 237 #endif 238 __END_NAMESPACE_STD 239 #ifdef __USE_GNU 240 /* This function is similar to `strchr'. But it returns a pointer to 241 the closing NUL byte in case C is not found in S. */ 242 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 243 extern "C++" char *strchrnul(char *__s, int __c) 244 __THROW __asm("strchrnul") 245 __attribute_pure__ __nonnull((1)); 246 extern "C++" const char *strchrnul(const char *__s, int __c) 247 __THROW __asm("strchrnul") 248 __attribute_pure__ __nonnull((1)); 249 #else 250 extern char *strchrnul(const char *__s, int __c) 251 __THROW __attribute_pure__ __nonnull((1)); 252 #endif 253 #endif 254 255 __BEGIN_NAMESPACE_STD 256 /* Return the length of the initial segment of S which 257 consists entirely of characters not in REJECT. */ 258 extern size_t strcspn(const char *__s, const char *__reject) 259 __THROW __attribute_pure__ __nonnull((1, 2)); 260 /* Return the length of the initial segment of S which 261 consists entirely of characters in ACCEPT. */ 262 extern size_t strspn(const char *__s, const char *__accept) 263 __THROW __attribute_pure__ __nonnull((1, 2)); 264 /* Find the first occurrence in S of any character in ACCEPT. */ 265 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 266 extern "C++" { 267 extern char *strpbrk(char *__s, const char *__accept) 268 __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); 269 extern const char *strpbrk(const char *__s, const char *__accept) 270 __THROW __asm("strpbrk") __attribute_pure__ __nonnull((1, 2)); 271 272 #ifdef __OPTIMIZE__ 273 __extern_always_inline char *strpbrk(char *__s, const char *__accept) __THROW 274 { 275 return __builtin_strpbrk(__s, __accept); 276 } 277 __extern_always_inline const char *strpbrk(const char *__s, const char *__accept) __THROW { 278 return __builtin_strpbrk(__s, __accept); 279 } 280 #endif 281 } 282 #else 283 extern char *strpbrk(const char *__s, const char *__accept) 284 __THROW __attribute_pure__ __nonnull((1, 2)); 285 #endif 286 /* Find the first occurrence of NEEDLE in HAYSTACK. */ 287 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 288 extern "C++" { 289 extern char *strstr(char *__haystack, const char *__needle) 290 __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); 291 extern const char *strstr(const char *__haystack, const char *__needle) 292 __THROW __asm("strstr") __attribute_pure__ __nonnull((1, 2)); 293 294 #ifdef __OPTIMIZE__ 295 __extern_always_inline char *strstr(char *__haystack, const char *__needle) __THROW 296 { 297 return __builtin_strstr(__haystack, __needle); 298 } 299 __extern_always_inline const char *strstr(const char *__haystack, const char *__needle) __THROW { 300 return __builtin_strstr(__haystack, __needle); 301 } 302 #endif 303 } 304 #else 305 extern char *strstr(const char *__haystack, const char *__needle) 306 __THROW __attribute_pure__ __nonnull((1, 2)); 307 #endif 308 309 /* Divide S into tokens separated by characters in DELIM. */ 310 extern char *strtok(char *__restrict __s, const char *__restrict __delim) 311 __THROW __nonnull((2)); 312 __END_NAMESPACE_STD 313 /* Divide S into tokens separated by characters in DELIM. Information 314 passed between calls are stored in SAVE_PTR. */ 315 extern char *__strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) 316 __THROW __nonnull((2, 3)); 317 #ifdef __USE_POSIX 318 extern char *strtok_r(char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) 319 __THROW __nonnull((2, 3)); 320 #endif 321 322 #ifdef __USE_GNU 323 /* Similar to `strstr' but this function ignores the case of both strings. */ 324 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 325 extern "C++" char *strcasestr(char *__haystack, const char *__needle) 326 __THROW __asm("strcasestr") 327 __attribute_pure__ __nonnull((1, 2)); 328 extern "C++" const char *strcasestr(const char *__haystack, const char *__needle) 329 __THROW __asm("strcasestr") 330 __attribute_pure__ __nonnull((1, 2)); 331 #else 332 extern char *strcasestr(const char *__haystack, const char *__needle) 333 __THROW __attribute_pure__ __nonnull((1, 2)); 334 #endif 335 #endif 336 337 #ifdef __USE_GNU 338 /* Find the first occurrence of NEEDLE in HAYSTACK. 339 NEEDLE is NEEDLELEN bytes long; 340 HAYSTACK is HAYSTACKLEN bytes long. */ 341 extern void *memmem(const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) 342 __THROW __attribute_pure__ __nonnull((1, 3)); 343 344 /* Copy N bytes of SRC to DEST, return pointer to bytes after the 345 last written byte. */ 346 extern void *__mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) 347 __THROW __nonnull((1, 2)); 348 extern void *mempcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) 349 __THROW __nonnull((1, 2)); 350 #endif 351 352 __BEGIN_NAMESPACE_STD 353 /* Return the length of S. */ 354 extern size_t strlen(const char *__s) 355 __THROW __attribute_pure__ __nonnull((1)); 356 __END_NAMESPACE_STD 357 #ifdef __USE_XOPEN2K8 358 /* Find the length of STRING, but scan at most MAXLEN characters. 359 If no '\0' terminator is found in that many characters, return MAXLEN. */ 360 extern size_t strnlen(const char *__string, size_t __maxlen) 361 __THROW __attribute_pure__ __nonnull((1)); 362 #endif 363 364 __BEGIN_NAMESPACE_STD 365 /* Return a string describing the meaning of the `errno' code in ERRNUM. */ 366 extern char *strerror(int __errnum) __THROW; 367 __END_NAMESPACE_STD 368 #ifdef __USE_XOPEN2K 369 /* Reentrant version of `strerror'. 370 There are 2 flavors of `strerror_r', GNU which returns the string 371 and may or may not use the supplied temporary buffer and POSIX one 372 which fills the string into the buffer. 373 To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L 374 without -D_GNU_SOURCE is needed, otherwise the GNU version is 375 preferred. */ 376 #if defined __USE_XOPEN2K && !defined __USE_GNU 377 /* Fill BUF with a string describing the meaning of the `errno' code in 378 ERRNUM. */ 379 #ifdef __REDIRECT_NTH 380 extern int __REDIRECT_NTH(strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull((2)); 381 #else 382 extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen) 383 __THROW __nonnull((2)); 384 #define strerror_r __xpg_strerror_r 385 #endif 386 #else 387 /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be 388 used. */ 389 extern char *strerror_r(int __errnum, char *__buf, size_t __buflen) 390 __THROW __nonnull((2)) __wur; 391 #endif 392 #endif 393 394 #ifdef __USE_XOPEN2K8 395 /* Translate error number to string according to the locale L. */ 396 extern char *strerror_l(int __errnum, __locale_t __l) __THROW; 397 #endif 398 399 /* We define this function always since `bzero' is sometimes needed when 400 the namespace rules does not allow this. */ 401 extern void __bzero(void *__s, size_t __n) 402 __THROW __nonnull((1)); 403 404 #ifdef __USE_MISC 405 /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ 406 extern void bcopy(const void *__src, void *__dest, size_t __n) 407 __THROW __nonnull((1, 2)); 408 409 /* Set N bytes of S to 0. */ 410 extern void bzero(void *__s, size_t __n) 411 __THROW __nonnull((1)); 412 413 /* Compare N bytes of S1 and S2 (same as memcmp). */ 414 extern int bcmp(const void *__s1, const void *__s2, size_t __n) 415 __THROW __attribute_pure__ __nonnull((1, 2)); 416 417 /* Find the first occurrence of C in S (same as strchr). */ 418 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 419 extern "C++" { 420 extern char *index(char *__s, int __c) 421 __THROW __asm("index") __attribute_pure__ __nonnull((1)); 422 extern const char *index(const char *__s, int __c) 423 __THROW __asm("index") __attribute_pure__ __nonnull((1)); 424 425 #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO 426 __extern_always_inline char *index(char *__s, int __c) __THROW 427 { 428 return __builtin_index(__s, __c); 429 } 430 __extern_always_inline const char *index(const char *__s, int __c) __THROW { 431 return __builtin_index(__s, __c); 432 } 433 #endif 434 } 435 #else 436 extern char *index(const char *__s, int __c) 437 __THROW __attribute_pure__ __nonnull((1)); 438 #endif 439 440 /* Find the last occurrence of C in S (same as strrchr). */ 441 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 442 extern "C++" { 443 extern char *rindex(char *__s, int __c) 444 __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); 445 extern const char *rindex(const char *__s, int __c) 446 __THROW __asm("rindex") __attribute_pure__ __nonnull((1)); 447 448 #if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO 449 __extern_always_inline char *rindex(char *__s, int __c) __THROW 450 { 451 return __builtin_rindex(__s, __c); 452 } 453 __extern_always_inline const char *rindex(const char *__s, int __c) __THROW { 454 return __builtin_rindex(__s, __c); 455 } 456 #endif 457 } 458 #else 459 extern char *rindex(const char *__s, int __c) 460 __THROW __attribute_pure__ __nonnull((1)); 461 #endif 462 463 /* Return the position of the first bit set in I, or 0 if none are set. 464 The least-significant bit is position 1, the most-significant 32. */ 465 extern int ffs(int __i) 466 __THROW __attribute__ ((__const__)); 467 468 /* The following two functions are non-standard but necessary for non-32 bit 469 platforms. */ 470 #ifdef __USE_GNU 471 extern int ffsl(long int __l) 472 __THROW __attribute__ ((__const__)); 473 __extension__ extern int ffsll(long long int __ll) 474 __THROW __attribute__ ((__const__)); 475 #endif 476 477 /* Compare S1 and S2, ignoring case. */ 478 extern int strcasecmp(const char *__s1, const char *__s2) 479 __THROW __attribute_pure__ __nonnull((1, 2)); 480 481 /* Compare no more than N chars of S1 and S2, ignoring case. */ 482 extern int strncasecmp(const char *__s1, const char *__s2, size_t __n) 483 __THROW __attribute_pure__ __nonnull((1, 2)); 484 #endif /* Use misc. */ 485 486 #ifdef __USE_GNU 487 /* Again versions of a few functions which use the given locale instead 488 of the global one. */ 489 extern int strcasecmp_l(const char *__s1, const char *__s2, __locale_t __loc) 490 __THROW __attribute_pure__ __nonnull((1, 2, 3)); 491 492 extern int strncasecmp_l(const char *__s1, const char *__s2, size_t __n, __locale_t __loc) 493 __THROW __attribute_pure__ __nonnull((1, 2, 4)); 494 #endif 495 496 #ifdef __USE_MISC 497 /* Return the next DELIM-delimited token from *STRINGP, 498 terminating it with a '\0', and update *STRINGP to point past it. */ 499 extern char *strsep(char **__restrict __stringp, const char *__restrict __delim) 500 __THROW __nonnull((1, 2)); 501 #endif 502 503 #ifdef __USE_XOPEN2K8 504 /* Return a string describing the meaning of the signal number in SIG. */ 505 extern char *strsignal(int __sig) __THROW; 506 507 /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ 508 extern char *__stpcpy(char *__restrict __dest, const char *__restrict __src) 509 __THROW __nonnull((1, 2)); 510 extern char *stpcpy(char *__restrict __dest, const char *__restrict __src) 511 __THROW __nonnull((1, 2)); 512 513 /* Copy no more than N characters of SRC to DEST, returning the address of 514 the last character written into DEST. */ 515 extern char *__stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) 516 __THROW __nonnull((1, 2)); 517 extern char *stpncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) 518 __THROW __nonnull((1, 2)); 519 #endif 520 521 #ifdef __USE_GNU 522 /* Compare S1 and S2 as strings holding name & indices/version numbers. */ 523 extern int strverscmp(const char *__s1, const char *__s2) 524 __THROW __attribute_pure__ __nonnull((1, 2)); 525 526 /* Sautee STRING briskly. */ 527 extern char *strfry(char *__string) 528 __THROW __nonnull((1)); 529 530 /* Frobnicate N bytes of S. */ 531 extern void *memfrob(void *__s, size_t __n) 532 __THROW __nonnull((1)); 533 534 #ifndef basename 535 /* Return the file name within directory of FILENAME. We don't 536 declare the function if the `basename' macro is available (defined 537 in <libgen.h>) which makes the XPG version of this function 538 available. */ 539 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO 540 extern "C++" char *basename(char *__filename) 541 __THROW __asm("basename") __nonnull((1)); 542 extern "C++" const char *basename(const char *__filename) 543 __THROW __asm("basename") __nonnull((1)); 544 #else 545 extern char *basename(const char *__filename) 546 __THROW __nonnull((1)); 547 #endif 548 #endif 549 #endif 550 551 #if __GNUC_PREREQ (3,4) 552 #if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \ 553 && !defined __NO_INLINE__ && !defined __cplusplus 554 /* When using GNU CC we provide some optimized versions of selected 555 functions from this header. There are two kinds of optimizations: 556 557 - machine-dependent optimizations, most probably using inline 558 assembler code; these might be quite expensive since the code 559 size can increase significantly. 560 These optimizations are not used unless the symbol 561 __USE_STRING_INLINES 562 is defined before including this header. 563 564 - machine-independent optimizations which do not increase the 565 code size significantly and which optimize mainly situations 566 where one or more arguments are compile-time constants. 567 These optimizations are used always when the compiler is 568 taught to optimize. 569 570 One can inhibit all optimizations by defining __NO_STRING_INLINES. */ 571 572 /* Get the machine-dependent optimizations (if any). */ 573 #include <bits/string.h> 574 575 /* These are generic optimizations which do not add too much inline code. */ 576 #include <bits/string2.h> 577 #endif 578 579 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function 580 /* Functions with security checks. */ 581 #include <bits/string3.h> 582 #endif 583 #endif 584 585 #if defined __USE_GNU && defined __OPTIMIZE__ \ 586 && defined __extern_always_inline && __GNUC_PREREQ (3,2) 587 #if !defined _FORCE_INLINES && !defined _HAVE_STRING_ARCH_mempcpy 588 589 #define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) 590 #define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n) 591 592 __extern_always_inline void *__mempcpy_inline(void *__restrict __dest, const void *__restrict __src, size_t __n) 593 { 594 return (char *)memcpy(__dest, __src, __n) + __n; 595 } 596 597 #endif 598 #endif 599 600 __END_DECLS 601 #endif /* string.h */