1/* 2 * Copyright (C) 2008 The Android Open Source Project 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in 12 * the documentation and/or other materials provided with the 13 * distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28#ifndef _STRING_H_ 29#define _STRING_H_ 30 31#include <sys/cdefs.h> 32#include <stddef.h> 33#include <malloc.h> 34 35__BEGIN_DECLS 36 37extern void* memccpy(void *, const void *, int, size_t); 38extern void* memchr(const void *, int, size_t); 39extern void* memrchr(const void *, int, size_t); 40extern int memcmp(const void *, const void *, size_t); 41extern void* memcpy(void *, const void *, size_t); 42extern void* memmove(void *, const void *, size_t); 43extern void* memset(void *, int, size_t); 44extern void* memmem(const void *, size_t, const void *, size_t); 45extern void memswap(void *, void *, size_t); 46 47extern char* index(const char *, int); 48extern char* rindex(const char *, int); 49extern char* strchr(const char *, int); 50extern char* strrchr(const char *, int); 51 52extern size_t strlen(const char *); 53extern int strcmp(const char *, const char *); 54extern char* strcpy(char *, const char *); 55extern char* strcat(char *, const char *); 56 57extern int strcasecmp(const char *, const char *); 58extern int strncasecmp(const char *, const char *, size_t); 59extern char* strdup(const char *); 60 61extern char* strstr(const char *, const char *); 62extern char* strcasestr(const char *haystack, const char *needle); 63extern char* strtok(char *, const char *); 64extern char* strtok_r(char *, const char *, char**); 65 66extern char* strerror(int); 67extern int strerror_r(int errnum, char *buf, size_t n); 68 69extern size_t strnlen(const char *, size_t); 70extern char* strncat(char *, const char *, size_t); 71extern char* strndup(const char *, size_t); 72extern int strncmp(const char *, const char *, size_t); 73extern char* strncpy(char *, const char *, size_t); 74 75extern size_t strlcat(char *, const char *, size_t); 76extern size_t strlcpy(char *, const char *, size_t); 77 78extern size_t strcspn(const char *, const char *); 79extern char* strpbrk(const char *, const char *); 80extern char* strsep(char **, const char *); 81extern size_t strspn(const char *, const char *); 82 83extern char* strsignal(int sig); 84 85extern int strcoll(const char *, const char *); 86extern size_t strxfrm(char *, const char *, size_t); 87 88__END_DECLS 89 90#endif /* _STRING_H_ */ 91