Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 27 - Utilities Reference / Functions
Atomic Operations /


OTAtomicSetBit

Sets a specified bit in a byte.

C INTERFACE
Boolean OTAtomicSetBit(
                     UInt8* bytePtr,
                     size_t bitToSet)
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
bytePtr
A pointer to the byte containing the bit to be set
bitToSet
A value ranging from 0 to 7 that specifies the bit to set.
function result
Returns the previous state of the bit: true if the bit was set; false, otherwise.
DISCUSSION
This function atomically sets the bit specified by the bitToSet parameter, in the byte referenced by the bytePtr parameter. This function returns the previous state of the bit.

No error checking is done on the bitToSet value you specify, and results are undefined if the value lies outside the range 0 through 7.

Use the OTAtomicClearBit function to clear a bit value.

Use the OTAtomicTestBit function to test a bit value.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998