string.h revision 102227
1249261Sdim/*-
2249261Sdim * Copyright (c) 1990, 1993
3249261Sdim *	The Regents of the University of California.  All rights reserved.
4249261Sdim *
5249261Sdim * Redistribution and use in source and binary forms, with or without
6249261Sdim * modification, are permitted provided that the following conditions
7249261Sdim * are met:
8249261Sdim * 1. Redistributions of source code must retain the above copyright
9249261Sdim *    notice, this list of conditions and the following disclaimer.
10249261Sdim * 2. Redistributions in binary form must reproduce the above copyright
11249261Sdim *    notice, this list of conditions and the following disclaimer in the
12249261Sdim *    documentation and/or other materials provided with the distribution.
13249261Sdim * 3. All advertising materials mentioning features or use of this software
14249261Sdim *    must display the following acknowledgement:
15249261Sdim *	This product includes software developed by the University of
16249261Sdim *	California, Berkeley and its contributors.
17249261Sdim * 4. Neither the name of the University nor the names of its contributors
18249261Sdim *    may be used to endorse or promote products derived from this software
19249261Sdim *    without specific prior written permission.
20249261Sdim *
21249261Sdim * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22249261Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23249261Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24249261Sdim * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25249261Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26249261Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27249261Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28249261Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29249261Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30249261Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31249261Sdim * SUCH DAMAGE.
32249261Sdim *
33249261Sdim *	@(#)string.h	8.1 (Berkeley) 6/2/93
34249261Sdim * $FreeBSD: head/include/string.h 102227 2002-08-21 16:20:02Z mike $
35249261Sdim */
36249261Sdim
37249261Sdim#ifndef _STRING_H_
38249261Sdim#define	_STRING_H_
39249261Sdim
40249261Sdim#include <sys/cdefs.h>
41249261Sdim#include <sys/_types.h>
42249261Sdim
43249261Sdim/*
44249261Sdim * Prototype functions which were historically defined in <string.h>, but
45249261Sdim * are required by POSIX to be prototyped in <strings.h>.
46249261Sdim */
47249261Sdim#if __BSD_VISIBLE
48249261Sdim#include <strings.h>
49249261Sdim#endif
50249261Sdim
51249261Sdim#ifndef _SIZE_T_DECLARED
52249261Sdimtypedef	__size_t	size_t;
53249261Sdim#define	_SIZE_T_DECLARED
54249261Sdim#endif
55249261Sdim
56249261Sdim#ifndef	NULL
57249261Sdim#define	NULL	0
58249261Sdim#endif
59249261Sdim
60249261Sdim__BEGIN_DECLS
61249261Sdimvoid	*memchr(const void *, int, size_t);
62249261Sdimint	 memcmp(const void *, const void *, size_t);
63249261Sdimvoid	*memcpy(void * __restrict, const void * __restrict, size_t);
64249261Sdimvoid	*memmove(void *, const void *, size_t);
65249261Sdimvoid	*memset(void *, int, size_t);
66249261Sdimchar	*strcat(char * __restrict, const char * __restrict);
67249261Sdimchar	*strchr(const char *, int);
68249261Sdimint	 strcmp(const char *, const char *);
69249261Sdimint	 strcoll(const char *, const char *);
70249261Sdimchar	*strcpy(char * __restrict, const char * __restrict);
71249261Sdimsize_t	 strcspn(const char *, const char *);
72249261Sdimchar	*strerror(int);
73249261Sdimsize_t	 strlen(const char *);
74249261Sdimchar	*strncat(char * __restrict, const char * __restrict, size_t);
75249261Sdimint	 strncmp(const char *, const char *, size_t);
76249261Sdimchar	*strncpy(char * __restrict, const char * __restrict, size_t);
77249261Sdimchar	*strpbrk(const char *, const char *);
78249261Sdimchar	*strrchr(const char *, int);
79249261Sdimsize_t	 strspn(const char *, const char *);
80249261Sdimchar	*strstr(const char *, const char *);
81249261Sdimchar	*strtok(char * __restrict, const char * __restrict);
82249261Sdimsize_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
83249261Sdim
84249261Sdim#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
85249261Sdimvoid	*memccpy(void * __restrict, const void * __restrict, int, size_t);
86249261Sdimchar	*strdup(const char *);
87249261Sdimchar	*strtok_r(char *, const char *, char **);
88249261Sdim#endif
89249261Sdim
90249261Sdim#if __POSIX_VISIBLE >= 200112
91249261Sdimint	 strerror_r(int, char *, size_t);
92249261Sdim#endif
93249261Sdim
94249261Sdim#if __BSD_VISIBLE
95249261Sdimchar	*strcasestr(const char *, const char *);
96249261Sdimsize_t	 strlcat(char *, const char *, size_t);
97249261Sdimsize_t	 strlcpy(char *, const char *, size_t);
98249261Sdimvoid	 strmode(int, char *);
99249261Sdimchar	*strnstr(const char *, const char *, size_t);
100249261Sdimchar	*strsep(char **, const char *);
101249261Sdimchar	*strsignal(int);
102249261Sdimvoid	 swab(const void *, void *, size_t);
103249261Sdim#endif
104249261Sdim__END_DECLS
105249261Sdim
106249261Sdim#endif /* _STRING_H_ */
107249261Sdim