blob: 30ba865e4d96547a6e192dcd85cde9fe874cda17 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
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 Hughes09c39d62014-08-19 14:30:30 -070028
29#ifndef _STRING_H
30#define _STRING_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031
32#include <sys/cdefs.h>
33#include <stddef.h>
Dan Albertdfb5ce42014-07-09 22:51:34 +000034#include <xlocale.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035
Josh Gaoc3cec272016-04-07 13:39:49 -070036#include <bits/strcasecmp.h>
37
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080038__BEGIN_DECLS
39
Elliott Hughesc5d97952023-11-14 00:40:30 +000040#if defined(__USE_BSD) || defined(__USE_GNU)
Elliott Hughes76f89162015-01-26 13:34:58 -080041#include <strings.h>
42#endif
43
zijunzhao02c4ef42023-02-11 00:17:24 +000044void* _Nullable memccpy(void* _Nonnull __dst, const void* _Nonnull __src, int __stop_char, size_t __n);
45void* _Nullable memchr(const void* _Nonnull __s, int __ch, size_t __n) __attribute_pure__;
Elliott Hughesdf9a4892017-08-23 14:34:03 -070046#if defined(__cplusplus)
zijunzhao02c4ef42023-02-11 00:17:24 +000047extern "C++" void* _Nullable memrchr(void* _Nonnull __s, int __ch, size_t __n) __RENAME(memrchr) __attribute_pure__;
48extern "C++" const void* _Nullable memrchr(const void* _Nonnull __s, int __ch, size_t __n) __RENAME(memrchr) __attribute_pure__;
Elliott Hughesdf9a4892017-08-23 14:34:03 -070049#else
zijunzhao02c4ef42023-02-11 00:17:24 +000050void* _Nullable memrchr(const void* _Nonnull __s, int __ch, size_t __n) __attribute_pure__;
Elliott Hughesdf9a4892017-08-23 14:34:03 -070051#endif
zijunzhao02c4ef42023-02-11 00:17:24 +000052int memcmp(const void* _Nonnull __lhs, const void* _Nonnull __rhs, size_t __n) __attribute_pure__;
53void* _Nonnull memcpy(void* _Nonnull, const void* _Nonnull, size_t);
Dan Albert02ce4012024-10-25 19:13:49 +000054
Elliott Hughes7d1b9cb2025-04-10 15:37:10 -040055#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(23)
zijunzhao02c4ef42023-02-11 00:17:24 +000056void* _Nonnull mempcpy(void* _Nonnull __dst, const void* _Nonnull __src, size_t __n) __INTRODUCED_IN(23);
Dan Albert7b7abe92024-10-22 20:33:44 +000057#endif
Elliott Hughes216f3ad2025-03-31 13:36:43 -070058
zijunzhao02c4ef42023-02-11 00:17:24 +000059void* _Nonnull memmove(void* _Nonnull __dst, const void* _Nonnull __src, size_t __n);
Elliott Hughes0d642432022-08-10 23:35:03 +000060
61/**
Elliott Hughesbbd39aa2024-08-13 20:59:16 +000062 * [memset(3)](https://man7.org/linux/man-pages/man3/memset.3.html) writes the
Elliott Hughes0d642432022-08-10 23:35:03 +000063 * bottom 8 bits of the given int to the next `n` bytes of `dst`.
64 *
65 * Returns `dst`.
66 */
zijunzhao02c4ef42023-02-11 00:17:24 +000067void* _Nonnull memset(void* _Nonnull __dst, int __ch, size_t __n);
Elliott Hughes0d642432022-08-10 23:35:03 +000068
69/**
Elliott Hughesbbd39aa2024-08-13 20:59:16 +000070 * [memset_explicit(3)](https://man7.org/linux/man-pages/man3/memset_explicit.3.html)
Elliott Hughes0d642432022-08-10 23:35:03 +000071 * writes the bottom 8 bits of the given int to the next `n` bytes of `dst`,
72 * but won't be optimized out by the compiler.
73 *
74 * Returns `dst`.
75 */
Dan Albert02ce4012024-10-25 19:13:49 +000076#if __BIONIC_AVAILABILITY_GUARD(34)
zijunzhao02c4ef42023-02-11 00:17:24 +000077void* _Nonnull memset_explicit(void* _Nonnull __dst, int __ch, size_t __n) __INTRODUCED_IN(34);
Dan Albert02ce4012024-10-25 19:13:49 +000078#endif /* __BIONIC_AVAILABILITY_GUARD(34) */
79
Elliott Hughes0d642432022-08-10 23:35:03 +000080
zijunzhao02c4ef42023-02-11 00:17:24 +000081void* _Nullable memmem(const void* _Nonnull __haystack, size_t __haystack_size, const void* _Nonnull __needle, size_t __needle_size) __attribute_pure__;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080082
zijunzhao02c4ef42023-02-11 00:17:24 +000083char* _Nullable strchr(const char* _Nonnull __s, int __ch) __attribute_pure__;
Elliott Hughes655e4302023-06-16 12:39:33 -070084char* _Nullable __strchr_chk(const char* _Nonnull __s, int __ch, size_t __n);
Elliott Hughes1749d212025-04-24 11:59:35 -070085
86#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(24)
Elliott Hughes7ac3c122015-08-26 09:59:29 -070087#if defined(__cplusplus)
zijunzhao02c4ef42023-02-11 00:17:24 +000088extern "C++" char* _Nonnull strchrnul(char* _Nonnull __s, int __ch) __RENAME(strchrnul) __attribute_pure__ __INTRODUCED_IN(24);
89extern "C++" const char* _Nonnull strchrnul(const char* _Nonnull __s, int __ch) __RENAME(strchrnul) __attribute_pure__ __INTRODUCED_IN(24);
Elliott Hughes7ac3c122015-08-26 09:59:29 -070090#else
zijunzhao02c4ef42023-02-11 00:17:24 +000091char* _Nonnull strchrnul(const char* _Nonnull __s, int __ch) __attribute_pure__ __INTRODUCED_IN(24);
Elliott Hughes7ac3c122015-08-26 09:59:29 -070092#endif
93#endif
Pavel Chupin3c4b50f2013-07-26 16:50:11 +040094
zijunzhao02c4ef42023-02-11 00:17:24 +000095char* _Nullable strrchr(const char* _Nonnull __s, int __ch) __attribute_pure__;
Elliott Hughes655e4302023-06-16 12:39:33 -070096char* _Nullable __strrchr_chk(const char* _Nonnull __s, int __ch, size_t __n);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080097
zijunzhao02c4ef42023-02-11 00:17:24 +000098size_t strlen(const char* _Nonnull __s) __attribute_pure__;
Elliott Hughes655e4302023-06-16 12:39:33 -070099size_t __strlen_chk(const char* _Nonnull __s, size_t __n);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800100
zijunzhao02c4ef42023-02-11 00:17:24 +0000101int strcmp(const char* _Nonnull __lhs, const char* _Nonnull __rhs) __attribute_pure__;
Elliott Hughes655e4302023-06-16 12:39:33 -0700102char* _Nonnull stpcpy(char* _Nonnull __dst, const char* _Nonnull __src);
zijunzhao02c4ef42023-02-11 00:17:24 +0000103char* _Nonnull strcpy(char* _Nonnull __dst, const char* _Nonnull __src);
104char* _Nonnull strcat(char* _Nonnull __dst, const char* _Nonnull __src);
105char* _Nullable strdup(const char* _Nonnull __s);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800106
zijunzhao02c4ef42023-02-11 00:17:24 +0000107char* _Nullable strstr(const char* _Nonnull __haystack, const char* _Nonnull __needle) __attribute_pure__;
zijunzhao02c4ef42023-02-11 00:17:24 +0000108char* _Nullable strcasestr(const char* _Nonnull __haystack, const char* _Nonnull __needle) __attribute_pure__;
zijunzhao02c4ef42023-02-11 00:17:24 +0000109char* _Nullable strtok(char* _Nullable __s, const char* _Nonnull __delimiter);
110char* _Nullable strtok_r(char* _Nullable __s, const char* _Nonnull __delimiter, char* _Nonnull * _Nonnull __pos_ptr);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800111
Elliott Hughesee04e3d2024-08-15 17:14:18 +0000112/**
113 * [strerror(3)](https://man7.org/linux/man-pages/man3/strerror.3.html)
114 * returns a string describing the given errno value.
115 * `strerror(EINVAL)` would return "Invalid argument", for example.
116 *
117 * On Android, unknown errno values return a string such as "Unknown error 666".
118 * These unknown errno value strings live in thread-local storage, and are valid
119 * until the next call of strerror() on the same thread.
120 *
121 * Returns a pointer to a string.
122 */
zijunzhao02c4ef42023-02-11 00:17:24 +0000123char* _Nonnull strerror(int __errno_value);
Elliott Hughesee04e3d2024-08-15 17:14:18 +0000124
125/**
126 * Equivalent to strerror() on Android where only C/POSIX locales are available.
127 */
128char* _Nonnull strerror_l(int __errno_value, locale_t _Nonnull __l) __RENAME(strerror);
129
130/**
131 * [strerror_r(3)](https://man7.org/linux/man-pages/man3/strerror_r.3.html)
132 * writes a string describing the given errno value into the given buffer.
133 *
134 * There are two variants of this function, POSIX and GNU.
135 * The GNU variant returns a pointer to the buffer.
136 * The POSIX variant returns 0 on success or an errno value on failure.
137 *
138 * The GNU variant is available since API level 23 if `_GNU_SOURCE` is defined.
139 * The POSIX variant is available otherwise.
140 */
Dan Albert8b154b12017-02-14 16:33:06 -0800141#if defined(__USE_GNU) && __ANDROID_API__ >= 23
zijunzhao02c4ef42023-02-11 00:17:24 +0000142char* _Nonnull strerror_r(int __errno_value, char* _Nullable __buf, size_t __n) __RENAME(__gnu_strerror_r) __INTRODUCED_IN(23);
Elliott Hughes416d7dd2014-08-18 17:28:32 -0700143#else /* POSIX */
zijunzhao02c4ef42023-02-11 00:17:24 +0000144int strerror_r(int __errno_value, char* _Nonnull __buf, size_t __n);
Elliott Hughes416d7dd2014-08-18 17:28:32 -0700145#endif
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800146
Elliott Hughes2109f122023-09-21 18:32:39 -0700147/**
Elliott Hughes7fb8d582025-01-06 15:57:38 +0000148 * [strerrorname_np(3)](https://man7.org/linux/man-pages/man3/strerrorname_np.3.html)
Elliott Hughes2109f122023-09-21 18:32:39 -0700149 * returns the name of the errno constant corresponding to its argument.
150 * `strerrorname_np(38)` would return "ENOSYS", because `ENOSYS` is errno 38. This
151 * is mostly useful for error reporting in cases where a string like "ENOSYS" is
152 * more readable than a string like "Function not implemented", which would be
153 * returned by strerror().
154 *
155 * Returns a pointer to a string, or null for unknown errno values.
156 *
Elliott Hughesab47e9a2025-04-11 09:56:13 -0700157 * Available since API level 35 when compiling with `_GNU_SOURCE`.
Elliott Hughes2109f122023-09-21 18:32:39 -0700158 */
Elliott Hughes7d1b9cb2025-04-10 15:37:10 -0400159#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(35)
Elliott Hughes2109f122023-09-21 18:32:39 -0700160const char* _Nullable strerrorname_np(int __errno_value) __INTRODUCED_IN(35);
161#endif
162
163/**
Elliott Hughesbbd39aa2024-08-13 20:59:16 +0000164 * [strerrordesc_np(3)](https://man7.org/linux/man-pages/man3/strerrordesc_np.3.html)
Elliott Hughes2109f122023-09-21 18:32:39 -0700165 * is like strerror() but without localization. Since Android's strerror()
166 * does not localize, this is the same as strerror() on Android.
167 *
168 * Returns a pointer to a string.
Elliott Hughesab47e9a2025-04-11 09:56:13 -0700169 *
170 * Available when compiling with `_GNU_SOURCE`.
Elliott Hughes2109f122023-09-21 18:32:39 -0700171 */
172#if defined(__USE_GNU)
173const char* _Nonnull strerrordesc_np(int __errno_value) __RENAME(strerror);
174#endif
175
zijunzhao02c4ef42023-02-11 00:17:24 +0000176size_t strnlen(const char* _Nonnull __s, size_t __n) __attribute_pure__;
177char* _Nonnull strncat(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
178char* _Nullable strndup(const char* _Nonnull __s, size_t __n);
179int strncmp(const char* _Nonnull __lhs, const char* _Nonnull __rhs, size_t __n) __attribute_pure__;
Elliott Hughes655e4302023-06-16 12:39:33 -0700180char* _Nonnull stpncpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
zijunzhao02c4ef42023-02-11 00:17:24 +0000181char* _Nonnull strncpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800182
zijunzhao02c4ef42023-02-11 00:17:24 +0000183size_t strlcat(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
184size_t strlcpy(char* _Nonnull __dst, const char* _Nonnull __src, size_t __n);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800185
zijunzhao02c4ef42023-02-11 00:17:24 +0000186size_t strcspn(const char* _Nonnull __s, const char* _Nonnull __reject) __attribute_pure__;
187char* _Nullable strpbrk(const char* _Nonnull __s, const char* _Nonnull __accept) __attribute_pure__;
188char* _Nullable strsep(char* _Nullable * _Nonnull __s_ptr, const char* _Nonnull __delimiter);
189size_t strspn(const char* _Nonnull __s, const char* _Nonnull __accept);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800190
zijunzhao02c4ef42023-02-11 00:17:24 +0000191char* _Nonnull strsignal(int __signal);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800192
zijunzhao02c4ef42023-02-11 00:17:24 +0000193int strcoll(const char* _Nonnull __lhs, const char* _Nonnull __rhs) __attribute_pure__;
194size_t strxfrm(char* __BIONIC_COMPLICATED_NULLNESS __dst, const char* _Nonnull __src, size_t __n);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800195
Elliott Hughes655e4302023-06-16 12:39:33 -0700196int strcoll_l(const char* _Nonnull __lhs, const char* _Nonnull __rhs, locale_t _Nonnull __l) __attribute_pure__;
197size_t strxfrm_l(char* __BIONIC_COMPLICATED_NULLNESS __dst, const char* _Nonnull __src, size_t __n, locale_t _Nonnull __l);
Dan Albertdfb5ce42014-07-09 22:51:34 +0000198
Elliott Hughes09c39d62014-08-19 14:30:30 -0700199/*
200 * glibc has a basename in <string.h> that's different to the POSIX one in <libgen.h>.
201 * It doesn't modify its argument, and in C++ it's const-correct.
202 */
Elliott Hughes1749d212025-04-24 11:59:35 -0700203#if defined(__USE_GNU) && __BIONIC_AVAILABILITY_GUARD(23) && !defined(basename)
Elliott Hughes09c39d62014-08-19 14:30:30 -0700204#if defined(__cplusplus)
zijunzhao02c4ef42023-02-11 00:17:24 +0000205extern "C++" char* _Nonnull basename(char* _Nullable __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23);
206extern "C++" const char* _Nonnull basename(const char* _Nonnull __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23);
Elliott Hughes09c39d62014-08-19 14:30:30 -0700207#else
zijunzhao02c4ef42023-02-11 00:17:24 +0000208char* _Nonnull basename(const char* _Nonnull __path) __RENAME(__gnu_basename) __INTRODUCED_IN(23);
Elliott Hughes09c39d62014-08-19 14:30:30 -0700209#endif
Elliott Hughes09c39d62014-08-19 14:30:30 -0700210#endif
211
George Burgess IVb97049c2017-07-24 15:05:05 -0700212#if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS)
213#include <bits/fortify/string.h>
214#endif
Nick Kralevich0a230152012-06-04 15:20:25 -0700215
George Burgess IVbd3d2082017-04-04 17:34:02 -0700216/* Const-correct overloads. Placed after FORTIFY so we call those functions, if possible. */
Elliott Hughes0d1a8a52018-07-24 19:36:51 +0000217#if defined(__cplusplus)
George Burgess IV61b629d2024-08-07 10:51:06 -0600218/* libcxx tries to provide these. Suppress that, since libcxx's impl doesn't respect FORTIFY. */
219#define __CORRECT_ISO_CPP_STRING_H_PROTO
220/* Used to make these preferable over regular <string.h> signatures for overload resolution. */
221#define __prefer_this_overload __enable_if(true, "")
George Burgess IVbd3d2082017-04-04 17:34:02 -0700222extern "C++" {
223inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000224void* _Nullable __bionic_memchr(const void* _Nonnull const s __pass_object_size, int c, size_t n) {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700225 return memchr(s, c, n);
226}
227
228inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000229const void* _Nullable memchr(const void* _Nonnull const s __pass_object_size, int c, size_t n)
George Burgess IVbd3d2082017-04-04 17:34:02 -0700230 __prefer_this_overload {
231 return __bionic_memchr(s, c, n);
232}
233
234inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000235void* _Nullable memchr(void* _Nonnull const s __pass_object_size, int c, size_t n) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700236 return __bionic_memchr(s, c, n);
237}
238
239inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000240char* _Nullable __bionic_strchr(const char* _Nonnull const s __pass_object_size, int c) {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700241 return strchr(s, c);
242}
243
244inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000245const char* _Nullable strchr(const char* _Nonnull const s __pass_object_size, int c)
George Burgess IVbd3d2082017-04-04 17:34:02 -0700246 __prefer_this_overload {
247 return __bionic_strchr(s, c);
248}
249
250inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000251char* _Nullable strchr(char* _Nonnull const s __pass_object_size, int c)
George Burgess IVbd3d2082017-04-04 17:34:02 -0700252 __prefer_this_overload {
253 return __bionic_strchr(s, c);
254}
255
256inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000257char* _Nullable __bionic_strrchr(const char* _Nonnull const s __pass_object_size, int c) {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700258 return strrchr(s, c);
259}
260
261inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000262const char* _Nullable strrchr(const char* _Nonnull const s __pass_object_size, int c) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700263 return __bionic_strrchr(s, c);
264}
265
266inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000267char* _Nullable strrchr(char* _Nonnull const s __pass_object_size, int c) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700268 return __bionic_strrchr(s, c);
269}
270
271/* Functions with no FORTIFY counterpart. */
Elliott Hughes28d333b2025-04-25 08:19:37 -0700272
George Burgess IVbd3d2082017-04-04 17:34:02 -0700273inline __always_inline
Elliott Hughes28d333b2025-04-25 08:19:37 -0700274char* _Nullable __bionic_strcasestr(const char* _Nonnull h, const char* _Nonnull n) {
275 return strcasestr(h, n);
276}
277
278inline __always_inline
279const char* _Nullable strcasestr(const char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
280 return __bionic_strcasestr(h, n);
281}
282
283inline __always_inline
284char* _Nullable strcasestr(char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
285 return __bionic_strcasestr(h, n);
286}
287
288inline __always_inline
289char* _Nullable __bionic_strstr(const char* _Nonnull h, const char* _Nonnull n) {
290 return strstr(h, n);
291}
George Burgess IVbd3d2082017-04-04 17:34:02 -0700292
293inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000294const char* _Nullable strstr(const char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700295 return __bionic_strstr(h, n);
296}
297
298inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000299char* _Nullable strstr(char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700300 return __bionic_strstr(h, n);
301}
302
303inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000304char* _Nullable __bionic_strpbrk(const char* _Nonnull h, const char* _Nonnull n) { return strpbrk(h, n); }
George Burgess IVbd3d2082017-04-04 17:34:02 -0700305
306inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000307char* _Nullable strpbrk(char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700308 return __bionic_strpbrk(h, n);
309}
310
311inline __always_inline
zijunzhao02c4ef42023-02-11 00:17:24 +0000312const char* _Nullable strpbrk(const char* _Nonnull h, const char* _Nonnull n) __prefer_this_overload {
George Burgess IVbd3d2082017-04-04 17:34:02 -0700313 return __bionic_strpbrk(h, n);
314}
315}
316#undef __prefer_this_overload
317#endif
318
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800319__END_DECLS
320
Elliott Hughes684c31a2017-08-18 15:07:41 -0700321#endif