[hfs-user] Interpretation needed

Mark Day mday@apple.com
Thu, 24 Jan 2002 09:10:07 -0800


--Apple-Mail-1--774730545
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed

On Thursday, January 24, 2002, at 02:28  AM, Entwicklung wrote:

> enum{
> kBTBadCloseMask =3D 0x00000001,
> kBTBigKeysMask=3D0x00000002,
> kBTVariableIndexKeysMask=3D0x00000004
> }
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "
> =A0
> =A0
> In my case I need to set both kBTBigkeysMask and=20
> kBTVariableIndexKeysMask. What is meant by bits 1,2 and 4?
> =A0
> =A0Do I set attributes =3D 6 (assuming 2 and 4 refer to positions =
1(2^1)=20
> and 2(2^2))

Yes.  The numbers above are masks, not bit numbers.

Apple typically names constants ending in "Mask" for the value you would=20=

logically OR in to produce the composite value.  Constants for bit=20
numbers often end in "Bit"; those would be used to determine how many=20
places to shift to get to the correct bit.  So, kBTVariableIndexKeysBit=20=

would be 2.  (The above constants are bits 0, 1 and 2.)

-Mark

--Apple-Mail-1--774730545
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=ISO-8859-1

On Thursday, January 24, 2002, at 02:28  AM, Entwicklung wrote:


=
<excerpt><fontfamily><param>Arial</param><smaller>enum{</smaller></fontfam=
ily>

<fontfamily><param>Arial</param><smaller>kBTBadCloseMask =3D =
0x00000001,</smaller></fontfamily>

=
<fontfamily><param>Arial</param><smaller>kBTBigKeysMask=3D0x00000002,</sma=
ller></fontfamily>

=
<fontfamily><param>Arial</param><smaller>kBTVariableIndexKeysMask=3D0x0000=
0004</smaller></fontfamily>

<fontfamily><param>Arial</param><smaller>}</smaller></fontfamily>

=
<fontfamily><param>Arial</param><smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0 "</smaller></fontfamily>

=A0

=A0

<fontfamily><param>Arial</param><smaller>In my case I need to set both
kBTBigkeysMask and kBTVariableIndexKeysMask. What is meant by bits 1,2
and 4?</smaller></fontfamily>

=A0

<fontfamily><param>Arial</param><smaller>=A0Do I set attributes =3D 6
(assuming 2 and 4 refer to positions 1(2^1) and =
2(2^2))</smaller></fontfamily>

</excerpt>

Yes.  The numbers above are masks, not bit numbers.


Apple typically names constants ending in "Mask" for the value you
would logically OR in to produce the composite value.  Constants for
bit numbers often end in "Bit"; those would be used to determine how
many places to shift to get to the correct bit.  So,
kBTVariableIndexKeysBit would be 2.  (The above constants are bits 0,
1 and 2.)


-Mark


--Apple-Mail-1--774730545--