xref: /dflybsd-src/include/strings.h (revision c1f23d1610b93ad42bd3e047bbe0cfea888164cc)
1984263bcSMatthew Dillon /*-
2716024cdSPeter Avalos  * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
3716024cdSPeter Avalos  * All rights reserved.
4984263bcSMatthew Dillon  *
5984263bcSMatthew Dillon  * Redistribution and use in source and binary forms, with or without
6984263bcSMatthew Dillon  * modification, are permitted provided that the following conditions
7984263bcSMatthew Dillon  * are met:
8984263bcSMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
9984263bcSMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
10984263bcSMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
11984263bcSMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
12984263bcSMatthew Dillon  *    documentation and/or other materials provided with the distribution.
13984263bcSMatthew Dillon  *
14716024cdSPeter Avalos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15984263bcSMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16984263bcSMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17716024cdSPeter Avalos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18984263bcSMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19984263bcSMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20984263bcSMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21984263bcSMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22984263bcSMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23984263bcSMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24984263bcSMatthew Dillon  * SUCH DAMAGE.
25984263bcSMatthew Dillon  *
26716024cdSPeter Avalos  * $FreeBSD: src/include/strings.h,v 1.7 2008/11/03 10:22:19 kib Exp $
27984263bcSMatthew Dillon  */
28984263bcSMatthew Dillon 
29716024cdSPeter Avalos #ifndef _STRINGS_H_
30716024cdSPeter Avalos #define	_STRINGS_H_
31716024cdSPeter Avalos 
32716024cdSPeter Avalos #include <sys/cdefs.h>
3389393d93SSascha Wildner #include <machine/stdint.h>
34716024cdSPeter Avalos 
35716024cdSPeter Avalos #ifndef _SIZE_T_DECLARED
36716024cdSPeter Avalos typedef	__size_t	size_t;
37716024cdSPeter Avalos #define	_SIZE_T_DECLARED
38716024cdSPeter Avalos #endif
39716024cdSPeter Avalos 
40716024cdSPeter Avalos __BEGIN_DECLS
41716024cdSPeter Avalos #if !defined(_KERNEL_VIRTUAL)
42f85b95ddSSascha Wildner #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 700)
43716024cdSPeter Avalos int	 bcmp(const void *, const void *, size_t) __pure;	/* LEGACY */
44716024cdSPeter Avalos void	 bcopy(const void *, void *, size_t);			/* LEGACY */
45716024cdSPeter Avalos void	 bzero(void *, size_t);					/* LEGACY */
46f709978fSSascha Wildner #endif
47*c1f23d16Szrj #if __BSD_VISIBLE
48*c1f23d16Szrj void	 explicit_bzero(void *, size_t);
49*c1f23d16Szrj #endif
50716024cdSPeter Avalos int	 ffs(int) __pure2;
51716024cdSPeter Avalos #endif
52f33ef0a8SSascha Wildner #if __BSD_VISIBLE
53716024cdSPeter Avalos int	 ffsll(long long) __pure2;
54d557216fSMatthew Dillon #if !defined(_KERNEL_VIRTUAL)
550e6594a8SSascha Wildner int	 ffsl(long) __pure2;
56716024cdSPeter Avalos int	 fls(int) __pure2;
57716024cdSPeter Avalos int	 flsl(long) __pure2;
58716024cdSPeter Avalos int	 flsll(long long) __pure2;
59716024cdSPeter Avalos #endif
607ed2b0e1SSascha Wildner #endif
61716024cdSPeter Avalos #if !defined(_KERNEL_VIRTUAL)
62f85b95ddSSascha Wildner #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 700)
63716024cdSPeter Avalos char	*index(const char *, int) __pure;			/* LEGACY */
64716024cdSPeter Avalos char	*rindex(const char *, int) __pure;			/* LEGACY */
65f709978fSSascha Wildner #endif
66716024cdSPeter Avalos int	 strcasecmp(const char *, const char *) __pure;
67716024cdSPeter Avalos int	 strncasecmp(const char *, const char *, size_t) __pure;
68870c27eeSSascha Wildner #endif
695d704534SSascha Wildner 
705d704534SSascha Wildner #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
715d704534SSascha Wildner #include <xlocale/_strings.h>
725d704534SSascha Wildner #endif
73716024cdSPeter Avalos __END_DECLS
74716024cdSPeter Avalos 
75716024cdSPeter Avalos #endif /* _STRINGS_H_ */
76