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 37 extern void* memccpy(void *, const void *, int, size_t); 38 extern void* memchr(const void *, int, size_t); 39 extern void* memrchr(const void *, int, size_t); 40 extern int memcmp(const void *, const void *, size_t); 41 extern void* memcpy(void *, const void *, size_t); 42 extern void* memmove(void *, const void *, size_t); 43 extern void* memset(void *, int, size_t); 44 extern void* memmem(const void *, size_t, const void *, size_t); 45 extern void memswap(void *, void *, size_t); 46 47 extern char* index(const char *, int); 48 extern char* rindex(const char *, int); 49 extern char* strchr(const char *, int); 50 extern char* strrchr(const char *, int); 51 52 extern size_t strlen(const char *); 53 extern int strcmp(const char *, const char *); 54 extern char* strcpy(char *, const char *); 55 extern char* strcat(char *, const char *); 56 57 extern int strcasecmp(const char *, const char *); 58 extern int strncasecmp(const char *, const char *, size_t); 59 extern char* strdup(const char *); 60 61 extern char* strstr(const char *, const char *); 62 extern char* strcasestr(const char *haystack, const char *needle); 63 extern char* strtok(char *, const char *); 64 extern char* strtok_r(char *, const char *, char**); 65 66 extern char* strerror(int); 67 extern int strerror_r(int errnum, char *buf, size_t n); 68 69 extern size_t strnlen(const char *, size_t); 70 extern char* strncat(char *, const char *, size_t); 71 extern char* strndup(const char *, size_t); 72 extern int strncmp(const char *, const char *, size_t); 73 extern char* strncpy(char *, const char *, size_t); 74 75 extern size_t strlcat(char *, const char *, size_t); 76 extern size_t strlcpy(char *, const char *, size_t); 77 78 extern size_t strcspn(const char *, const char *); 79 extern char* strpbrk(const char *, const char *); 80 extern char* strsep(char **, const char *); 81 extern size_t strspn(const char *, const char *); 82 83 extern char* strsignal(int sig); 84 85 extern int strcoll(const char *, const char *); 86 extern size_t strxfrm(char *, const char *, size_t); 87 88 __END_DECLS 89 90 #endif /* _STRING_H_ */ 91