199767f8919635c4928607450d9e0abb932109ceToomas Soome/*-
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1990, 1993
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The Regents of the University of California. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * are met:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 3. Neither the name of the University nor the names of its contributors
199767f8919635c4928607450d9e0abb932109ceToomas Soome * may be used to endorse or promote products derived from this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * without specific prior written permission.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * @(#)string.h 8.1 (Berkeley) 6/2/93
199767f8919635c4928607450d9e0abb932109ceToomas Soome * $FreeBSD$
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef _STRING_H_
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _STRING_H_
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/cdefs.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/_null.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/_types.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Prototype functions which were historically defined in <string.h>, but
199767f8919635c4928607450d9e0abb932109ceToomas Soome * are required by POSIX to be prototyped in <strings.h>.
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <strings.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef _SIZE_T_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef __size_t size_t;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SIZE_T_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome__BEGIN_DECLS
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __XSI_VISIBLE >= 600
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memccpy(void * __restrict, const void * __restrict, int, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memchr(const void *, int, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memrchr(const void *, int, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint memcmp(const void *, const void *, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memcpy(void * __restrict, const void * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memmem(const void *, size_t, const void *, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memmove(void *, const void *, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *memset(void *, int, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200809
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *stpcpy(char * __restrict, const char * __restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *stpncpy(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strcasestr(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strcat(char * __restrict, const char * __restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strchr(const char *, int) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strchrnul(const char*, int) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint strcmp(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint strcoll(const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strcpy(char * __restrict, const char * __restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strcspn(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strdup(const char *) __malloc_like;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strerror(int);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200112
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint strerror_r(int, char *, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strlcat(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strlcpy(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strlen(const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid strmode(int, char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strncat(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint strncmp(const char *, const char *, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strncpy(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200809
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strndup(const char *, size_t) __malloc_like;
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strnlen(const char *, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strnstr(const char *, const char *, size_t) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strpbrk(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strrchr(const char *, int) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strsep(char **, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200809
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strsignal(int);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strspn(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strstr(const char *, const char *) __pure;
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strtok(char * __restrict, const char * __restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strtok_r(char *, const char *, char **);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strxfrm(char * __restrict, const char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef _SWAB_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SWAB_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#ifndef _SSIZE_T_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef __ssize_t ssize_t;
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SSIZE_T_DECLARED
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _SIZE_T_DECLARED */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid swab(const void * __restrict, void * __restrict, ssize_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _SWAB_DECLARED */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __BSD_VISIBLE */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <xlocale/_string.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome__END_DECLS
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _STRING_H_ */