string.h revision 232498
1223695Sdfr/*-
2223695Sdfr * Copyright (c) 1990, 1993
3223695Sdfr *	The Regents of the University of California.  All rights reserved.
4223695Sdfr *
5223695Sdfr * Redistribution and use in source and binary forms, with or without
6223695Sdfr * modification, are permitted provided that the following conditions
7223695Sdfr * are met:
8223695Sdfr * 1. Redistributions of source code must retain the above copyright
9223695Sdfr *    notice, this list of conditions and the following disclaimer.
10223695Sdfr * 2. Redistributions in binary form must reproduce the above copyright
11223695Sdfr *    notice, this list of conditions and the following disclaimer in the
12223695Sdfr *    documentation and/or other materials provided with the distribution.
13223695Sdfr * 3. Neither the name of the University nor the names of its contributors
14223695Sdfr *    may be used to endorse or promote products derived from this software
15223695Sdfr *    without specific prior written permission.
16223695Sdfr *
17223695Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18223695Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19223695Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20223695Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21223695Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22223695Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23223695Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24223695Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25223695Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26223695Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27223695Sdfr * SUCH DAMAGE.
28223695Sdfr *
29223695Sdfr *	@(#)string.h	8.1 (Berkeley) 6/2/93
30223695Sdfr * $FreeBSD: head/include/string.h 232498 2012-03-04 15:31:13Z theraven $
31223695Sdfr */
32223695Sdfr
33223695Sdfr#ifndef _STRING_H_
34223695Sdfr#define	_STRING_H_
35223695Sdfr
36223695Sdfr#include <sys/cdefs.h>
37223695Sdfr#include <sys/_null.h>
38223695Sdfr#include <sys/_types.h>
39223695Sdfr
40223695Sdfr/*
41223695Sdfr * Prototype functions which were historically defined in <string.h>, but
42223695Sdfr * are required by POSIX to be prototyped in <strings.h>.
43223695Sdfr */
44223695Sdfr#if __BSD_VISIBLE
45223695Sdfr#include <strings.h>
46223695Sdfr#endif
47223695Sdfr
48223695Sdfr#ifndef _SIZE_T_DECLARED
49223695Sdfrtypedef	__size_t	size_t;
50223695Sdfr#define	_SIZE_T_DECLARED
51223695Sdfr#endif
52223695Sdfr
53223695Sdfr__BEGIN_DECLS
54223695Sdfr#if __XSI_VISIBLE >= 600
55223695Sdfrvoid	*memccpy(void * __restrict, const void * __restrict, int, size_t);
56223695Sdfr#endif
57223695Sdfrvoid	*memchr(const void *, int, size_t) __pure;
58223695Sdfr#if __BSD_VISIBLE
59223695Sdfrvoid	*memrchr(const void *, int, size_t) __pure;
60223695Sdfr#endif
61223695Sdfrint	 memcmp(const void *, const void *, size_t) __pure;
62223695Sdfrvoid	*memcpy(void * __restrict, const void * __restrict, size_t);
63223695Sdfr#if __BSD_VISIBLE
64223695Sdfrvoid	*memmem(const void *, size_t, const void *, size_t) __pure;
65223695Sdfr#endif
66223695Sdfrvoid	*memmove(void *, const void *, size_t);
67223695Sdfrvoid	*memset(void *, int, size_t);
68223695Sdfr#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
69223695Sdfrchar	*stpcpy(char * __restrict, const char * __restrict);
70223695Sdfrchar	*stpncpy(char * __restrict, const char * __restrict, size_t);
71223695Sdfr#endif
72223695Sdfr#if __BSD_VISIBLE
73223695Sdfrchar	*strcasestr(const char *, const char *) __pure;
74223695Sdfr#endif
75223695Sdfrchar	*strcat(char * __restrict, const char * __restrict);
76223695Sdfrchar	*strchr(const char *, int) __pure;
77223695Sdfrint	 strcmp(const char *, const char *) __pure;
78223695Sdfrint	 strcoll(const char *, const char *);
79223695Sdfrchar	*strcpy(char * __restrict, const char * __restrict);
80223695Sdfrsize_t	 strcspn(const char *, const char *) __pure;
81223695Sdfr#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
82223695Sdfrchar	*strdup(const char *) __malloc_like;
83223695Sdfr#endif
84223695Sdfrchar	*strerror(int);
85223695Sdfr#if __POSIX_VISIBLE >= 200112
86223695Sdfrint	 strerror_r(int, char *, size_t);
87223695Sdfr#endif
88223695Sdfr#if __BSD_VISIBLE
89223695Sdfrsize_t	 strlcat(char * __restrict, const char * __restrict, size_t);
90223695Sdfrsize_t	 strlcpy(char * __restrict, const char * __restrict, size_t);
91223695Sdfr#endif
92223695Sdfrsize_t	 strlen(const char *) __pure;
93223695Sdfr#if __BSD_VISIBLE
94223695Sdfrvoid	 strmode(int, char *);
95223695Sdfr#endif
96223695Sdfrchar	*strncat(char * __restrict, const char * __restrict, size_t);
97223695Sdfrint	 strncmp(const char *, const char *, size_t) __pure;
98223695Sdfrchar	*strncpy(char * __restrict, const char * __restrict, size_t);
99223695Sdfr#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
100223695Sdfrchar	*strndup(const char *, size_t) __malloc_like;
101223695Sdfrsize_t	 strnlen(const char *, size_t) __pure;
102223695Sdfr#endif
103223695Sdfr#if __BSD_VISIBLE
104223695Sdfrchar	*strnstr(const char *, const char *, size_t) __pure;
105223695Sdfr#endif
106223695Sdfrchar	*strpbrk(const char *, const char *) __pure;
107223695Sdfrchar	*strrchr(const char *, int) __pure;
108223695Sdfr#if __BSD_VISIBLE
109223695Sdfrchar	*strsep(char **, const char *);
110223695Sdfr#endif
111223695Sdfr#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
112223695Sdfrchar	*strsignal(int);
113223695Sdfr#endif
114223695Sdfrsize_t	 strspn(const char *, const char *) __pure;
115223695Sdfrchar	*strstr(const char *, const char *) __pure;
116223695Sdfrchar	*strtok(char * __restrict, const char * __restrict);
117223695Sdfr#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
118223695Sdfrchar	*strtok_r(char *, const char *, char **);
119223695Sdfr#endif
120223695Sdfrsize_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
121223695Sdfr#if __BSD_VISIBLE
122223695Sdfr
123223695Sdfr#ifndef _SWAB_DECLARED
124223695Sdfr#define _SWAB_DECLARED
125223695Sdfr
126223695Sdfr#ifndef _SSIZE_T_DECLARED
127223695Sdfrtypedef	__ssize_t	ssize_t;
128223695Sdfr#define	_SSIZE_T_DECLARED
129223695Sdfr#endif /* _SIZE_T_DECLARED */
130223695Sdfr
131223695Sdfrvoid	 swab(const void * __restrict, void * __restrict, ssize_t);
132223695Sdfr#endif /* _SWAB_DECLARED */
133223695Sdfr
134223695Sdfr#endif /* __BSD_VISIBLE */
135223695Sdfr
136223695Sdfr#if __POSIX_VISIBLE >= 200809
137223695Sdfr#include <xlocale/_string.h>
138223695Sdfr#endif
139223695Sdfr__END_DECLS
140223695Sdfr
141223695Sdfr#endif /* _STRING_H_ */
142223695Sdfr