string.h revision 152754
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 152754 2005-11-24 08:30:44Z ru $
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
58105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
59105128Smikevoid	*memccpy(void * __restrict, const void * __restrict, int, size_t);
60105128Smike#endif
61132564Stjrvoid	*memchr(const void *, int, size_t) __pure;
62132564Stjrint	 memcmp(const void *, const void *, size_t) __pure;
6393747Smikevoid	*memcpy(void * __restrict, const void * __restrict, size_t);
64149469Sandre#if __BSD_VISIBLE
65149466Sandrevoid	*memmem(const void *, size_t, const void *, size_t);
66149469Sandre#endif
6793032Simpvoid	*memmove(void *, const void *, size_t);
6893032Simpvoid	*memset(void *, int, size_t);
69105128Smike#if __BSD_VISIBLE
70105128Smikechar	*stpcpy(char *, const char *);
71132564Stjrchar	*strcasestr(const char *, const char *) __pure;
72105128Smike#endif
7393747Smikechar	*strcat(char * __restrict, const char * __restrict);
74132564Stjrchar	*strchr(const char *, int) __pure;
75132564Stjrint	 strcmp(const char *, const char *) __pure;
7693032Simpint	 strcoll(const char *, const char *);
7793747Smikechar	*strcpy(char * __restrict, const char * __restrict);
78132564Stjrsize_t	 strcspn(const char *, const char *) __pure;
79105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
80105128Smikechar	*strdup(const char *);
81105128Smike#endif
8293032Simpchar	*strerror(int);
83105128Smike#if __POSIX_VISIBLE >= 200112
84105128Smikeint	 strerror_r(int, char *, size_t);
85105128Smike#endif
86105128Smike#if __BSD_VISIBLE
87105128Smikesize_t	 strlcat(char *, const char *, size_t);
88105128Smikesize_t	 strlcpy(char *, const char *, size_t);
89105128Smike#endif
90132564Stjrsize_t	 strlen(const char *) __pure;
91105128Smike#if __BSD_VISIBLE
92152754Sruvoid	 strmode(int, char *);
93105128Smike#endif
9493747Smikechar	*strncat(char * __restrict, const char * __restrict, size_t);
95132564Stjrint	 strncmp(const char *, const char *, size_t) __pure;
9693747Smikechar	*strncpy(char * __restrict, const char * __restrict, size_t);
97105128Smike#if __BSD_VISIBLE
98132564Stjrchar	*strnstr(const char *, const char *, size_t) __pure;
99105128Smike#endif
100132564Stjrchar	*strpbrk(const char *, const char *) __pure;
101132564Stjrchar	*strrchr(const char *, int) __pure;
102105128Smike#if __BSD_VISIBLE
103105128Smikechar	*strsep(char **, const char *);
104105128Smikechar	*strsignal(int);
105105128Smike#endif
106132564Stjrsize_t	 strspn(const char *, const char *) __pure;
107132564Stjrchar	*strstr(const char *, const char *) __pure;
10893747Smikechar	*strtok(char * __restrict, const char * __restrict);
109105128Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
11093747Smikechar	*strtok_r(char *, const char *, char **);
11193747Smike#endif
112105128Smikesize_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
11393747Smike#if __BSD_VISIBLE
114138659Strhodes
115138659Strhodes#ifndef _SWAB_DECLARED
116138659Strhodes#define _SWAB_DECLARED
117138659Strhodes
118138659Strhodes#ifndef _SSIZE_T_DECLARED
119138659Strhodestypedef	__ssize_t	ssize_t;
120138659Strhodes#define	_SSIZE_T_DECLARED
121138659Strhodes#endif /* _SIZE_T_DECLARED */
122138659Strhodes
123138659Strhodesvoid	 swab(const void * __restrict, void * __restrict, ssize_t);
124138659Strhodes#endif /* _SWAB_DECLARED */
125138659Strhodes
126138659Strhodes#endif /* __BSD_VISIBLE */
1271539Srgrimes__END_DECLS
1281539Srgrimes
1291539Srgrimes#endif /* _STRING_H_ */
130