Macro functions IS_IN() Global variables and data structures
Programming guideline of WinDom

SET_BIT()

NAME

SET_BIT - bits field handling

PROTOTYPAGE

SET_BIT( field, bit, value) /* macro function */

PARAMETERS

field:
bit field variable,

bit:
bit to set,

value:
if 1 the bit is set to 1, if 0 the bit is set to 0.

DESCRIPTION

SET_BIT() is an usefull macro function used to set and used specific bit in a variable; It is very appropriate in formular handling.

As SET_BIT() is a macro, the variable field does not need to be a pointer.

EXAMPLES

     	// the object SAVE state should be SELECTED is option has a SAVE bit set to 1
     	SET_BIT( tree[SAVE].ob_state, SELECTED, option & SAVE);
     	// inverse operation
     	SET_BIT( option, SAVE, tree[SAVE].ob_state & SELECTED);