Important: The information in this document is obsolete and should not be used for new development.
OTAtomicTestBit
Tests a bit in a byte and returns its current state.C INTERFACE
Boolean OTAtomicTestBit( UInt8* bytePtr, size_t bitToTest)C++ INTERFACE
None. C++ applications use the C interface to this function.PARAMETERS
bytePtr
- A pointer to the byte containing the bit to test.
bitToTest
- A value ranging from 0 to 7 that specifies the bit to test.
- function result
- Returns the current state of the bit:
true
if the bit is set;false
, otherwise.DISCUSSION
This function atomically tests the bit specified by thebitToTest
parameter, in the byte referenced by thebytePtr
parameter.No error checking is done on the
bitToTest
value you specify, and results are undefined if the value lies outside the range 0 through 7.Use the
OTAtomicSetBit
function to set a bit value.Use the
OTAtomicClearBit
function to clear a bit value.