Merge from vendor branch LESS:
[dragonfly.git] / contrib / bind-9.3 / lib / bind / isc / bitncmp.mdoc
1 .\" $Id: bitncmp.mdoc,v 1.1.2.1.10.1 2004/03/09 08:33:39 marka Exp $
2 .\"
3 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996,1999 by Internet Software Consortium.
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .Dd June 1, 1996
19 .Dt BITNCMP 3
20 .Os BSD 4
21 .Sh NAME
22 .Nm bitncmp 
23 .Nd compare bit masks
24 .Sh SYNOPSIS
25 .Ft int
26 .Fn bitncmp "const void *l" "const void *r" "int n"
27 .Sh DESCRIPTION
28 The function
29 .Fn bitncmp
30 compares the
31 .Dq Fa n
32 most-significant bits of the two masks pointed to by
33 .Dq Fa l
34 and
35 .Dq Fa r ,
36 and returns an integer less than, equal to, or greater than 0, according to
37 whether or not
38 .Dq Fa l
39 is lexicographically less than, equal to, or greater than
40 .Dq Fa r
41 when taken to be unsigned characters (this behaviour is just like that of
42 .Xr memcmp 3 ) .
43 .Pp
44 .Sy NOTE :
45 .Fn Bitncmp 
46 assumes 
47 .Sy network byte order ;
48 this means that the fourth octet of 
49 .Li 192.5.5.240/28 
50 .Li 0x11110000 .
51 .Sh RETURN VALUES
52 .Fn Bitncmp
53 returns values in the manner of
54 .Xr memcmp 3 :
55 .Bd -ragged -offset indent
56 +1 if 
57 .Dq Fa 1
58 is greater than 
59 .Dq Fa r ;
60 .Pp
61 -1 if 
62 .Dq Fa l
63 is less than 
64 .Dq Fa r ; 
65 and
66 .Pp
67 0 if 
68 .Dq Fa l
69 is equal to
70 .Dq Fa r ,
71 .Ed
72 .Pp
73 where 
74 .Dq Fa l
75 and 
76 .Dq Fa r
77 are both interpreted as strings of unsigned characters (through bit 
78 .Dq Fa n . )
79 .Sh SEE ALSO
80 .Xr memcmp 3 .
81 .Sh AUTHOR
82 Paul Vixie (ISC).