blob: 661e746adbc64153ea514b9ccc03d969eb991930 [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23#ifndef __LIB_STRING_H
24#define __LIB_STRING_H
25
26#include <sys/types.h>
27#include <compiler.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33void *memchr (void const *, int, size_t) __PURE;
34int memcmp (void const *, const void *, size_t) __PURE;
35void *memcpy (void *, void const *, size_t);
36void *memmove(void *, void const *, size_t);
37void *memset (void *, int, size_t);
38
39char *strcat(char *, char const *);
40char *strchr(char const *, int) __PURE;
41int strcmp(char const *, char const *) __PURE;
42char *strcpy(char *, char const *);
43char const *strerror(int) __CONST;
44size_t strlen(char const *) __PURE;
45char *strncat(char *, char const *, size_t);
46int strncmp(char const *, char const *, size_t) __PURE;
47char *strncpy(char *, char const *, size_t);
48char *strpbrk(char const *, char const *) __PURE;
49char *strrchr(char const *, int) __PURE;
50size_t strspn(char const *, char const *) __PURE;
51size_t strcspn(const char *s, const char *) __PURE;
52char *strstr(char const *, char const *) __PURE;
53char *strtok(char *, char const *);
54int strcoll(const char *s1, const char *s2) __PURE;
55size_t strxfrm(char *dest, const char *src, size_t n) __PURE;
56char *strdup(const char *str) __MALLOC;
Deepa Dinamanieb9eefe2012-09-24 11:35:01 -070057void strrev(unsigned char *str) __PURE;
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070058
59#ifdef __cplusplus
60} /* extern "C" */
61#endif
62
63#ifdef __cplusplus
64extern "C"
65{
66#endif
67
68/* non standard */
69void *bcopy(void const *, void *, size_t);
70void bzero(void *, size_t);
71size_t strlcat(char *, char const *, size_t);
72size_t strlcpy(char *, char const *, size_t);
73int strncasecmp(char const *, char const *, size_t) __PURE;
74int strnicmp(char const *, char const *, size_t) __PURE;
75size_t strnlen(char const *s, size_t count) __PURE;
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif