]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
move isc_region_compare to isc/region.[ch], not isc/buffer.[ch]
authorBrian Wellington <source@isc.org>
Sat, 5 Jan 2002 07:28:44 +0000 (07:28 +0000)
committerBrian Wellington <source@isc.org>
Sat, 5 Jan 2002 07:28:44 +0000 (07:28 +0000)
lib/isc/Makefile.in
lib/isc/buffer.c
lib/isc/include/isc/buffer.h
lib/isc/include/isc/region.h
lib/isc/region.c [new file with mode: 0644]
util/copyrights

index ccf1317accb03cdadc285b06ca5e6c774ff18765..a7a0887ba1a533002cf266d2e2b42e07884b794e 100644 (file)
@@ -13,7 +13,7 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: Makefile.in,v 1.73 2001/11/30 01:02:12 gson Exp $
+# $Id: Makefile.in,v 1.74 2002/01/05 07:28:38 bwelling Exp $
 
 srcdir =       @srcdir@
 VPATH =                @srcdir@
@@ -56,7 +56,7 @@ OBJS =                @ISC_EXTRA_OBJS@ \
                lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
                md5.@O@ mem.@O@ mutexblock.@O@ netaddr.@O@ ondestroy.@O@ \
                parseint.@O@ quota.@O@ random.@O@ \
-               ratelimiter.@O@ result.@O@ rwlock.@O@ \
+               ratelimiter.@O@ region.@O@ result.@O@ rwlock.@O@ \
                serial.@O@ sha1.@O@ sockaddr.@O@ string.@O@ symtab.@O@ \
                task.@O@ taskpool.@O@ timer.@O@ version.@O@ \
                ${UNIXOBJS} ${NLSOBJS} ${THREADOBJS}
index 05aba4ce4347d9bb1ff60b1c2568f1170a2bc9e3..eb14715c6cc176752c45d160bd19d70ce8343a4e 100644 (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)
index 45f2cde1fa0d615a50b9fc75a23c6d4d39516833..736050aac321b8f508a59172c9a820f77c8152d8 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: buffer.h,v 1.40 2002/01/05 07:05:04 ogud Exp $ */
+/* $Id: buffer.h,v 1.41 2002/01/05 07:28:41 bwelling Exp $ */
 
 #ifndef ISC_BUFFER_H
 #define ISC_BUFFER_H 1
@@ -570,20 +570,6 @@ 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
 
index 6cfccf812ff68d87bc3c02ee811d787a4be175b2..41c6a5702e226bb73cb55dc9faf3b5eeaf4fb1a0 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: region.h,v 1.16 2001/01/09 21:57:25 bwelling Exp $ */
+/* $Id: region.h,v 1.17 2002/01/05 07:28:42 bwelling Exp $ */
 
 #ifndef ISC_REGION_H
 #define ISC_REGION_H 1
@@ -77,4 +77,19 @@ struct isc_consttextregion {
                _r->length -= _l; \
        } while (0)
 
+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 lexicographically less than r2
+ *      = 0 if r1 is lexicographically identical to r2
+ *      > 0 if r1 is lexicographically greater than r2
+ */
+
 #endif /* ISC_REGION_H */
diff --git a/lib/isc/region.c b/lib/isc/region.c
new file mode 100644 (file)
index 0000000..0625a93
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 1998-2001  Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: region.c,v 1.1 2002/01/05 07:28:40 bwelling Exp $ */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/region.h>
+#include <isc/util.h>
+
+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);
+}
index eee11c65e0b1ca1e0bae2cbf84f741c3001249d0..e0f756c629ed028c032b1a6c36217efe2c628fab 100644 (file)
 ./lib/isc/quota.c                              C       2000,2001
 ./lib/isc/random.c                             C       1999,2000,2001
 ./lib/isc/ratelimiter.c                                C       1999,2000,2001
+./lib/isc/region.c                             C       2002
 ./lib/isc/result.c                             C       1998,1999,2000,2001
 ./lib/isc/rwlock.c                             C       1998,1999,2000,2001
 ./lib/isc/serial.c                             C       1999,2000,2001