string.h revision 189809
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.
131539Srgrimes * 3. All advertising materials mentioning features or use of this software
141539Srgrimes *    must display the following acknowledgement:
151539Srgrimes *	This product includes software developed by the University of
161539Srgrimes *	California, Berkeley and its contributors.
171539Srgrimes * 4. Neither the name of the University nor the names of its contributors
181539Srgrimes *    may be used to endorse or promote products derived from this software
191539Srgrimes *    without specific prior written permission.
201539Srgrimes *
211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311539Srgrimes * SUCH DAMAGE.
321539Srgrimes *
3384747Sbde *	@(#)string.h	8.1 (Berkeley) 6/2/93
3484699Smike * $FreeBSD: head/include/string.h 189809 2009-03-14 19:03:34Z das $
351539Srgrimes */
361539Srgrimes
371539Srgrimes#ifndef _STRING_H_
381539Srgrimes#define	_STRING_H_
3993747Smike
4093747Smike#include <sys/cdefs.h>
41123257Smarcel#include <sys/_null.h>
42102227Smike#include <sys/_types.h>
431539Srgrimes
4493747Smike/*
4593747Smike * Prototype functions which were historically defined in <string.h>, but
4693747Smike * are required by POSIX to be prototyped in <strings.h>.
4793747Smike */
4893747Smike#if __BSD_VISIBLE
4993747Smike#include <strings.h>
5093747Smike#endif
5193747Smike
52102227Smike#ifndef _SIZE_T_DECLARED
53102227Smiketypedef	__size_t	size_t;
54102227Smike#define	_SIZE_T_DECLARED
551539Srgrimes#endif
561539Srgrimes
571539Srgrimes__BEGIN_DECLS
58189809Sdas#if __XSI_VISIBLE >= 600
59105128Smikevoid	*memccpy(void * __restrict, const void * __restrict, int, size_t);
60105128Smike#endif
61132564Stjrvoid	*memchr(const void *, int, size_t) __pure;
62189809Sdas#if __BSD_VISIBLE
63178051Sdelphijvoid	*memrchr(const void *, int, size_t) __pure;
64189809Sdas#endif
65132564Stjrint	 memcmp(const void *, const void *, size_t) __pure;
6693747Smikevoid	*memcpy(void * __restrict, const void * __restrict, size_t);
67149469Sandre#if __BSD_VISIBLE
68189132Sdasvoid	*memmem(const void *, size_t, const void *, size_t) __pure;
69149469Sandre#endif
7093032Simpvoid	*memmove(void *, const void *, size_t);
7193032Simpvoid	*memset(void *, int, size_t);
72189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
73189136Sdaschar	*stpcpy(char * __restrict, const char * __restrict);
74189136Sdaschar	*stpncpy(char * __restrict, const char * __restrict, size_t);
75189136Sdas#endif
76105128Smike#if __BSD_VISIBLE
77132564Stjrchar	*strcasestr(const char *, const char *) __pure;
78105128Smike#endif
7993747Smikechar	*strcat(char * __restrict, const char * __restrict);
80132564Stjrchar	*strchr(const char *, int) __pure;
81132564Stjrint	 strcmp(const char *, const char *) __pure;
8293032Simpint	 strcoll(const char *, const char *);
8393747Smikechar	*strcpy(char * __restrict, const char * __restrict);
84132564Stjrsize_t	 strcspn(const char *, const char *) __pure;
85105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
86187961Sdaschar	*strdup(const char *) __malloc_like;
87105128Smike#endif
8893032Simpchar	*strerror(int);
89105128Smike#if __POSIX_VISIBLE >= 200112
90105128Smikeint	 strerror_r(int, char *, size_t);
91105128Smike#endif
92105128Smike#if __BSD_VISIBLE
93189133Sdassize_t	 strlcat(char * __restrict, const char * __restrict, size_t);
94189133Sdassize_t	 strlcpy(char * __restrict, const char * __restrict, size_t);
95105128Smike#endif
96132564Stjrsize_t	 strlen(const char *) __pure;
97105128Smike#if __BSD_VISIBLE
98152754Sruvoid	 strmode(int, char *);
99105128Smike#endif
10093747Smikechar	*strncat(char * __restrict, const char * __restrict, size_t);
101132564Stjrint	 strncmp(const char *, const char *, size_t) __pure;
10293747Smikechar	*strncpy(char * __restrict, const char * __restrict, size_t);
103189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
104189136Sdaschar	*strndup(const char *, size_t) __malloc_like;
105189136Sdassize_t	 strnlen(const char *, size_t) __pure;
106189136Sdas#endif
107105128Smike#if __BSD_VISIBLE
108132564Stjrchar	*strnstr(const char *, const char *, size_t) __pure;
109105128Smike#endif
110132564Stjrchar	*strpbrk(const char *, const char *) __pure;
111132564Stjrchar	*strrchr(const char *, int) __pure;
112105128Smike#if __BSD_VISIBLE
113105128Smikechar	*strsep(char **, const char *);
114189136Sdas#endif
115189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
116105128Smikechar	*strsignal(int);
117105128Smike#endif
118132564Stjrsize_t	 strspn(const char *, const char *) __pure;
119132564Stjrchar	*strstr(const char *, const char *) __pure;
12093747Smikechar	*strtok(char * __restrict, const char * __restrict);
121105128Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
12293747Smikechar	*strtok_r(char *, const char *, char **);
12393747Smike#endif
124105128Smikesize_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
12593747Smike#if __BSD_VISIBLE
126138659Strhodes
127138659Strhodes#ifndef _SWAB_DECLARED
128138659Strhodes#define _SWAB_DECLARED
129138659Strhodes
130138659Strhodes#ifndef _SSIZE_T_DECLARED
131138659Strhodestypedef	__ssize_t	ssize_t;
132138659Strhodes#define	_SSIZE_T_DECLARED
133138659Strhodes#endif /* _SIZE_T_DECLARED */
134138659Strhodes
135138659Strhodesvoid	 swab(const void * __restrict, void * __restrict, ssize_t);
136138659Strhodes#endif /* _SWAB_DECLARED */
137138659Strhodes
138138659Strhodes#endif /* __BSD_VISIBLE */
1391539Srgrimes__END_DECLS
1401539Srgrimes
1411539Srgrimes#endif /* _STRING_H_ */
142