11539Srgrimes/*-
21539Srgrimes * Copyright (c) 1990, 1993
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
13203964Simp * 3. Neither the name of the University nor the names of its contributors
141539Srgrimes *    may be used to endorse or promote products derived from this software
151539Srgrimes *    without specific prior written permission.
161539Srgrimes *
171539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271539Srgrimes * SUCH DAMAGE.
281539Srgrimes *
2984747Sbde *	@(#)string.h	8.1 (Berkeley) 6/2/93
3084699Smike * $FreeBSD$
311539Srgrimes */
321539Srgrimes
331539Srgrimes#ifndef _STRING_H_
341539Srgrimes#define	_STRING_H_
3593747Smike
3693747Smike#include <sys/cdefs.h>
37123257Smarcel#include <sys/_null.h>
38102227Smike#include <sys/_types.h>
391539Srgrimes
4093747Smike/*
4193747Smike * Prototype functions which were historically defined in <string.h>, but
4293747Smike * are required by POSIX to be prototyped in <strings.h>.
4393747Smike */
4493747Smike#if __BSD_VISIBLE
4593747Smike#include <strings.h>
4693747Smike#endif
4793747Smike
48102227Smike#ifndef _SIZE_T_DECLARED
49102227Smiketypedef	__size_t	size_t;
50102227Smike#define	_SIZE_T_DECLARED
511539Srgrimes#endif
521539Srgrimes
531539Srgrimes__BEGIN_DECLS
54189809Sdas#if __XSI_VISIBLE >= 600
55105128Smikevoid	*memccpy(void * __restrict, const void * __restrict, int, size_t);
56105128Smike#endif
57132564Stjrvoid	*memchr(const void *, int, size_t) __pure;
58189809Sdas#if __BSD_VISIBLE
59178051Sdelphijvoid	*memrchr(const void *, int, size_t) __pure;
60189809Sdas#endif
61132564Stjrint	 memcmp(const void *, const void *, size_t) __pure;
6293747Smikevoid	*memcpy(void * __restrict, const void * __restrict, size_t);
63149469Sandre#if __BSD_VISIBLE
64189132Sdasvoid	*memmem(const void *, size_t, const void *, size_t) __pure;
65149469Sandre#endif
6693032Simpvoid	*memmove(void *, const void *, size_t);
6793032Simpvoid	*memset(void *, int, size_t);
68189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
69189136Sdaschar	*stpcpy(char * __restrict, const char * __restrict);
70189136Sdaschar	*stpncpy(char * __restrict, const char * __restrict, size_t);
71189136Sdas#endif
72105128Smike#if __BSD_VISIBLE
73132564Stjrchar	*strcasestr(const char *, const char *) __pure;
74105128Smike#endif
7593747Smikechar	*strcat(char * __restrict, const char * __restrict);
76132564Stjrchar	*strchr(const char *, int) __pure;
77132564Stjrint	 strcmp(const char *, const char *) __pure;
7893032Simpint	 strcoll(const char *, const char *);
7993747Smikechar	*strcpy(char * __restrict, const char * __restrict);
80132564Stjrsize_t	 strcspn(const char *, const char *) __pure;
81105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
82187961Sdaschar	*strdup(const char *) __malloc_like;
83105128Smike#endif
8493032Simpchar	*strerror(int);
85105128Smike#if __POSIX_VISIBLE >= 200112
86105128Smikeint	 strerror_r(int, char *, size_t);
87105128Smike#endif
88105128Smike#if __BSD_VISIBLE
89189133Sdassize_t	 strlcat(char * __restrict, const char * __restrict, size_t);
90189133Sdassize_t	 strlcpy(char * __restrict, const char * __restrict, size_t);
91105128Smike#endif
92132564Stjrsize_t	 strlen(const char *) __pure;
93105128Smike#if __BSD_VISIBLE
94152754Sruvoid	 strmode(int, char *);
95105128Smike#endif
9693747Smikechar	*strncat(char * __restrict, const char * __restrict, size_t);
97132564Stjrint	 strncmp(const char *, const char *, size_t) __pure;
9893747Smikechar	*strncpy(char * __restrict, const char * __restrict, size_t);
99189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
100189136Sdaschar	*strndup(const char *, size_t) __malloc_like;
101189136Sdassize_t	 strnlen(const char *, size_t) __pure;
102189136Sdas#endif
103105128Smike#if __BSD_VISIBLE
104132564Stjrchar	*strnstr(const char *, const char *, size_t) __pure;
105105128Smike#endif
106132564Stjrchar	*strpbrk(const char *, const char *) __pure;
107132564Stjrchar	*strrchr(const char *, int) __pure;
108105128Smike#if __BSD_VISIBLE
109105128Smikechar	*strsep(char **, const char *);
110189136Sdas#endif
111189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
112105128Smikechar	*strsignal(int);
113105128Smike#endif
114132564Stjrsize_t	 strspn(const char *, const char *) __pure;
115132564Stjrchar	*strstr(const char *, const char *) __pure;
11693747Smikechar	*strtok(char * __restrict, const char * __restrict);
117105128Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
11893747Smikechar	*strtok_r(char *, const char *, char **);
11993747Smike#endif
120105128Smikesize_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
12193747Smike#if __BSD_VISIBLE
122138659Strhodes
123138659Strhodes#ifndef _SWAB_DECLARED
124138659Strhodes#define _SWAB_DECLARED
125138659Strhodes
126138659Strhodes#ifndef _SSIZE_T_DECLARED
127138659Strhodestypedef	__ssize_t	ssize_t;
128138659Strhodes#define	_SSIZE_T_DECLARED
129138659Strhodes#endif /* _SIZE_T_DECLARED */
130138659Strhodes
131138659Strhodesvoid	 swab(const void * __restrict, void * __restrict, ssize_t);
132138659Strhodes#endif /* _SWAB_DECLARED */
133138659Strhodes
134138659Strhodes#endif /* __BSD_VISIBLE */
135235785Stheraven
136235785Stheraven#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
137235785Stheraven#include <xlocale/_string.h>
138235785Stheraven#endif
1391539Srgrimes__END_DECLS
1401539Srgrimes
1411539Srgrimes#endif /* _STRING_H_ */
142