string.h revision 102227
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 102227 2002-08-21 16:20:02Z mike $ 351539Srgrimes */ 361539Srgrimes 371539Srgrimes#ifndef _STRING_H_ 381539Srgrimes#define _STRING_H_ 3993747Smike 4093747Smike#include <sys/cdefs.h> 41102227Smike#include <sys/_types.h> 421539Srgrimes 4393747Smike/* 4493747Smike * Prototype functions which were historically defined in <string.h>, but 4593747Smike * are required by POSIX to be prototyped in <strings.h>. 4693747Smike */ 4793747Smike#if __BSD_VISIBLE 4893747Smike#include <strings.h> 4993747Smike#endif 5093747Smike 51102227Smike#ifndef _SIZE_T_DECLARED 52102227Smiketypedef __size_t size_t; 53102227Smike#define _SIZE_T_DECLARED 541539Srgrimes#endif 551539Srgrimes 561539Srgrimes#ifndef NULL 571539Srgrimes#define NULL 0 581539Srgrimes#endif 591539Srgrimes 601539Srgrimes__BEGIN_DECLS 6193032Simpvoid *memchr(const void *, int, size_t); 6293032Simpint memcmp(const void *, const void *, size_t); 6393747Smikevoid *memcpy(void * __restrict, const void * __restrict, size_t); 6493032Simpvoid *memmove(void *, const void *, size_t); 6593032Simpvoid *memset(void *, int, size_t); 6693747Smikechar *strcat(char * __restrict, const char * __restrict); 6793032Simpchar *strchr(const char *, int); 6893032Simpint strcmp(const char *, const char *); 6993032Simpint strcoll(const char *, const char *); 7093747Smikechar *strcpy(char * __restrict, const char * __restrict); 7193032Simpsize_t strcspn(const char *, const char *); 7293032Simpchar *strerror(int); 7393032Simpsize_t strlen(const char *); 7493747Smikechar *strncat(char * __restrict, const char * __restrict, size_t); 7593032Simpint strncmp(const char *, const char *, size_t); 7693747Smikechar *strncpy(char * __restrict, const char * __restrict, size_t); 7793032Simpchar *strpbrk(const char *, const char *); 7893032Simpchar *strrchr(const char *, int); 7993032Simpsize_t strspn(const char *, const char *); 8093032Simpchar *strstr(const char *, const char *); 8193747Smikechar *strtok(char * __restrict, const char * __restrict); 8293747Smikesize_t strxfrm(char * __restrict, const char * __restrict, size_t); 831539Srgrimes 8494721Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 8593747Smikevoid *memccpy(void * __restrict, const void * __restrict, int, size_t); 8693032Simpchar *strdup(const char *); 8793747Smikechar *strtok_r(char *, const char *, char **); 8893747Smike#endif 8993747Smike 9094721Smike#if __POSIX_VISIBLE >= 200112 9194721Smikeint strerror_r(int, char *, size_t); 9294721Smike#endif 9394721Smike 9493747Smike#if __BSD_VISIBLE 9593747Smikechar *strcasestr(const char *, const char *); 9693032Simpsize_t strlcat(char *, const char *, size_t); 9793032Simpsize_t strlcpy(char *, const char *, size_t); 9893032Simpvoid strmode(int, char *); 9993032Simpchar *strnstr(const char *, const char *, size_t); 10093032Simpchar *strsep(char **, const char *); 10193032Simpchar *strsignal(int); 10293032Simpvoid swab(const void *, void *, size_t); 1038858Srgrimes#endif 1041539Srgrimes__END_DECLS 1051539Srgrimes 1061539Srgrimes#endif /* _STRING_H_ */ 107