xref: /haiku/headers/posix/strings.h (revision a9b301871d06c0ebe42d22b31c685abed5107acd)
1 /*
2  * Copyright 2014 Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _STRINGS_H_
6 #define _STRINGS_H_
7 
8 
9 #include <sys/types.h>
10 
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 static __inline__ int ffs(int i) { return __builtin_ffs(i); }
17 
18 extern int		strcasecmp(const char *string1, const char *string2);
19 extern int		strncasecmp(const char *string1, const char *string2,
20 	size_t length);
21 
22 /* legacy compatibility -- might be removed one day */
23 #define bcmp(a, b, length) memcmp((a), (b), (length))
24 #define bcopy(source, dest, length) memmove((dest), (source), (length))
25 #define bzero(buffer, length) memset((buffer), 0, (length))
26 
27 extern char 		*index(const char *s, int c);
28 extern char 		*rindex(char const *s, int c);
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 
34 #endif	/* _STRINGS_H_ */
35