xref: /titanic_51/usr/src/boot/include/string.h (revision 4a5d661a82b942b6538acd26209d959ce98b593a)
1*4a5d661aSToomas Soome /*-
2*4a5d661aSToomas Soome  * Copyright (c) 1990, 1993
3*4a5d661aSToomas Soome  *	The Regents of the University of California.  All rights reserved.
4*4a5d661aSToomas Soome  *
5*4a5d661aSToomas Soome  * Redistribution and use in source and binary forms, with or without
6*4a5d661aSToomas Soome  * modification, are permitted provided that the following conditions
7*4a5d661aSToomas Soome  * are met:
8*4a5d661aSToomas Soome  * 1. Redistributions of source code must retain the above copyright
9*4a5d661aSToomas Soome  *    notice, this list of conditions and the following disclaimer.
10*4a5d661aSToomas Soome  * 2. Redistributions in binary form must reproduce the above copyright
11*4a5d661aSToomas Soome  *    notice, this list of conditions and the following disclaimer in the
12*4a5d661aSToomas Soome  *    documentation and/or other materials provided with the distribution.
13*4a5d661aSToomas Soome  * 3. Neither the name of the University nor the names of its contributors
14*4a5d661aSToomas Soome  *    may be used to endorse or promote products derived from this software
15*4a5d661aSToomas Soome  *    without specific prior written permission.
16*4a5d661aSToomas Soome  *
17*4a5d661aSToomas Soome  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*4a5d661aSToomas Soome  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*4a5d661aSToomas Soome  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*4a5d661aSToomas Soome  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*4a5d661aSToomas Soome  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*4a5d661aSToomas Soome  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*4a5d661aSToomas Soome  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*4a5d661aSToomas Soome  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*4a5d661aSToomas Soome  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*4a5d661aSToomas Soome  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*4a5d661aSToomas Soome  * SUCH DAMAGE.
28*4a5d661aSToomas Soome  *
29*4a5d661aSToomas Soome  *	@(#)string.h	8.1 (Berkeley) 6/2/93
30*4a5d661aSToomas Soome  * $FreeBSD$
31*4a5d661aSToomas Soome  */
32*4a5d661aSToomas Soome 
33*4a5d661aSToomas Soome #ifndef _STRING_H_
34*4a5d661aSToomas Soome #define	_STRING_H_
35*4a5d661aSToomas Soome 
36*4a5d661aSToomas Soome #include <sys/cdefs.h>
37*4a5d661aSToomas Soome #include <sys/_null.h>
38*4a5d661aSToomas Soome #include <sys/_types.h>
39*4a5d661aSToomas Soome 
40*4a5d661aSToomas Soome /*
41*4a5d661aSToomas Soome  * Prototype functions which were historically defined in <string.h>, but
42*4a5d661aSToomas Soome  * are required by POSIX to be prototyped in <strings.h>.
43*4a5d661aSToomas Soome  */
44*4a5d661aSToomas Soome #if __BSD_VISIBLE
45*4a5d661aSToomas Soome #include <strings.h>
46*4a5d661aSToomas Soome #endif
47*4a5d661aSToomas Soome 
48*4a5d661aSToomas Soome #ifndef _SIZE_T_DECLARED
49*4a5d661aSToomas Soome typedef	__size_t	size_t;
50*4a5d661aSToomas Soome #define	_SIZE_T_DECLARED
51*4a5d661aSToomas Soome #endif
52*4a5d661aSToomas Soome 
53*4a5d661aSToomas Soome __BEGIN_DECLS
54*4a5d661aSToomas Soome #if __XSI_VISIBLE >= 600
55*4a5d661aSToomas Soome void	*memccpy(void * __restrict, const void * __restrict, int, size_t);
56*4a5d661aSToomas Soome #endif
57*4a5d661aSToomas Soome void	*memchr(const void *, int, size_t) __pure;
58*4a5d661aSToomas Soome #if __BSD_VISIBLE
59*4a5d661aSToomas Soome void	*memrchr(const void *, int, size_t) __pure;
60*4a5d661aSToomas Soome #endif
61*4a5d661aSToomas Soome int	 memcmp(const void *, const void *, size_t) __pure;
62*4a5d661aSToomas Soome void	*memcpy(void * __restrict, const void * __restrict, size_t);
63*4a5d661aSToomas Soome #if __BSD_VISIBLE
64*4a5d661aSToomas Soome void	*memmem(const void *, size_t, const void *, size_t) __pure;
65*4a5d661aSToomas Soome #endif
66*4a5d661aSToomas Soome void	*memmove(void *, const void *, size_t);
67*4a5d661aSToomas Soome void	*memset(void *, int, size_t);
68*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809
69*4a5d661aSToomas Soome char	*stpcpy(char * __restrict, const char * __restrict);
70*4a5d661aSToomas Soome char	*stpncpy(char * __restrict, const char * __restrict, size_t);
71*4a5d661aSToomas Soome #endif
72*4a5d661aSToomas Soome #if __BSD_VISIBLE
73*4a5d661aSToomas Soome char	*strcasestr(const char *, const char *) __pure;
74*4a5d661aSToomas Soome #endif
75*4a5d661aSToomas Soome char	*strcat(char * __restrict, const char * __restrict);
76*4a5d661aSToomas Soome char	*strchr(const char *, int) __pure;
77*4a5d661aSToomas Soome #if __BSD_VISIBLE
78*4a5d661aSToomas Soome char	*strchrnul(const char*, int) __pure;
79*4a5d661aSToomas Soome #endif
80*4a5d661aSToomas Soome int	 strcmp(const char *, const char *) __pure;
81*4a5d661aSToomas Soome int	 strcoll(const char *, const char *);
82*4a5d661aSToomas Soome char	*strcpy(char * __restrict, const char * __restrict);
83*4a5d661aSToomas Soome size_t	 strcspn(const char *, const char *) __pure;
84*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
85*4a5d661aSToomas Soome char	*strdup(const char *) __malloc_like;
86*4a5d661aSToomas Soome #endif
87*4a5d661aSToomas Soome char	*strerror(int);
88*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200112
89*4a5d661aSToomas Soome int	 strerror_r(int, char *, size_t);
90*4a5d661aSToomas Soome #endif
91*4a5d661aSToomas Soome #if __BSD_VISIBLE
92*4a5d661aSToomas Soome size_t	 strlcat(char * __restrict, const char * __restrict, size_t);
93*4a5d661aSToomas Soome size_t	 strlcpy(char * __restrict, const char * __restrict, size_t);
94*4a5d661aSToomas Soome #endif
95*4a5d661aSToomas Soome size_t	 strlen(const char *) __pure;
96*4a5d661aSToomas Soome #if __BSD_VISIBLE
97*4a5d661aSToomas Soome void	 strmode(int, char *);
98*4a5d661aSToomas Soome #endif
99*4a5d661aSToomas Soome char	*strncat(char * __restrict, const char * __restrict, size_t);
100*4a5d661aSToomas Soome int	 strncmp(const char *, const char *, size_t) __pure;
101*4a5d661aSToomas Soome char	*strncpy(char * __restrict, const char * __restrict, size_t);
102*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809
103*4a5d661aSToomas Soome char	*strndup(const char *, size_t) __malloc_like;
104*4a5d661aSToomas Soome size_t	 strnlen(const char *, size_t) __pure;
105*4a5d661aSToomas Soome #endif
106*4a5d661aSToomas Soome #if __BSD_VISIBLE
107*4a5d661aSToomas Soome char	*strnstr(const char *, const char *, size_t) __pure;
108*4a5d661aSToomas Soome #endif
109*4a5d661aSToomas Soome char	*strpbrk(const char *, const char *) __pure;
110*4a5d661aSToomas Soome char	*strrchr(const char *, int) __pure;
111*4a5d661aSToomas Soome #if __BSD_VISIBLE
112*4a5d661aSToomas Soome char	*strsep(char **, const char *);
113*4a5d661aSToomas Soome #endif
114*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809
115*4a5d661aSToomas Soome char	*strsignal(int);
116*4a5d661aSToomas Soome #endif
117*4a5d661aSToomas Soome size_t	 strspn(const char *, const char *) __pure;
118*4a5d661aSToomas Soome char	*strstr(const char *, const char *) __pure;
119*4a5d661aSToomas Soome char	*strtok(char * __restrict, const char * __restrict);
120*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
121*4a5d661aSToomas Soome char	*strtok_r(char *, const char *, char **);
122*4a5d661aSToomas Soome #endif
123*4a5d661aSToomas Soome size_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
124*4a5d661aSToomas Soome #if __BSD_VISIBLE
125*4a5d661aSToomas Soome 
126*4a5d661aSToomas Soome #ifndef _SWAB_DECLARED
127*4a5d661aSToomas Soome #define _SWAB_DECLARED
128*4a5d661aSToomas Soome 
129*4a5d661aSToomas Soome #ifndef _SSIZE_T_DECLARED
130*4a5d661aSToomas Soome typedef	__ssize_t	ssize_t;
131*4a5d661aSToomas Soome #define	_SSIZE_T_DECLARED
132*4a5d661aSToomas Soome #endif /* _SIZE_T_DECLARED */
133*4a5d661aSToomas Soome 
134*4a5d661aSToomas Soome void	 swab(const void * __restrict, void * __restrict, ssize_t);
135*4a5d661aSToomas Soome #endif /* _SWAB_DECLARED */
136*4a5d661aSToomas Soome 
137*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE */
138*4a5d661aSToomas Soome 
139*4a5d661aSToomas Soome #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
140*4a5d661aSToomas Soome #include <xlocale/_string.h>
141*4a5d661aSToomas Soome #endif
142*4a5d661aSToomas Soome __END_DECLS
143*4a5d661aSToomas Soome 
144*4a5d661aSToomas Soome #endif /* _STRING_H_ */
145