Lely core libraries 2.3.4
strings.h
Go to the documentation of this file.
1
22#ifndef LELY_LIBC_STRINGS_H_
23#define LELY_LIBC_STRINGS_H_
24
25#include <lely/features.h>
26
27#ifndef LELY_HAVE_STRINGS_H
28#if (_POSIX_C_SOURCE >= 200112L || defined(__NEWLIB__))
29#define LELY_HAVE_STRINGS_H 1
30#endif
31#endif
32
33#if LELY_HAVE_STRINGS_H
34#include <strings.h>
35#else // !LELY_HAVE_STRINGS_H
36
37#include <stddef.h>
38
39#ifndef LELY_LIBC_STRINGS_INLINE
40#define LELY_LIBC_STRINGS_INLINE static inline
41#endif
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
53#if (defined(__GNUC__) || __has_builtin(__builtin_ffs)) \
54 && !defined(__BSD_VISIBLE)
55LELY_LIBC_STRINGS_INLINE int ffs(int i);
56
57inline int
58ffs(int i)
59{
60 return __builtin_ffs(i);
61}
62#else
63int ffs(int i);
64#endif
65
73int strcasecmp(const char *s1, const char *s2);
74
82int strncasecmp(const char *s1, const char *s2, size_t n);
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif // !LELY_HAVE_STRINGS_H
89
90#endif // !LELY_LIBC_STRINGS_H_
This header file is part of the Lely libraries; it contains the compiler feature definitions.
This header file is part of the C11 and POSIX compatibility library; it includes <stddef....
This header file is part of the C11 and POSIX compatibility library; it includes <strings....
int ffs(int i)
Finds the index of the first (least significant) bit set in i.
Definition strings.h:58
int strncasecmp(const char *s1, const char *s2, size_t n)
Compares at most n characters from the the string at s1 to the string at s2, ignoring differences in ...
Definition strings.c:87
int strcasecmp(const char *s1, const char *s2)
Compares the string at s1 to the string at s2, ignoring differences in case.
Definition strings.c:72