-
Notifications
You must be signed in to change notification settings - Fork 66
/
strings.h
54 lines (47 loc) · 1.3 KB
/
strings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef STRINGS_H_
#define STRINGS_H_
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
/**
* @brief Finds the last (most significant) bit set in the given mask
*
* Finds the last (most significant) bit set in the given (int) mask and return the index of that
* bit.
*
* Bits are numbered starting at 1, the least significant bit.
*
* @param mask The bit mask
* @return The index of the bit if mask is not zero, 0 otherwise.
* */
int fls(int mask);
/**
* @brief Finds the last (most significant) bit set in the given mask
*
* Finds the last (most significant) bit set in the given (long) mask and return the index of that
* bit.
*
* Bits are numbered starting at 1, the least significant bit.
*
* @param mask The bit mask
* @return The index of the bit if mask is not zero, 0 otherwise.
* */
int flsl(long mask);
/**
* @brief Finds the last (most significant) bit set in the given mask
*
* Finds the last (most significant) bit set in the given (long long) mask and return the index of
* that bit.
*
* Bits are numbered starting at 1, the least significant bit.
*
* @param mask The bit mask
* @return The index of the bit if mask is not zero, 0 otherwise.
* */
int flsll(long long mask);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // STRINGS_H_