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; 77246803Szeising#if __BSD_VISIBLE 78246766Szeisingchar *strchrnul(const char*, int) __pure; 79246766Szeising#endif 80132564Stjrint strcmp(const char *, const char *) __pure; 8193032Simpint strcoll(const char *, const char *); 8293747Smikechar *strcpy(char * __restrict, const char * __restrict); 83132564Stjrsize_t strcspn(const char *, const char *) __pure; 84105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 85187961Sdaschar *strdup(const char *) __malloc_like; 86105128Smike#endif 8793032Simpchar *strerror(int); 88105128Smike#if __POSIX_VISIBLE >= 200112 89105128Smikeint strerror_r(int, char *, size_t); 90105128Smike#endif 91105128Smike#if __BSD_VISIBLE 92189133Sdassize_t strlcat(char * __restrict, const char * __restrict, size_t); 93189133Sdassize_t strlcpy(char * __restrict, const char * __restrict, size_t); 94105128Smike#endif 95132564Stjrsize_t strlen(const char *) __pure; 96105128Smike#if __BSD_VISIBLE 97152754Sruvoid strmode(int, char *); 98105128Smike#endif 9993747Smikechar *strncat(char * __restrict, const char * __restrict, size_t); 100132564Stjrint strncmp(const char *, const char *, size_t) __pure; 10193747Smikechar *strncpy(char * __restrict, const char * __restrict, size_t); 102189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 103189136Sdaschar *strndup(const char *, size_t) __malloc_like; 104189136Sdassize_t strnlen(const char *, size_t) __pure; 105189136Sdas#endif 106105128Smike#if __BSD_VISIBLE 107132564Stjrchar *strnstr(const char *, const char *, size_t) __pure; 108105128Smike#endif 109132564Stjrchar *strpbrk(const char *, const char *) __pure; 110132564Stjrchar *strrchr(const char *, int) __pure; 111105128Smike#if __BSD_VISIBLE 112105128Smikechar *strsep(char **, const char *); 113189136Sdas#endif 114189136Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 115105128Smikechar *strsignal(int); 116105128Smike#endif 117132564Stjrsize_t strspn(const char *, const char *) __pure; 118132564Stjrchar *strstr(const char *, const char *) __pure; 11993747Smikechar *strtok(char * __restrict, const char * __restrict); 120105128Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 12193747Smikechar *strtok_r(char *, const char *, char **); 12293747Smike#endif 123105128Smikesize_t strxfrm(char * __restrict, const char * __restrict, size_t); 12493747Smike#if __BSD_VISIBLE 125138659Strhodes 126138659Strhodes#ifndef _SWAB_DECLARED 127138659Strhodes#define _SWAB_DECLARED 128138659Strhodes 129138659Strhodes#ifndef _SSIZE_T_DECLARED 130138659Strhodestypedef __ssize_t ssize_t; 131138659Strhodes#define _SSIZE_T_DECLARED 132138659Strhodes#endif /* _SIZE_T_DECLARED */ 133138659Strhodes 134138659Strhodesvoid swab(const void * __restrict, void * __restrict, ssize_t); 135138659Strhodes#endif /* _SWAB_DECLARED */ 136138659Strhodes 137138659Strhodes#endif /* __BSD_VISIBLE */ 138232498Stheraven 139233600Stheraven#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) 140232498Stheraven#include <xlocale/_string.h> 141232498Stheraven#endif 1421539Srgrimes__END_DECLS 1431539Srgrimes 1441539Srgrimes#endif /* _STRING_H_ */ 145