2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00

move isc_region_compare to isc/region.[ch], not isc/buffer.[ch]

This commit is contained in:
Brian Wellington
2002-01-05 07:28:44 +00:00
parent 90e303b114
commit e74100e3f4
6 changed files with 64 additions and 36 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: buffer.c,v 1.37 2002/01/05 07:05:02 ogud Exp $ */
/* $Id: buffer.c,v 1.38 2002/01/05 07:28:39 bwelling Exp $ */
#include <config.h>
@@ -367,23 +367,6 @@ 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)