mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 08:50:00 -04:00
Adding function isc_region_compare and using in instead of compare_region in lib/dns
This commit is contained in:
parent
cfbdb5e079
commit
90e303b114
25 changed files with 81 additions and 64 deletions
3
CHANGES
3
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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(®ion1, name_length(&name1));
|
||||
isc_region_consume(®ion2, name_length(&name2));
|
||||
|
||||
return (compare_region(®ion1, ®ion2));
|
||||
return (isc_region_compare(®ion1, ®ion2));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue