]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Adding function isc_region_compare and using in instead of compare_region in lib/dns
authorOlafur Gudmundsson <source@isc.org>
Sat, 5 Jan 2002 07:05:28 +0000 (07:05 +0000)
committerOlafur Gudmundsson <source@isc.org>
Sat, 5 Jan 2002 07:05:28 +0000 (07:05 +0000)
25 files changed:
CHANGES
lib/dns/rdata.c
lib/dns/rdata/any_255/tsig_250.c
lib/dns/rdata/generic/cert_37.c
lib/dns/rdata/generic/gpos_27.c
lib/dns/rdata/generic/hinfo_13.c
lib/dns/rdata/generic/isdn_20.c
lib/dns/rdata/generic/key_25.c
lib/dns/rdata/generic/loc_29.c
lib/dns/rdata/generic/null_10.c
lib/dns/rdata/generic/nxt_30.c
lib/dns/rdata/generic/opt_41.c
lib/dns/rdata/generic/proforma.c
lib/dns/rdata/generic/sig_24.c
lib/dns/rdata/generic/soa_6.c
lib/dns/rdata/generic/tkey_249.c
lib/dns/rdata/generic/txt_16.c
lib/dns/rdata/generic/unspec_103.c
lib/dns/rdata/generic/x25_19.c
lib/dns/rdata/in_1/a_1.c
lib/dns/rdata/in_1/aaaa_28.c
lib/dns/rdata/in_1/nsap_22.c
lib/dns/rdata/in_1/wks_11.c
lib/isc/buffer.c
lib/isc/include/isc/buffer.h

diff --git a/CHANGES b/CHANGES
index 21776243b0e11389c231c6227db91a0261ba802b..1c6b95a8773fa4f43444854aba0aff9da5aa0b06 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1171.  [func]          Added function isc_region_compare(), updated files in
+                       lib/dns to use this function instead of local one.
+
 1170.  [bug]           Don't attempt to print the token when a I/O error
                        occurs when parsing named.conf.  [RT #2275]
 
index 4569f1751a3798ee6c099752aeca82791595d055..d058538016a7500d9d97e7e315656a8e14248bac 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdata.c,v 1.156 2001/11/30 01:02:09 gson Exp $ */
+/* $Id: rdata.c,v 1.157 2002/01/05 07:05:05 ogud Exp $ */
 
 #include <config.h>
 #include <ctype.h>
@@ -152,9 +152,6 @@ uint8_fromregion(isc_region_t *region);
 static isc_result_t
 mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
 
-static int
-compare_region(isc_region_t *r1, isc_region_t *r2);
-
 static int
 hexvalue(char value);
 
@@ -449,7 +446,7 @@ dns_rdata_compare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2) {
 
                dns_rdata_toregion(rdata1, &r1);
                dns_rdata_toregion(rdata2, &r2);
-               result = compare_region(&r1, &r2);
+               result = isc_region_compare(&r1, &r2);
        }
        return (result);
 }
@@ -1625,20 +1622,6 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
        return (ISC_R_SUCCESS);
 }
 
-static int
-compare_region(isc_region_t *r1, isc_region_t *r2) {
-       unsigned int l;
-       int result;
-
-       l = (r1->length < r2->length) ? r1->length : r2->length;
-
-       if ((result = memcmp(r1->base, r2->base, l)) != 0)
-               return ((result < 0) ? -1 : 1);
-       else
-               return ((r1->length == r2->length) ? 0 :
-                       (r1->length < r2->length) ? -1 : 1);
-}
-
 static int
 hexvalue(char value) {
        char *s;
index 0ba9a60e91319f706570c5e6324c96fc8bd665df..d041ba435f7461e656a4705469178073fd2cd797 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tsig_250.c,v 1.53 2001/11/27 01:55:32 gson Exp $ */
+/* $Id: tsig_250.c,v 1.54 2002/01/05 07:05:06 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
 
@@ -350,7 +350,7 @@ compare_any_tsig(ARGS_COMPARE) {
                return (order);
        isc_region_consume(&r1, name_length(&name1));
        isc_region_consume(&r2, name_length(&name2));
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index b98d494655e5f9e30d32bb309de1cbfe9658d430..1aea535e869712c85dad148546fd45cf26730d03 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cert_37.c,v 1.41 2001/11/27 01:55:35 gson Exp $ */
+/* $Id: cert_37.c,v 1.42 2002/01/05 07:05:07 ogud Exp $ */
 
 /* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
 
@@ -161,7 +161,7 @@ compare_cert(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 47851bbdc023a2c2ad41809fc23b89872ee04e1f..90bb16dc9520706526d34f3f42683ae5c27138ad 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: gpos_27.c,v 1.33 2001/11/27 00:55:58 gson Exp $ */
+/* $Id: gpos_27.c,v 1.34 2002/01/05 07:05:08 ogud Exp $ */
 
 /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
 
@@ -109,7 +109,7 @@ compare_gpos(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index a8ca82051c4f17eb456219e58a2e8cfa40b20b6c..cd57697aa3aa286d4df5d205801a3b5697bed135 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: hinfo_13.c,v 1.38 2001/11/27 00:56:00 gson Exp $ */
+/* $Id: hinfo_13.c,v 1.39 2002/01/05 07:05:10 ogud Exp $ */
 
 /*
  * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -101,7 +101,7 @@ compare_hinfo(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index f56ea00589089b4bcb354bbb4c9d1479d7e23bbe..68879734fd5497920853f1d00e5f946217158dab 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: isdn_20.c,v 1.30 2001/07/16 03:06:08 marka Exp $ */
+/* $Id: isdn_20.c,v 1.31 2002/01/05 07:05:11 ogud Exp $ */
 
 /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
 
@@ -110,7 +110,7 @@ compare_isdn(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 9bcb186fb262a6cb1a0492385ad7b8070c45fdcb..2c01ffd235e9a2c96cafb77e978a82ee022c6f64 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: key_25.c,v 1.42 2001/11/27 01:55:36 gson Exp $ */
+/* $Id: key_25.c,v 1.43 2002/01/05 07:05:12 ogud Exp $ */
 
 /*
  * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -176,7 +176,7 @@ compare_key(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 3f7391f1e5d7bef7f79cdafaf00411fda9a2ceb5..43d6126963cb75795635ef754276c1f8204d9b34 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: loc_29.c,v 1.31 2001/11/27 00:56:01 gson Exp $ */
+/* $Id: loc_29.c,v 1.32 2002/01/05 07:05:13 ogud Exp $ */
 
 /* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
 
@@ -619,7 +619,7 @@ compare_loc(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index e7bec0c8f6445d9867396b9914d7a8bd750e0928..f349ef8889e2172d8257ec4e07b045c46939a6e3 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: null_10.c,v 1.36 2001/09/10 23:47:25 marka Exp $ */
+/* $Id: null_10.c,v 1.37 2002/01/05 07:05:14 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */
 
@@ -86,7 +86,7 @@ compare_null(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 7660f8b5743ac2f95125c156143c2d9446e5f1d1..9cc0da3e62782eb22fc3b4056a930bbf287da842 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nxt_30.c,v 1.51 2001/11/27 01:55:38 gson Exp $ */
+/* $Id: nxt_30.c,v 1.52 2002/01/05 07:05:15 ogud Exp $ */
 
 /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
 
@@ -193,7 +193,7 @@ compare_nxt(ARGS_COMPARE) {
        if (order != 0)
                return (order);
 
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index c2d7a7520915a1873749300a3c052af7456aa3e3..8cc650d358962968929442360e106091c801e1fe 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: opt_41.c,v 1.25 2001/07/16 03:06:24 marka Exp $ */
+/* $Id: opt_41.c,v 1.26 2002/01/05 07:05:16 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */
 
@@ -154,7 +154,7 @@ compare_opt(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 2239356d8ff5b331bf1e4dd33110a6389fe42e42..d831d63691c232f53013c4dd0c2b590dd1482e70 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: proforma.c,v 1.30 2001/01/09 21:54:35 bwelling Exp $ */
+/* $Id: proforma.c,v 1.31 2002/01/05 07:05:17 ogud Exp $ */
 
 #ifndef RDATA_GENERIC_#_#_C
 #define RDATA_GENERIC_#_#_C
@@ -84,7 +84,7 @@ compare_#(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 0b20e7f7337dd4e434e051d61eaa98f5a4c7a9e9..0bc9c324c0766de96b8813a920e72034a87ff70b 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sig_24.c,v 1.55 2001/11/27 01:55:40 gson Exp $ */
+/* $Id: sig_24.c,v 1.56 2002/01/05 07:05:18 ogud Exp $ */
 
 /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
 
@@ -335,7 +335,7 @@ compare_sig(ARGS_COMPARE) {
        INSIST(r2.length > 18);
        r1.length = 18;
        r2.length = 18;
-       order = compare_region(&r1, &r2);
+       order = isc_region_compare(&r1, &r2);
        if (order != 0)
                return (order);
 
@@ -354,7 +354,7 @@ compare_sig(ARGS_COMPARE) {
        isc_region_consume(&r1, name_length(&name1));
        isc_region_consume(&r2, name_length(&name2));
 
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index f2efe00ad8264ebca02735f2fbb8b69a0ed71f93..217ccadbcd1113a0e5ca06085a5ee2212246d9de 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: soa_6.c,v 1.55 2001/11/27 01:55:42 gson Exp $ */
+/* $Id: soa_6.c,v 1.56 2002/01/05 07:05:19 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
 
@@ -255,7 +255,7 @@ compare_soa(ARGS_COMPARE) {
        isc_region_consume(&region1, name_length(&name1));
        isc_region_consume(&region2, name_length(&name2));
 
-       return (compare_region(&region1, &region2));
+       return (isc_region_compare(&region1, &region2));
 }
 
 static inline isc_result_t
index 424789914f5d3d21c9a3404d49c379ade6042043..59dca1c411d5d4819769ae752509a1653be96ae5 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: tkey_249.c,v 1.49 2001/11/27 01:55:43 gson Exp $ */
+/* $Id: tkey_249.c,v 1.50 2002/01/05 07:05:20 ogud Exp $ */
 
 /*
  * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
@@ -340,7 +340,7 @@ compare_tkey(ARGS_COMPARE) {
                return (order);
        isc_region_consume(&r1, name_length(&name1));
        isc_region_consume(&r2, name_length(&name2));
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 989f176306ee229815a63d3c53bec405a219b52d..3883a989323ae06681f7b45c85aeadf333d6078d 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: txt_16.c,v 1.37 2001/07/16 03:06:33 marka Exp $ */
+/* $Id: txt_16.c,v 1.38 2002/01/05 07:05:21 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */
 
@@ -119,7 +119,7 @@ compare_txt(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 5db419a22dd83235334cd47045bf35eea4db2420..5a2e6e538bc487713e0946143e8e24375a525143 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: unspec_103.c,v 1.29 2001/09/10 23:47:26 marka Exp $ */
+/* $Id: unspec_103.c,v 1.30 2002/01/05 07:05:22 ogud Exp $ */
 
 #ifndef RDATA_GENERIC_UNSPEC_103_C
 #define RDATA_GENERIC_UNSPEC_103_C
@@ -83,7 +83,7 @@ compare_unspec(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 272c5695df9b16767b911133693d15b842bda57a..2e7c7fcb942bb4846616152540850999e3f86597 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: x25_19.c,v 1.31 2001/07/16 03:06:36 marka Exp $ */
+/* $Id: x25_19.c,v 1.32 2002/01/05 07:05:24 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */
 
@@ -103,7 +103,7 @@ compare_x25(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index e731e586ebc97ada7d61599a15f42f77f77cc150..3b65ecaece7923ee587d5f7ac0bf0d6c635c6df3 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: a_1.c,v 1.46 2001/07/16 03:06:40 marka Exp $ */
+/* $Id: a_1.c,v 1.47 2002/01/05 07:05:25 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
 
@@ -127,7 +127,7 @@ compare_in_a(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index d6089f3c988734987ff9464fae26ff814b7084f4..e871c41d817f7c3d4261c68cc0f2520b64e3e7f5 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: aaaa_28.c,v 1.36 2001/07/16 03:06:41 marka Exp $ */
+/* $Id: aaaa_28.c,v 1.37 2002/01/05 07:05:26 ogud Exp $ */
 
 /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
 
@@ -128,7 +128,7 @@ compare_in_aaaa(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index c5e39c91039b124fddc146723dd329ab4e1ce124..0478b783fb973e09c834ede0541a6d8cbeee75ed 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsap_22.c,v 1.34 2001/11/27 01:55:48 gson Exp $ */
+/* $Id: nsap_22.c,v 1.35 2002/01/05 07:05:27 ogud Exp $ */
 
 /* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */
 
@@ -141,7 +141,7 @@ compare_in_nsap(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 64c7c2682ed2becab5b7ace27235fbf43d9e4f8d..d87cc0ee475066064a9b26bfeceb1b15d1e90f2c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: wks_11.c,v 1.46 2001/11/27 01:55:51 gson Exp $ */
+/* $Id: wks_11.c,v 1.47 2002/01/05 07:05:28 ogud Exp $ */
 
 /* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
 
@@ -229,7 +229,7 @@ compare_in_wks(ARGS_COMPARE) {
 
        dns_rdata_toregion(rdata1, &r1);
        dns_rdata_toregion(rdata2, &r2);
-       return (compare_region(&r1, &r2));
+       return (isc_region_compare(&r1, &r2));
 }
 
 static inline isc_result_t
index 743b1be0bbda6da694edbcab38abb21889d3457b..05aba4ce4347d9bb1ff60b1c2568f1170a2bc9e3 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: buffer.c,v 1.36 2001/01/09 21:55:56 bwelling Exp $ */
+/* $Id: buffer.c,v 1.37 2002/01/05 07:05:02 ogud Exp $ */
 
 #include <config.h>
 
@@ -367,6 +367,23 @@ isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r) {
        return (ISC_R_SUCCESS);
 }
 
+int
+isc_region_compare(isc_region_t *r1, isc_region_t *r2) {
+       unsigned int l;
+       int result;
+
+       REQUIRE(r1 != NULL);
+       REQUIRE(r2 != NULL);
+              
+       l = (r1->length < r2->length) ? r1->length : r2->length;
+
+       if ((result = memcmp(r1->base, r2->base, l)) != 0)
+               return ((result < 0) ? -1 : 1);
+       else
+               return ((r1->length == r2->length) ? 0 :
+                       (r1->length < r2->length) ? -1 : 1);
+}
+
 isc_result_t
 isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
                    unsigned int length)
index a3527a47e4f80913bbdfa769bcfd2a262f6adc7b..45f2cde1fa0d615a50b9fc75a23c6d4d39516833 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: buffer.h,v 1.39 2001/02/07 01:36:12 bwelling Exp $ */
+/* $Id: buffer.h,v 1.40 2002/01/05 07:05:04 ogud Exp $ */
 
 #ifndef ISC_BUFFER_H
 #define ISC_BUFFER_H 1
@@ -570,6 +570,20 @@ isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
  *     ISC_R_NOSPACE                   The available region of 'b' is not
  *                                     big enough.
  */
+int
+isc_region_compare(isc_region_t *r1, isc_region_t *r2);
+/*
+ * Compares the contents of two regions 
+ *
+ * Requires: 
+ *     'r1' is a valid region
+ *     'r2' is a valid region
+ *
+ * Returns:
+ *      < 0 if r1 is lexicographicly less than r2
+ *      = 0 if r1 is lexicographicly identical to r2
+ *      > 0 if r1 is lexicographicly greater than r2
+ */
 
 ISC_LANG_ENDDECLS