bitncmp -- compare bit masks
int
bitncmp(const void *l, const void *r, int n);
The function bitncmp() compares the ``n'' most-significant bits of the
two masks pointed to by ``l'' and ``r'', and returns an integer less
than, equal to, or greater than 0, according to whether or not ``l'' is
lexicographically less than, equal to, or greater than ``r'' when taken
to be unsigned characters (this behaviour is just like that of
memcmp(3)).
NOTE: Bitncmp() assumes network byte order; this means that the fourth
octet of 192.5.5.240/28 0x11110000.
Bitncmp() returns values in the manner of memcmp(3):
+1 if ``1'' is greater than ``r'';
-1 if ``l'' is less than ``r''; and
0 if ``l'' is equal to ``r'',
where ``l'' and ``r'' are both interpreted as strings of unsigned characters
(through bit ``n''.)
memcmp(3).
Paul Vixie (ISC).
4th Berkeley Distribution June 1, 1996 4th Berkeley Distribution
[ Back ] |