xref: /freebsd/include/strings.h (revision cf8e5289a110954600f135024d1515a77d0ae34d)
159deaec5SRodney W. Grimes /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3e58eb3c4SPedro F. Giffuni  *
461b60edfSMike Barcroft  * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
561b60edfSMike Barcroft  * All rights reserved.
659deaec5SRodney W. Grimes  *
759deaec5SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
859deaec5SRodney W. Grimes  * modification, are permitted provided that the following conditions
959deaec5SRodney W. Grimes  * are met:
1059deaec5SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
1159deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
1259deaec5SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
1359deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
1459deaec5SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
1559deaec5SRodney W. Grimes  *
1661b60edfSMike Barcroft  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1759deaec5SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1859deaec5SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1961b60edfSMike Barcroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2059deaec5SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2159deaec5SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2259deaec5SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2359deaec5SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2459deaec5SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2559deaec5SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2659deaec5SRodney W. Grimes  * SUCH DAMAGE.
2759deaec5SRodney W. Grimes  */
2859deaec5SRodney W. Grimes 
2961b60edfSMike Barcroft #ifndef _STRINGS_H_
3061b60edfSMike Barcroft #define	_STRINGS_H_
3161b60edfSMike Barcroft 
3261b60edfSMike Barcroft #include <sys/cdefs.h>
33abbd8902SMike Barcroft #include <sys/_types.h>
3461b60edfSMike Barcroft 
35abbd8902SMike Barcroft #ifndef _SIZE_T_DECLARED
36abbd8902SMike Barcroft typedef	__size_t	size_t;
37abbd8902SMike Barcroft #define	_SIZE_T_DECLARED
3861b60edfSMike Barcroft #endif
3961b60edfSMike Barcroft 
40*cf8e5289SKyle Evans #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
41*cf8e5289SKyle Evans #include <ssp/strings.h>
42*cf8e5289SKyle Evans #endif
43*cf8e5289SKyle Evans 
4461b60edfSMike Barcroft __BEGIN_DECLS
45dad39763SDavid Schultz #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
46f0000ca0STim J. Robbins int	 bcmp(const void *, const void *, size_t) __pure;	/* LEGACY */
47*cf8e5289SKyle Evans void	 (bcopy)(const void *, void *, size_t);			/* LEGACY */
48*cf8e5289SKyle Evans void	 (bzero)(void *, size_t);				/* LEGACY */
49dad39763SDavid Schultz #endif
5078b59024SXin LI #if __BSD_VISIBLE
5178b59024SXin LI void	 explicit_bzero(void *, size_t);
5278b59024SXin LI #endif
53dad39763SDavid Schultz #if __XSI_VISIBLE
54f0000ca0STim J. Robbins int	 ffs(int) __pure2;
55dad39763SDavid Schultz #endif
56f40ea8b9SEd Schouten #if __BSD_VISIBLE
57f0000ca0STim J. Robbins int	 ffsl(long) __pure2;
584a723bd2SKonstantin Belousov int	 ffsll(long long) __pure2;
59f0000ca0STim J. Robbins int	 fls(int) __pure2;
60f0000ca0STim J. Robbins int	 flsl(long) __pure2;
614a723bd2SKonstantin Belousov int	 flsll(long long) __pure2;
62fd078b3dSDag-Erling Smørgrav #endif
63dad39763SDavid Schultz #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
64f0000ca0STim J. Robbins char	*index(const char *, int) __pure;			/* LEGACY */
65f0000ca0STim J. Robbins char	*rindex(const char *, int) __pure;			/* LEGACY */
66dad39763SDavid Schultz #endif
67f0000ca0STim J. Robbins int	 strcasecmp(const char *, const char *) __pure;
68f0000ca0STim J. Robbins int	 strncasecmp(const char *, const char *, size_t) __pure;
691bb07edbSPedro F. Giffuni 
701bb07edbSPedro F. Giffuni #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
711bb07edbSPedro F. Giffuni #include <xlocale/_strings.h>
721bb07edbSPedro F. Giffuni #endif
7361b60edfSMike Barcroft __END_DECLS
7461b60edfSMike Barcroft 
7561b60edfSMike Barcroft #endif /* _STRINGS_H_ */
76