DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lkbitwise - perform dual operand bitwise operations on data object(s)

LIBRARY CALL

int lkbitwise (
   kobject i1,
   kobject i2,
   long    sval,
   char    *function,
   kobject o)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

The following is the library routine that performs a binary bitwise operation on two data objects. The routine takes two input data object (or a single data object and a constant), a function name, and an output data object in which to store the result of the function.

The supported functions are:

.TS
center tab(:) ;
l l .
and    :  o = i1 & (i2 or sval)
or     :  o = i1 | (i2 or sval)
xor    :  o = i1 ^ (i2 or sval)
nand   :  o = (~i1) | (~(i2 or sval))
nor    :  o = (~i1) & (~(i2 or sval))
andrev :  o = i1 & (~(i2 or sval))
andinv :  o = (~i1) & (i2 or sval)
orrev  :  o = i1 | (~(i2 or sval))
orinv  :  o = (~i1) | (i2 or sval)
rs     :  o = i1 >> by (i2 or sval)
ls     :  o = i1 << by (i2 or sval)
srs    :  Signed Right Shift by (i2 or sval)
sls    :  Signed Left Shift by (i2 or sval)
rr     :  Right Rotate by (i2 or sval)
lr     :  Left Rotate by (i2 or sval)
.TE
Therefore if lkbitwise() were called with two input data objects:

lkbitwise(i1, i2, 0, "and", o);

then the following would be performed:

o = i1 & i2

If lkbitwise were called with a single data object and a constant:

lkbitwise(i1, NULL, 10, "and", o);

then the following would be performed:

o = i1 & 10

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lkbitwise.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.