2014-08-08 01:12:54 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-09-17 18:51:59 +04:00
|
|
|
#ifndef _STRINGS_H_
|
|
|
|
#define _STRINGS_H_
|
|
|
|
|
2014-08-08 01:12:54 +04:00
|
|
|
|
2022-05-30 09:55:46 +03:00
|
|
|
#include <locale_t.h>
|
2014-08-08 01:12:54 +04:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-05-24 04:54:47 +03:00
|
|
|
static __inline__ int ffs(int i) { return __builtin_ffs(i); }
|
2014-08-08 01:12:54 +04:00
|
|
|
|
|
|
|
extern int strcasecmp(const char *string1, const char *string2);
|
|
|
|
extern int strncasecmp(const char *string1, const char *string2,
|
|
|
|
size_t length);
|
|
|
|
|
2022-05-30 09:55:46 +03:00
|
|
|
extern int strcasecmp_l(const char *string1, const char *string2, locale_t locale);
|
|
|
|
extern int strncasecmp_l(const char *string1, const char *string2,
|
|
|
|
size_t length, locale_t locale);
|
|
|
|
|
2014-08-08 01:12:54 +04:00
|
|
|
/* legacy compatibility -- might be removed one day */
|
|
|
|
#define bcmp(a, b, length) memcmp((a), (b), (length))
|
|
|
|
#define bcopy(source, dest, length) memmove((dest), (source), (length))
|
|
|
|
#define bzero(buffer, length) memset((buffer), 0, (length))
|
|
|
|
|
|
|
|
extern char *index(const char *s, int c);
|
|
|
|
extern char *rindex(char const *s, int c);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2002-09-17 18:51:59 +04:00
|
|
|
|
|
|
|
#endif /* _STRINGS_H_ */
|