blob: 6e6c8e693eecc80e3237d563b7d059821338d18b [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
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);
Nick Kralevicha6779072012-03-21 08:48:18 -070038extern void* memchr(const void *, int, size_t) __purefunc;
39extern void* memrchr(const void *, int, size_t) __purefunc;
40extern int memcmp(const void *, const void *, size_t) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041extern void* memcpy(void *, const void *, size_t);
42extern void* memmove(void *, const void *, size_t);
43extern void* memset(void *, int, size_t);
Nick Kralevicha6779072012-03-21 08:48:18 -070044extern void* memmem(const void *, size_t, const void *, size_t) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045extern void memswap(void *, void *, size_t);
46
Nick Kralevicha6779072012-03-21 08:48:18 -070047extern char* index(const char *, int) __purefunc;
48extern char* rindex(const char *, int) __purefunc;
49extern char* strchr(const char *, int) __purefunc;
50extern char* strrchr(const char *, int) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080051
Nick Kralevicha6779072012-03-21 08:48:18 -070052extern size_t strlen(const char *) __purefunc;
53extern int strcmp(const char *, const char *) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080054extern char* strcpy(char *, const char *);
55extern char* strcat(char *, const char *);
56
Nick Kralevicha6779072012-03-21 08:48:18 -070057extern int strcasecmp(const char *, const char *) __purefunc;
58extern int strncasecmp(const char *, const char *, size_t) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080059extern char* strdup(const char *);
60
Nick Kralevicha6779072012-03-21 08:48:18 -070061extern char* strstr(const char *, const char *) __purefunc;
62extern char* strcasestr(const char *haystack, const char *needle) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080063extern 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
Nick Kralevicha6779072012-03-21 08:48:18 -070069extern size_t strnlen(const char *, size_t) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080070extern char* strncat(char *, const char *, size_t);
71extern char* strndup(const char *, size_t);
Nick Kralevicha6779072012-03-21 08:48:18 -070072extern int strncmp(const char *, const char *, size_t) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080073extern 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
Nick Kralevicha6779072012-03-21 08:48:18 -070078extern size_t strcspn(const char *, const char *) __purefunc;
79extern char* strpbrk(const char *, const char *) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080080extern char* strsep(char **, const char *);
81extern size_t strspn(const char *, const char *);
82
83extern char* strsignal(int sig);
84
Nick Kralevicha6779072012-03-21 08:48:18 -070085extern int strcoll(const char *, const char *) __purefunc;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080086extern size_t strxfrm(char *, const char *, size_t);
87
88__END_DECLS
89
90#endif /* _STRING_H_ */