string.h revision 233600
1143337Ssimon/*- 2143337Ssimon * Copyright (c) 1990, 1993 3143337Ssimon * The Regents of the University of California. All rights reserved. 4143337Ssimon * 5143337Ssimon * Redistribution and use in source and binary forms, with or without 6143337Ssimon * modification, are permitted provided that the following conditions 7143337Ssimon * are met: 8143337Ssimon * 1. Redistributions of source code must retain the above copyright 9143337Ssimon * notice, this list of conditions and the following disclaimer. 10143337Ssimon * 2. Redistributions in binary form must reproduce the above copyright 11143337Ssimon * notice, this list of conditions and the following disclaimer in the 12143337Ssimon * documentation and/or other materials provided with the distribution. 13143337Ssimon * 3. Neither the name of the University nor the names of its contributors 14143337Ssimon * may be used to endorse or promote products derived from this software 15143337Ssimon * without specific prior written permission. 16143337Ssimon * 17143337Ssimon * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18143337Ssimon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19143337Ssimon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20143337Ssimon * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21143337Ssimon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22143337Ssimon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23143337Ssimon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24143337Ssimon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25143337Ssimon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26143337Ssimon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27152984Sjoel * SUCH DAMAGE. 28143337Ssimon * 29143337Ssimon * @(#)string.h 8.1 (Berkeley) 6/2/93 30143337Ssimon * $FreeBSD: head/include/string.h 233600 2012-03-28 12:11:54Z theraven $ 31143337Ssimon */ 32143337Ssimon 33143337Ssimon#ifndef _STRING_H_ 34152984Sjoel#define _STRING_H_ 35152984Sjoel 36152984Sjoel#include <sys/cdefs.h> 37143337Ssimon#include <sys/_null.h> 38143337Ssimon#include <sys/_types.h> 39152984Sjoel 40152984Sjoel/* 41152984Sjoel * Prototype functions which were historically defined in <string.h>, but 42152984Sjoel * are required by POSIX to be prototyped in <strings.h>. 43152984Sjoel */ 44152984Sjoel#if __BSD_VISIBLE 45152984Sjoel#include <strings.h> 46152984Sjoel#endif 47143337Ssimon 48143337Ssimon#ifndef _SIZE_T_DECLARED 49143337Ssimontypedef __size_t size_t; 50143337Ssimon#define _SIZE_T_DECLARED 51143337Ssimon#endif 52143337Ssimon 53143337Ssimon__BEGIN_DECLS 54143337Ssimon#if __XSI_VISIBLE >= 600 55143337Ssimonvoid *memccpy(void * __restrict, const void * __restrict, int, size_t); 56143337Ssimon#endif 57143337Ssimonvoid *memchr(const void *, int, size_t) __pure; 58143337Ssimon#if __BSD_VISIBLE 59143337Ssimonvoid *memrchr(const void *, int, size_t) __pure; 60143337Ssimon#endif 61143337Ssimonint memcmp(const void *, const void *, size_t) __pure; 62143337Ssimonvoid *memcpy(void * __restrict, const void * __restrict, size_t); 63143337Ssimon#if __BSD_VISIBLE 64143337Ssimonvoid *memmem(const void *, size_t, const void *, size_t) __pure; 65143337Ssimon#endif 66143337Ssimonvoid *memmove(void *, const void *, size_t); 67143337Ssimonvoid *memset(void *, int, size_t); 68143337Ssimon#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 69152890Sjoelchar *stpcpy(char * __restrict, const char * __restrict); 70152890Sjoelchar *stpncpy(char * __restrict, const char * __restrict, size_t); 71267938Sbapt#endif 72#if __BSD_VISIBLE 73char *strcasestr(const char *, const char *) __pure; 74#endif 75char *strcat(char * __restrict, const char * __restrict); 76char *strchr(const char *, int) __pure; 77int strcmp(const char *, const char *) __pure; 78int strcoll(const char *, const char *); 79char *strcpy(char * __restrict, const char * __restrict); 80size_t strcspn(const char *, const char *) __pure; 81#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 82char *strdup(const char *) __malloc_like; 83#endif 84char *strerror(int); 85#if __POSIX_VISIBLE >= 200112 86int strerror_r(int, char *, size_t); 87#endif 88#if __BSD_VISIBLE 89size_t strlcat(char * __restrict, const char * __restrict, size_t); 90size_t strlcpy(char * __restrict, const char * __restrict, size_t); 91#endif 92size_t strlen(const char *) __pure; 93#if __BSD_VISIBLE 94void strmode(int, char *); 95#endif 96char *strncat(char * __restrict, const char * __restrict, size_t); 97int strncmp(const char *, const char *, size_t) __pure; 98char *strncpy(char * __restrict, const char * __restrict, size_t); 99#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 100char *strndup(const char *, size_t) __malloc_like; 101size_t strnlen(const char *, size_t) __pure; 102#endif 103#if __BSD_VISIBLE 104char *strnstr(const char *, const char *, size_t) __pure; 105#endif 106char *strpbrk(const char *, const char *) __pure; 107char *strrchr(const char *, int) __pure; 108#if __BSD_VISIBLE 109char *strsep(char **, const char *); 110#endif 111#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 112char *strsignal(int); 113#endif 114size_t strspn(const char *, const char *) __pure; 115char *strstr(const char *, const char *) __pure; 116char *strtok(char * __restrict, const char * __restrict); 117#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 118char *strtok_r(char *, const char *, char **); 119#endif 120size_t strxfrm(char * __restrict, const char * __restrict, size_t); 121#if __BSD_VISIBLE 122 123#ifndef _SWAB_DECLARED 124#define _SWAB_DECLARED 125 126#ifndef _SSIZE_T_DECLARED 127typedef __ssize_t ssize_t; 128#define _SSIZE_T_DECLARED 129#endif /* _SIZE_T_DECLARED */ 130 131void swab(const void * __restrict, void * __restrict, ssize_t); 132#endif /* _SWAB_DECLARED */ 133 134#endif /* __BSD_VISIBLE */ 135 136#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) 137#include <xlocale/_string.h> 138#endif 139__END_DECLS 140 141#endif /* _STRING_H_ */ 142