SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English AMIGA - NFO_#?
----------------------------------------------------------------------------
NAME
nfo_idcmptoindex() - Translates IDCMP flags to their
index values.
SYNOPSIS
index = nfo_idcmptoindex(flag);
__interrupt LONG nfo_idcmptoindex(ULONG);
FUNCTION
This function is able to translate IDCMP_#? flags to
their corresponding indexes.
INPUTS
flag - Single IDCMP flag.
RETURNS
Returns index. If given flag isnt known then returns
last possible(dummy) index.
BASES
None.
NOTES
Index value can be in range of 0 to 31. In fact this
routine can be used to translate not related flags
into indexes. Lowest possible flag 0x00000001 maps
to 0 and highest 0x80000000 to 31. 0x00000000 will
also give 31!
This function utilises 'switch()' for maximum speed.
SEE ALSO
EXAMPLE
/*
* An alternative implementation can be created like
* this. Note however that passing 0 in 'flag' will
* return 32 and not 31 nor 0!
*/
LONG altidcmptoindex(ULONG flag)
{
return QDEV_HLP_POPCOUNT(((flag & -flag) - 1));
}
BUGS
None known.
----------------------------------------------------------------------------
|