| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2008 The Android Open Source Project | 
|  | 3 | * All rights reserved. | 
|  | 4 | * | 
|  | 5 | * Redistribution and use in source and binary forms, with or without | 
|  | 6 | * modification, are permitted provided that the following conditions | 
|  | 7 | * are met: | 
|  | 8 | *  * Redistributions of source code must retain the above copyright | 
|  | 9 | *    notice, this list of conditions and the following disclaimer. | 
|  | 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 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 
|  | 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 
|  | 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 
|  | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 
|  | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | 
|  | 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 
|  | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
|  | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | 
|  | 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|  | 26 | * SUCH DAMAGE. | 
|  | 27 | */ | 
| Elliott Hughes | 09c39d6 | 2014-08-19 14:30:30 -0700 | [diff] [blame] | 28 |  | 
|  | 29 | #ifndef _STRING_H | 
|  | 30 | #define _STRING_H | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 |  | 
|  | 32 | #include <sys/cdefs.h> | 
|  | 33 | #include <stddef.h> | 
| Dan Albert | dfb5ce4 | 2014-07-09 22:51:34 +0000 | [diff] [blame] | 34 | #include <xlocale.h> | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 35 |  | 
| Josh Gao | c3cec27 | 2016-04-07 13:39:49 -0700 | [diff] [blame] | 36 | #include <bits/strcasecmp.h> | 
|  | 37 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 38 | __BEGIN_DECLS | 
|  | 39 |  | 
| Elliott Hughes | 76f8916 | 2015-01-26 13:34:58 -0800 | [diff] [blame] | 40 | #if defined(__USE_BSD) | 
|  | 41 | #include <strings.h> | 
|  | 42 | #endif | 
|  | 43 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 44 | void* memccpy(void* __dst, const void* __src, int __stop_char, size_t __n); | 
|  | 45 | void* memchr(const void* __s, int __ch, size_t __n) __attribute_pure__ __overloadable __RENAME_CLANG(memchr); | 
| Elliott Hughes | df9a489 | 2017-08-23 14:34:03 -0700 | [diff] [blame] | 46 | #if defined(__cplusplus) | 
|  | 47 | extern "C++" void* memrchr(void* __s, int __ch, size_t __n) __RENAME(memrchr) __attribute_pure__; | 
|  | 48 | extern "C++" const void* memrchr(const void* __s, int __ch, size_t __n) __RENAME(memrchr) __attribute_pure__; | 
|  | 49 | #else | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 50 | void* memrchr(const void* __s, int __ch, size_t __n) __attribute_pure__ __overloadable __RENAME_CLANG(memrchr); | 
| Elliott Hughes | df9a489 | 2017-08-23 14:34:03 -0700 | [diff] [blame] | 51 | #endif | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 52 | int memcmp(const void* __lhs, const void* __rhs, size_t __n) __attribute_pure__; | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 53 | void* memcpy(void*, const void*, size_t) | 
| George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 54 | __overloadable __RENAME_CLANG(memcpy); | 
| Elliott Hughes | 3cfb52a | 2015-02-18 21:29:13 -0800 | [diff] [blame] | 55 | #if defined(__USE_GNU) | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 56 | void* mempcpy(void* __dst, const void* __src, size_t __n) __INTRODUCED_IN(23); | 
| Elliott Hughes | 3cfb52a | 2015-02-18 21:29:13 -0800 | [diff] [blame] | 57 | #endif | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 58 | void* memmove(void* __dst, const void* __src, size_t __n) __overloadable __RENAME_CLANG(memmove); | 
|  | 59 | void* memset(void* __dst, int __ch, size_t __n) __overloadable __RENAME_CLANG(memset); | 
|  | 60 | void* memmem(const void* __haystack, size_t __haystack_size, const void* __needle, size_t __needle_size) __attribute_pure__; | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 61 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 62 | char* strchr(const char* __s, int __ch) __attribute_pure__ __overloadable __RENAME_CLANG(strchr); | 
|  | 63 | char* __strchr_chk(const char* __s, int __ch, size_t __n) __INTRODUCED_IN(18); | 
| Elliott Hughes | 7ac3c12 | 2015-08-26 09:59:29 -0700 | [diff] [blame] | 64 | #if defined(__USE_GNU) | 
|  | 65 | #if defined(__cplusplus) | 
| Dan Albert | 3f7e65e | 2017-08-15 14:42:31 -0700 | [diff] [blame] | 66 | /* The versioner doesn't handle C++ blocks yet, so manually guarded. */ | 
|  | 67 | #if __ANDROID_API__ >= 24 | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 68 | extern "C++" char* strchrnul(char* __s, int __ch) __RENAME(strchrnul) __attribute_pure__ __INTRODUCED_IN(24); | 
|  | 69 | extern "C++" const char* strchrnul(const char* __s, int __ch) __RENAME(strchrnul) __attribute_pure__ __INTRODUCED_IN(24); | 
| Dan Albert | 3f7e65e | 2017-08-15 14:42:31 -0700 | [diff] [blame] | 70 | #endif  /* __ANDROID_API__ >= 24 */ | 
| Elliott Hughes | 7ac3c12 | 2015-08-26 09:59:29 -0700 | [diff] [blame] | 71 | #else | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 72 | char* strchrnul(const char* __s, int __ch) __attribute_pure__ __INTRODUCED_IN(24); | 
| Elliott Hughes | 7ac3c12 | 2015-08-26 09:59:29 -0700 | [diff] [blame] | 73 | #endif | 
|  | 74 | #endif | 
| Pavel Chupin | 3c4b50f | 2013-07-26 16:50:11 +0400 | [diff] [blame] | 75 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 76 | char* strrchr(const char* __s, int __ch) __attribute_pure__ __overloadable __RENAME_CLANG(strrchr); | 
|  | 77 | char* __strrchr_chk(const char* __s, int __ch, size_t __n) __INTRODUCED_IN(18); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 78 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 79 | size_t strlen(const char* __s) __attribute_pure__ __overloadable __RENAME_CLANG(strlen); | 
|  | 80 | size_t __strlen_chk(const char* __s, size_t __n) __INTRODUCED_IN(17); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 81 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 82 | int strcmp(const char* __lhs, const char* __rhs) __attribute_pure__; | 
|  | 83 | char* stpcpy(char* __dst, const char* __src) __overloadable __RENAME_CLANG(stpcpy) __INTRODUCED_IN(21); | 
|  | 84 | char* strcpy(char* __dst, const char* __src) __overloadable __RENAME_CLANG(strcpy); | 
|  | 85 | char* strcat(char* __dst, const char* __src) __overloadable __RENAME_CLANG(strcat); | 
|  | 86 | char* strdup(const char* __s); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 87 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 88 | char* strstr(const char* __haystack, const char* __needle) __attribute_pure__; | 
| Elliott Hughes | df9a489 | 2017-08-23 14:34:03 -0700 | [diff] [blame] | 89 | #if defined(__cplusplus) | 
|  | 90 | extern "C++" char* strcasestr(char*, const char*) __RENAME(strcasestr) __attribute_pure__; | 
|  | 91 | extern "C++" const char* strcasestr(const char*, const char*) __RENAME(strcasestr) __attribute_pure__; | 
|  | 92 | #else | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 93 | char* strcasestr(const char* __haystack, const char* __needle) __attribute_pure__; | 
| Elliott Hughes | df9a489 | 2017-08-23 14:34:03 -0700 | [diff] [blame] | 94 | #endif | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 95 | char* strtok(char* __s, const char* __delimiter); | 
|  | 96 | char* strtok_r(char* __s, const char* __delimiter, char** __pos_ptr); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 97 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 98 | char* strerror(int __errno_value); | 
|  | 99 | char* strerror_l(int __errno_value, locale_t __l) __INTRODUCED_IN(23); | 
| Dan Albert | 8b154b1 | 2017-02-14 16:33:06 -0800 | [diff] [blame] | 100 | #if defined(__USE_GNU) && __ANDROID_API__ >= 23 | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 101 | char* strerror_r(int __errno_value, char* __buf, size_t __n) __RENAME(__gnu_strerror_r) __INTRODUCED_IN(23); | 
| Elliott Hughes | 416d7dd | 2014-08-18 17:28:32 -0700 | [diff] [blame] | 102 | #else /* POSIX */ | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 103 | int strerror_r(int __errno_value, char* __buf, size_t __n); | 
| Elliott Hughes | 416d7dd | 2014-08-18 17:28:32 -0700 | [diff] [blame] | 104 | #endif | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 105 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 106 | size_t strnlen(const char* __s, size_t __n) __attribute_pure__; | 
|  | 107 | char* strncat(char* __dst, const char* __src, size_t __n) __overloadable __RENAME_CLANG(strncat); | 
|  | 108 | char* strndup(const char* __s, size_t __n); | 
|  | 109 | int strncmp(const char* __lhs, const char* __rhs, size_t __n) __attribute_pure__; | 
|  | 110 | char* stpncpy(char* __dst, const char* __src, size_t __n) __overloadable __RENAME_CLANG(stpncpy) __INTRODUCED_IN(21); | 
|  | 111 | char* strncpy(char* __dst, const char* __src, size_t __n) __overloadable __RENAME_CLANG(strncpy); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 112 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 113 | size_t strlcat(char* __dst, const char* __src, size_t __n) __overloadable __RENAME_CLANG(strlcat); | 
|  | 114 | size_t strlcpy(char* __dst, const char* __src, size_t __n) __overloadable __RENAME_CLANG(strlcpy); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 115 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 116 | size_t strcspn(const char* __s, const char* __reject) __attribute_pure__; | 
|  | 117 | char* strpbrk(const char* __s, const char* __accept) __attribute_pure__; | 
|  | 118 | char* strsep(char** __s_ptr, const char* __delimiter); | 
|  | 119 | size_t strspn(const char* __s, const char* __accept); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 120 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 121 | char* strsignal(int __signal); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 122 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 123 | int strcoll(const char* __lhs, const char* __rhs) __attribute_pure__; | 
|  | 124 | size_t strxfrm(char* __dst, const char* __src, size_t __n); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 125 |  | 
| Elliott Hughes | 5bc78c8 | 2016-11-16 11:35:43 -0800 | [diff] [blame] | 126 | #if __ANDROID_API__ >= __ANDROID_API_L__ | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 127 | int strcoll_l(const char* __lhs, const char* __rhs, locale_t __l) __attribute_pure__ __INTRODUCED_IN(21); | 
|  | 128 | size_t strxfrm_l(char* __dst, const char* __src, size_t __n, locale_t __l) __INTRODUCED_IN(21); | 
| Josh Gao | 6cd9fb0 | 2016-09-23 14:06:05 -0700 | [diff] [blame] | 129 | #else | 
|  | 130 | // Implemented as static inlines before 21. | 
|  | 131 | #endif | 
| Dan Albert | dfb5ce4 | 2014-07-09 22:51:34 +0000 | [diff] [blame] | 132 |  | 
| Josh Gao | eb9b925 | 2015-11-03 18:46:02 -0800 | [diff] [blame] | 133 | #if defined(__USE_GNU) && !defined(basename) | 
| Elliott Hughes | 09c39d6 | 2014-08-19 14:30:30 -0700 | [diff] [blame] | 134 | /* | 
|  | 135 | * glibc has a basename in <string.h> that's different to the POSIX one in <libgen.h>. | 
|  | 136 | * It doesn't modify its argument, and in C++ it's const-correct. | 
|  | 137 | */ | 
|  | 138 | #if defined(__cplusplus) | 
| Dan Albert | 3f7e65e | 2017-08-15 14:42:31 -0700 | [diff] [blame] | 139 | /* The versioner doesn't handle C++ blocks yet, so manually guarded. */ | 
|  | 140 | #if __ANDROID_API__ >= 23 | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 141 | extern "C++" char* basename(char* __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23); | 
|  | 142 | extern "C++" const char* basename(const char* __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23); | 
| Dan Albert | 3f7e65e | 2017-08-15 14:42:31 -0700 | [diff] [blame] | 143 | #endif  /* __ANDROID_API__ >= 23 */ | 
| Elliott Hughes | 09c39d6 | 2014-08-19 14:30:30 -0700 | [diff] [blame] | 144 | #else | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 145 | char* basename(const char* __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23); | 
| Elliott Hughes | 09c39d6 | 2014-08-19 14:30:30 -0700 | [diff] [blame] | 146 | #endif | 
| Elliott Hughes | 09c39d6 | 2014-08-19 14:30:30 -0700 | [diff] [blame] | 147 | #endif | 
|  | 148 |  | 
| George Burgess IV | b97049c | 2017-07-24 15:05:05 -0700 | [diff] [blame] | 149 | #if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS) | 
|  | 150 | #include <bits/fortify/string.h> | 
|  | 151 | #endif | 
| Nick Kralevich | 0a23015 | 2012-06-04 15:20:25 -0700 | [diff] [blame] | 152 |  | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 153 | /* Const-correct overloads. Placed after FORTIFY so we call those functions, if possible. */ | 
|  | 154 | #if defined(__cplusplus) && defined(__clang__) | 
|  | 155 | /* | 
|  | 156 | * Use two enable_ifs so these overloads don't conflict with + are preferred over libcxx's. This can | 
|  | 157 | * be reduced to 1 after libcxx recognizes that we have const-correct overloads. | 
|  | 158 | */ | 
|  | 159 | #define __prefer_this_overload __enable_if(true, "preferred overload") __enable_if(true, "") | 
|  | 160 | extern "C++" { | 
|  | 161 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 162 | void* __bionic_memchr(const void* const s __pass_object_size, int c, size_t n) { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 163 | return memchr(s, c, n); | 
|  | 164 | } | 
|  | 165 |  | 
|  | 166 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 167 | const void* memchr(const void* const s __pass_object_size, int c, size_t n) | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 168 | __prefer_this_overload { | 
|  | 169 | return __bionic_memchr(s, c, n); | 
|  | 170 | } | 
|  | 171 |  | 
|  | 172 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 173 | void* memchr(void* const s __pass_object_size, int c, size_t n) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 174 | return __bionic_memchr(s, c, n); | 
|  | 175 | } | 
|  | 176 |  | 
|  | 177 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 178 | char* __bionic_strchr(const char* const s __pass_object_size, int c) { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 179 | return strchr(s, c); | 
|  | 180 | } | 
|  | 181 |  | 
|  | 182 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 183 | const char* strchr(const char* const s __pass_object_size, int c) | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 184 | __prefer_this_overload { | 
|  | 185 | return __bionic_strchr(s, c); | 
|  | 186 | } | 
|  | 187 |  | 
|  | 188 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 189 | char* strchr(char* const s __pass_object_size, int c) | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 190 | __prefer_this_overload { | 
|  | 191 | return __bionic_strchr(s, c); | 
|  | 192 | } | 
|  | 193 |  | 
|  | 194 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 195 | char* __bionic_strrchr(const char* const s __pass_object_size, int c) { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 196 | return strrchr(s, c); | 
|  | 197 | } | 
|  | 198 |  | 
|  | 199 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 200 | const char* strrchr(const char* const s __pass_object_size, int c) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 201 | return __bionic_strrchr(s, c); | 
|  | 202 | } | 
|  | 203 |  | 
|  | 204 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 205 | char* strrchr(char* const s __pass_object_size, int c) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 206 | return __bionic_strrchr(s, c); | 
|  | 207 | } | 
|  | 208 |  | 
|  | 209 | /* Functions with no FORTIFY counterpart. */ | 
|  | 210 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 211 | char* __bionic_strstr(const char* h, const char* n) { return strstr(h, n); } | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 212 |  | 
|  | 213 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 214 | const char* strstr(const char* h, const char* n) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 215 | return __bionic_strstr(h, n); | 
|  | 216 | } | 
|  | 217 |  | 
|  | 218 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 219 | char* strstr(char* h, const char* n) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 220 | return __bionic_strstr(h, n); | 
|  | 221 | } | 
|  | 222 |  | 
|  | 223 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 224 | char* __bionic_strpbrk(const char* h, const char* n) { return strpbrk(h, n); } | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 225 |  | 
|  | 226 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 227 | char* strpbrk(char* h, const char* n) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 228 | return __bionic_strpbrk(h, n); | 
|  | 229 | } | 
|  | 230 |  | 
|  | 231 | inline __always_inline | 
| Elliott Hughes | 3f66e74 | 2017-08-01 13:24:40 -0700 | [diff] [blame] | 232 | const char* strpbrk(const char* h, const char* n) __prefer_this_overload { | 
| George Burgess IV | bd3d208 | 2017-04-04 17:34:02 -0700 | [diff] [blame] | 233 | return __bionic_strpbrk(h, n); | 
|  | 234 | } | 
|  | 235 | } | 
|  | 236 | #undef __prefer_this_overload | 
|  | 237 | #endif | 
|  | 238 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 239 | __END_DECLS | 
|  | 240 |  | 
| Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame] | 241 | #endif |