string.h revision 189132
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 189132 2009-02-28 05:08:35Z 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 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; 62178051Sdelphijvoid *memrchr(const void *, int, size_t) __pure; 63132564Stjrint memcmp(const void *, const void *, size_t) __pure; 6493747Smikevoid *memcpy(void * __restrict, const void * __restrict, size_t); 65149469Sandre#if __BSD_VISIBLE 66189132Sdasvoid *memmem(const void *, size_t, const void *, size_t) __pure; 67149469Sandre#endif 6893032Simpvoid *memmove(void *, const void *, size_t); 6993032Simpvoid *memset(void *, int, size_t); 70105128Smike#if __BSD_VISIBLE 71105128Smikechar *stpcpy(char *, const char *); 72132564Stjrchar *strcasestr(const char *, const char *) __pure; 73105128Smike#endif 7493747Smikechar *strcat(char * __restrict, const char * __restrict); 75132564Stjrchar *strchr(const char *, int) __pure; 76132564Stjrint strcmp(const char *, const char *) __pure; 7793032Simpint strcoll(const char *, const char *); 7893747Smikechar *strcpy(char * __restrict, const char * __restrict); 79132564Stjrsize_t strcspn(const char *, const char *) __pure; 80105128Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 81187961Sdaschar *strdup(const char *) __malloc_like; 82105128Smike#endif 8393032Simpchar *strerror(int); 84105128Smike#if __POSIX_VISIBLE >= 200112 85105128Smikeint strerror_r(int, char *, size_t); 86105128Smike#endif 87105128Smike#if __BSD_VISIBLE 88105128Smikesize_t strlcat(char *, const char *, size_t); 89105128Smikesize_t strlcpy(char *, const char *, size_t); 90105128Smike#endif 91132564Stjrsize_t strlen(const char *) __pure; 92105128Smike#if __BSD_VISIBLE 93152754Sruvoid strmode(int, char *); 94105128Smike#endif 9593747Smikechar *strncat(char * __restrict, const char * __restrict, size_t); 96132564Stjrint strncmp(const char *, const char *, size_t) __pure; 9793747Smikechar *strncpy(char * __restrict, const char * __restrict, size_t); 98105128Smike#if __BSD_VISIBLE 99187961Sdaschar *strndup(const char *, size_t) __malloc_like; 100132564Stjrchar *strnstr(const char *, const char *, size_t) __pure; 101105128Smike#endif 102132564Stjrchar *strpbrk(const char *, const char *) __pure; 103132564Stjrchar *strrchr(const char *, int) __pure; 104105128Smike#if __BSD_VISIBLE 105105128Smikechar *strsep(char **, const char *); 106105128Smikechar *strsignal(int); 107105128Smike#endif 108132564Stjrsize_t strspn(const char *, const char *) __pure; 109132564Stjrchar *strstr(const char *, const char *) __pure; 11093747Smikechar *strtok(char * __restrict, const char * __restrict); 111105128Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 11293747Smikechar *strtok_r(char *, const char *, char **); 11393747Smike#endif 114105128Smikesize_t strxfrm(char * __restrict, const char * __restrict, size_t); 11593747Smike#if __BSD_VISIBLE 116138659Strhodes 117138659Strhodes#ifndef _SWAB_DECLARED 118138659Strhodes#define _SWAB_DECLARED 119138659Strhodes 120138659Strhodes#ifndef _SSIZE_T_DECLARED 121138659Strhodestypedef __ssize_t ssize_t; 122138659Strhodes#define _SSIZE_T_DECLARED 123138659Strhodes#endif /* _SIZE_T_DECLARED */ 124138659Strhodes 125138659Strhodesvoid swab(const void * __restrict, void * __restrict, ssize_t); 126138659Strhodes#endif /* _SWAB_DECLARED */ 127138659Strhodes 128138659Strhodes#endif /* __BSD_VISIBLE */ 1291539Srgrimes__END_DECLS 1301539Srgrimes 1311539Srgrimes#endif /* _STRING_H_ */ 132