HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
47 Functions for manipulating bits
This chapter contains reference information on routines for manipulating bits.
Table 47-1 Bit manipulator routines
DescriptionFunction
Checks whether a particular bit is set in an integer.“slapi_isbitset_int()”
Checks whether a particular bit is set in a character.“slapi_isbitset_uchar()”
Sets the specified bit in an integer.“slapi_setbit_int()”
Sets the specified bit in a character.“slapi_setbit_uchar()”
Unsets the specified bit in an integer.“slapi_unsetbit_int()”
Unsets the specified bit in a character.“slapi_unsetbit_uchar()”
47.1 slapi_isbitset_int()
Checks whether a particular bit is set in the specified integer.
Syntax
#include "slapi-plugin.h"
int slapi_isbitset_int(unsigned int f,unsigned int bitnum);
Parameters This function takes the following parameters:
The unsigned integer, a bit of which is to be checked.
f
The bit number in the unsigned integer that needs tobe checked.
bitnum
Returns This function returns one of the following values:
1 if the specified bit is set.
0 if the specified bit is not set.
See also
“slapi_setbit_int()”
“slapi_unsetbit_int()”
47.2 slapi_isbitset_uchar()
Checks whether a particular bit is set in the specifier character.
Syntax
#include "slapi-plugin.h"
int slapi_isbitset_uchar(unsigned char f,unsigned char bitnum);
Parameters This function takes the following parameters:
The unsigned character, a bit of which is to be checked.
f
The bit number in the unsigned character that needs to be checked.
bitnum
Returns This function returns one of the following values:
1 if the specified bit is set.
0 if the specified bit is not set.
See also
47.1 slapi_isbitset_int() 365