blob: 1d987c3543f71de8dc314087d2cc9c2fadbd2ca5 [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);
Channagoud Kadabi555a2422015-02-18 14:54:43 -080036/* secure memcpy, does not copy beyong size of dest buffer*/
37size_t memscpy (void *, size_t, void const *, size_t);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070038void *memmove(void *, void const *, size_t);
39void *memset (void *, int, size_t);
40
41char *strcat(char *, char const *);
42char *strchr(char const *, int) __PURE;
43int strcmp(char const *, char const *) __PURE;
44char *strcpy(char *, char const *);
45char const *strerror(int) __CONST;
46size_t strlen(char const *) __PURE;
47char *strncat(char *, char const *, size_t);
48int strncmp(char const *, char const *, size_t) __PURE;
49char *strncpy(char *, char const *, size_t);
50char *strpbrk(char const *, char const *) __PURE;
51char *strrchr(char const *, int) __PURE;
52size_t strspn(char const *, char const *) __PURE;
53size_t strcspn(const char *s, const char *) __PURE;
54char *strstr(char const *, char const *) __PURE;
55char *strtok(char *, char const *);
Sridhar Parasuram8ad09c62015-05-04 15:02:09 -070056char *strtok_r(char *s, const char *delim, char **last);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070057int strcoll(const char *s1, const char *s2) __PURE;
58size_t strxfrm(char *dest, const char *src, size_t n) __PURE;
59char *strdup(const char *str) __MALLOC;
Deepa Dinamanieb9eefe2012-09-24 11:35:01 -070060void strrev(unsigned char *str) __PURE;
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070061
62#ifdef __cplusplus
63} /* extern "C" */
64#endif
65
66#ifdef __cplusplus
67extern "C"
68{
69#endif
70
71/* non standard */
72void *bcopy(void const *, void *, size_t);
73void bzero(void *, size_t);
74size_t strlcat(char *, char const *, size_t);
75size_t strlcpy(char *, char const *, size_t);
76int strncasecmp(char const *, char const *, size_t) __PURE;
77int strnicmp(char const *, char const *, size_t) __PURE;
78size_t strnlen(char const *s, size_t count) __PURE;
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif