Paste: better?
Author: | ceninan |
Mode: | factor |
Date: | Fri, 21 May 2010 23:26:22 |
Plain Text |
<PRIVATE
: mask-index ( event -- n ) -3 shift ;
: bitmask ( event -- n ) 7 bitand 2^ ;
PRIVATE>
:: XISetMask ( mask event -- )
event mask-index :> index
event bitmask index mask nth bitor
index mask set-nth ; inline
:: XIClearMask ( mask event -- )
event mask-index :> index
event bitmask bitnot index mask nth bitand
index mask set-nth ; inline
:: XIMaskIsSet ( mask event -- n )
event mask-index :> index
event bitmask index mask nth bitand ;
: XIMaskLen ( event -- n ) 7 + -3 shift ;
New Annotation