1*199767f8SToomas Soome /*- 2*199767f8SToomas Soome * Copyright (c) 1990, 1993 3*199767f8SToomas Soome * The Regents of the University of California. All rights reserved. 4*199767f8SToomas Soome * 5*199767f8SToomas Soome * Redistribution and use in source and binary forms, with or without 6*199767f8SToomas Soome * modification, are permitted provided that the following conditions 7*199767f8SToomas Soome * are met: 8*199767f8SToomas Soome * 1. Redistributions of source code must retain the above copyright 9*199767f8SToomas Soome * notice, this list of conditions and the following disclaimer. 10*199767f8SToomas Soome * 2. Redistributions in binary form must reproduce the above copyright 11*199767f8SToomas Soome * notice, this list of conditions and the following disclaimer in the 12*199767f8SToomas Soome * documentation and/or other materials provided with the distribution. 13*199767f8SToomas Soome * 3. Neither the name of the University nor the names of its contributors 14*199767f8SToomas Soome * may be used to endorse or promote products derived from this software 15*199767f8SToomas Soome * without specific prior written permission. 16*199767f8SToomas Soome * 17*199767f8SToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18*199767f8SToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19*199767f8SToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20*199767f8SToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21*199767f8SToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22*199767f8SToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23*199767f8SToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24*199767f8SToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25*199767f8SToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26*199767f8SToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27*199767f8SToomas Soome * SUCH DAMAGE. 28*199767f8SToomas Soome * 29*199767f8SToomas Soome * @(#)string.h 8.1 (Berkeley) 6/2/93 30*199767f8SToomas Soome * $FreeBSD$ 31*199767f8SToomas Soome */ 32*199767f8SToomas Soome 33*199767f8SToomas Soome #ifndef _STRING_H_ 34*199767f8SToomas Soome #define _STRING_H_ 35*199767f8SToomas Soome 36*199767f8SToomas Soome #include <sys/cdefs.h> 37*199767f8SToomas Soome #include <sys/_null.h> 38*199767f8SToomas Soome #include <sys/_types.h> 39*199767f8SToomas Soome 40*199767f8SToomas Soome /* 41*199767f8SToomas Soome * Prototype functions which were historically defined in <string.h>, but 42*199767f8SToomas Soome * are required by POSIX to be prototyped in <strings.h>. 43*199767f8SToomas Soome */ 44*199767f8SToomas Soome #if __BSD_VISIBLE 45*199767f8SToomas Soome #include <strings.h> 46*199767f8SToomas Soome #endif 47*199767f8SToomas Soome 48*199767f8SToomas Soome #ifndef _SIZE_T_DECLARED 49*199767f8SToomas Soome typedef __size_t size_t; 50*199767f8SToomas Soome #define _SIZE_T_DECLARED 51*199767f8SToomas Soome #endif 52*199767f8SToomas Soome 53*199767f8SToomas Soome __BEGIN_DECLS 54*199767f8SToomas Soome #if __XSI_VISIBLE >= 600 55*199767f8SToomas Soome void *memccpy(void * __restrict, const void * __restrict, int, size_t); 56*199767f8SToomas Soome #endif 57*199767f8SToomas Soome void *memchr(const void *, int, size_t) __pure; 58*199767f8SToomas Soome #if __BSD_VISIBLE 59*199767f8SToomas Soome void *memrchr(const void *, int, size_t) __pure; 60*199767f8SToomas Soome #endif 61*199767f8SToomas Soome int memcmp(const void *, const void *, size_t) __pure; 62*199767f8SToomas Soome void *memcpy(void * __restrict, const void * __restrict, size_t); 63*199767f8SToomas Soome #if __BSD_VISIBLE 64*199767f8SToomas Soome void *memmem(const void *, size_t, const void *, size_t) __pure; 65*199767f8SToomas Soome #endif 66*199767f8SToomas Soome void *memmove(void *, const void *, size_t); 67*199767f8SToomas Soome void *memset(void *, int, size_t); 68*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809 69*199767f8SToomas Soome char *stpcpy(char * __restrict, const char * __restrict); 70*199767f8SToomas Soome char *stpncpy(char * __restrict, const char * __restrict, size_t); 71*199767f8SToomas Soome #endif 72*199767f8SToomas Soome #if __BSD_VISIBLE 73*199767f8SToomas Soome char *strcasestr(const char *, const char *) __pure; 74*199767f8SToomas Soome #endif 75*199767f8SToomas Soome char *strcat(char * __restrict, const char * __restrict); 76*199767f8SToomas Soome char *strchr(const char *, int) __pure; 77*199767f8SToomas Soome #if __BSD_VISIBLE 78*199767f8SToomas Soome char *strchrnul(const char*, int) __pure; 79*199767f8SToomas Soome #endif 80*199767f8SToomas Soome int strcmp(const char *, const char *) __pure; 81*199767f8SToomas Soome int strcoll(const char *, const char *); 82*199767f8SToomas Soome char *strcpy(char * __restrict, const char * __restrict); 83*199767f8SToomas Soome size_t strcspn(const char *, const char *) __pure; 84*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 85*199767f8SToomas Soome char *strdup(const char *) __malloc_like; 86*199767f8SToomas Soome #endif 87*199767f8SToomas Soome char *strerror(int); 88*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200112 89*199767f8SToomas Soome int strerror_r(int, char *, size_t); 90*199767f8SToomas Soome #endif 91*199767f8SToomas Soome #if __BSD_VISIBLE 92*199767f8SToomas Soome size_t strlcat(char * __restrict, const char * __restrict, size_t); 93*199767f8SToomas Soome size_t strlcpy(char * __restrict, const char * __restrict, size_t); 94*199767f8SToomas Soome #endif 95*199767f8SToomas Soome size_t strlen(const char *) __pure; 96*199767f8SToomas Soome #if __BSD_VISIBLE 97*199767f8SToomas Soome void strmode(int, char *); 98*199767f8SToomas Soome #endif 99*199767f8SToomas Soome char *strncat(char * __restrict, const char * __restrict, size_t); 100*199767f8SToomas Soome int strncmp(const char *, const char *, size_t) __pure; 101*199767f8SToomas Soome char *strncpy(char * __restrict, const char * __restrict, size_t); 102*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809 103*199767f8SToomas Soome char *strndup(const char *, size_t) __malloc_like; 104*199767f8SToomas Soome size_t strnlen(const char *, size_t) __pure; 105*199767f8SToomas Soome #endif 106*199767f8SToomas Soome #if __BSD_VISIBLE 107*199767f8SToomas Soome char *strnstr(const char *, const char *, size_t) __pure; 108*199767f8SToomas Soome #endif 109*199767f8SToomas Soome char *strpbrk(const char *, const char *) __pure; 110*199767f8SToomas Soome char *strrchr(const char *, int) __pure; 111*199767f8SToomas Soome #if __BSD_VISIBLE 112*199767f8SToomas Soome char *strsep(char **, const char *); 113*199767f8SToomas Soome #endif 114*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809 115*199767f8SToomas Soome char *strsignal(int); 116*199767f8SToomas Soome #endif 117*199767f8SToomas Soome size_t strspn(const char *, const char *) __pure; 118*199767f8SToomas Soome char *strstr(const char *, const char *) __pure; 119*199767f8SToomas Soome char *strtok(char * __restrict, const char * __restrict); 120*199767f8SToomas Soome #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 121*199767f8SToomas Soome char *strtok_r(char *, const char *, char **); 122*199767f8SToomas Soome #endif 123*199767f8SToomas Soome size_t strxfrm(char * __restrict, const char * __restrict, size_t); 124*199767f8SToomas Soome #if __BSD_VISIBLE 125*199767f8SToomas Soome 126*199767f8SToomas Soome #ifndef _SWAB_DECLARED 127*199767f8SToomas Soome #define _SWAB_DECLARED 128*199767f8SToomas Soome 129*199767f8SToomas Soome #ifndef _SSIZE_T_DECLARED 130*199767f8SToomas Soome typedef __ssize_t ssize_t; 131*199767f8SToomas Soome #define _SSIZE_T_DECLARED 132*199767f8SToomas Soome #endif /* _SIZE_T_DECLARED */ 133*199767f8SToomas Soome 134*199767f8SToomas Soome void swab(const void * __restrict, void * __restrict, ssize_t); 135*199767f8SToomas Soome #endif /* _SWAB_DECLARED */ 136*199767f8SToomas Soome 137*199767f8SToomas Soome #endif /* __BSD_VISIBLE */ 138*199767f8SToomas Soome 139*199767f8SToomas Soome #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) 140*199767f8SToomas Soome #include <xlocale/_string.h> 141*199767f8SToomas Soome #endif 142*199767f8SToomas Soome __END_DECLS 143*199767f8SToomas Soome 144*199767f8SToomas Soome #endif /* _STRING_H_ */ 145