1a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project/*	$NetBSD: strings.h,v 1.10 2005/02/03 04:39:32 perry Exp $	*/
2a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
3a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project/*-
4a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * Copyright (c) 1998 The NetBSD Foundation, Inc.
5a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * All rights reserved.
6a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *
7a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * This code is derived from software contributed to The NetBSD Foundation
8a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * by Klaus Klein.
9a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *
10a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * Redistribution and use in source and binary forms, with or without
11a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * modification, are permitted provided that the following conditions
12a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * are met:
13a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
14a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
15a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
16a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
17a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    documentation and/or other materials provided with the distribution.
18a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * 3. All advertising materials mentioning features or use of this software
19a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    must display the following acknowledgement:
20a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *        This product includes software developed by the NetBSD
21a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *        Foundation, Inc. and its contributors.
22a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * 4. Neither the name of The NetBSD Foundation nor the names of its
23a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    contributors may be used to endorse or promote products derived
24a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    from this software without specific prior written permission.
25a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *
26a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * POSSIBILITY OF SUCH DAMAGE.
37a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project */
38a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
39a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#ifndef _STRINGS_H_
40a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#define _STRINGS_H_
41a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
4270f1280ca9ccbf211da5514f01a77fad54e546a4Martin Storsjo#include <sys/types.h>
43a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#include <sys/cdefs.h>
44b20c24456e43df430ec5626a68e5dc0dc6929344Elliott Hughes#include <xlocale.h>
45a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
46c3cec27ad75544fdd1a5efc78260404a7de564bfJosh Gao#include <bits/strcasecmp.h>
47c3cec27ad75544fdd1a5efc78260404a7de564bfJosh Gao
48a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project__BEGIN_DECLS
498ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert#if defined(__BIONIC_FORTIFY)
50b20c24456e43df430ec5626a68e5dc0dc6929344Elliott Hughes#define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
51b20c24456e43df430ec5626a68e5dc0dc6929344Elliott Hughes#define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
528ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert#else
538ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert#define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
548ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert#define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
558ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert#endif
568ca440089f37a11260a8a765acf50fb38fa08da4Dan Albert
578f5608b614b7908f4edde20a5461e46d4b080d9aElliott Hughes#if !defined(__i386__) || __ANDROID_API__ >= __ANDROID_API_J_MR2__
5846b44160e9e4c466be0faf1bb8d6ec70ecc83273Josh Gaoint ffs(int) __INTRODUCED_IN_X86(18);
598f5608b614b7908f4edde20a5461e46d4b080d9aElliott Hughes#endif
60ce9ce28e5d760e32ab6c894dfaf7b8dad6de7ff6Dan Albert
61a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project__END_DECLS
62a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
638f5608b614b7908f4edde20a5461e46d4b080d9aElliott Hughes#include <android/legacy_strings_inlines.h>
648f5608b614b7908f4edde20a5461e46d4b080d9aElliott Hughes
65a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#endif /* !defined(_STRINGS_H_) */
66