DragonFly kernel List (threaded) for 2004-01
[Date Prev][
Date Next]
[Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
call for API review: new bitstring functions
I need to find the first and last bit set within a subrange of an array
of bits. Rather than make up an adhoc API for these two functions, I
propose adding the following general functions to the bitstring(3) API:
/* Return the first bit set in the range [n, m] or -1 if none found. */
int bit_ffsrange(bitstr_t *name, int n, int m)
/* Return the highest (last) bit set in the range [n, m] or -1 if none
found. */
int bit_lfsrange(bitstr_t *name, int n, int m)
Jeffrey
[Date Prev][
Date Next]
[Thread Prev][
Thread Next]
[
Date Index][
Thread Index]