]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
removed the _oct sorting functions
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 10 Jan 2006 14:57:52 +0000 (14:57 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 10 Jan 2006 14:57:52 +0000 (14:57 +0000)
ldns/rr.h
net.c
rr.c

index cbb0d96ea6ddcbb6601abc91a2402c50fe9f869c..8d571927a93ac11cbd5a20617a5f41b94b0db498 100644 (file)
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -571,13 +571,6 @@ ldns_rr_list* ldns_rr_list_clone(ldns_rr_list *rrlist);
  */
 void ldns_rr_list_sort(ldns_rr_list *unsorted);
 
-/**
- * sorts an rr_list (owner - class - type). the sorting is done inband.
- * \param[in] unsorted the rr_list to be sorted
- * \return void
- */
-void ldns_rr_list_sort_oct(ldns_rr_list *unsorted);
-
 /**
  * compares two rrs.
  * \param[in] rr1 the first one
@@ -588,16 +581,6 @@ void ldns_rr_list_sort_oct(ldns_rr_list *unsorted);
  */
 int ldns_rr_compare(const ldns_rr *rr1, const ldns_rr *rr2);
 
-/**
- * compares two rrs. (owner-class-type order)
- * \param[in] rr1 the first one
- * \param[in] rr2 the second one
- * \return 0 if equal
- *         -1 if rr1 comes before rr2
- *         +1 if rr2 comes before rr1
- */
-int ldns_rr_compare_oct(const ldns_rr *rr1, const ldns_rr *rr2);
-
 /**
  * returns true of the given rr's are equal.
  * Also returns true if one record is a DS that represents the
diff --git a/net.c b/net.c
index 2c41931fccea9a1d8cca6206b9622664d620bcb4..b0d39bea67f2f1d5a98d67ada5db83c88cd6d2e4 100644 (file)
--- a/net.c
+++ b/net.c
@@ -215,8 +215,6 @@ ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t
 
 /* 
  * ldns_tcp_server_connect
- *
- * and the normal conetc, for just a socket
  */
 int
 ldns_udp_server_connect(const struct sockaddr_storage *to, struct timeval timeout)
diff --git a/rr.c b/rr.c
index 64ff21e1e6c487faf367868967842beddb74806c..4b0a78553cd7bf44ea7da0b6a9dc6eca4e8f1ee0 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -1104,14 +1104,6 @@ qsort_rr_compare(const void *a, const void *b)
        return ldns_rr_compare(rr1, rr2);
 }
 
-static int
-qsort_rr_compare_oct(const void *a, const void *b)
-{
-       const ldns_rr *rr1 = * (const ldns_rr **) a;
-       const ldns_rr *rr2 = * (const ldns_rr **) b;
-       return ldns_rr_compare_oct(rr1, rr2);
-}
-
 void
 ldns_rr_list_sort(ldns_rr_list *unsorted)
 {
@@ -1123,56 +1115,6 @@ ldns_rr_list_sort(ldns_rr_list *unsorted)
        }
 }
 
-void
-ldns_rr_list_sort_oct(ldns_rr_list *unsorted)
-{
-       if (unsorted) {
-               qsort(unsorted->_rrs,
-                     ldns_rr_list_rr_count(unsorted),
-                     sizeof(ldns_rr *),
-                     qsort_rr_compare_oct);
-       }
-}
-
-/* sort by owner - class - type */
-int
-ldns_rr_compare_oct(const ldns_rr *rr1, const ldns_rr *rr2)
-{
-       char *n1, *n2;
-       ldns_rr_class c1, c2;
-       ldns_rr_type t1, t2;
-       int result;
-       
-       n1 = ldns_rdf2str(ldns_rr_owner(rr1));
-       n2 = ldns_rdf2str(ldns_rr_owner(rr2));
-       c1 = ldns_rr_get_class(rr1);
-       c2 = ldns_rr_get_class(rr2);
-       t1 = ldns_rr_get_type(rr1);
-       t2 = ldns_rr_get_type(rr2);     
-       
-       result = strcmp(n1, n2);
-       if (result == 0) {
-               if (c1 < c2) {
-                       result = -1;
-               } else if (c1 > c2) {
-                       result = 1;
-               } else {
-                       if (t1 < t2) {
-                               result = -1;
-                       } else if (t1 > t2) {
-                               result = 1;
-                       } else {
-                               result = 0;
-                       }
-               }
-       }
-       
-       LDNS_FREE(n1);
-       LDNS_FREE(n2);
-       return result;
-       
-}
-
 int
 ldns_rr_compare(const ldns_rr *rr1, const ldns_rr *rr2)
 {