From: Miek Gieben Date: Tue, 10 Jan 2006 14:57:52 +0000 (+0000) Subject: removed the _oct sorting functions X-Git-Tag: release-1.1.0~448 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abd9372da4fe97e2a1cc9b5fafd0fe036faabcc7;p=thirdparty%2Fldns.git removed the _oct sorting functions --- diff --git a/ldns/rr.h b/ldns/rr.h index cbb0d96e..8d571927 100644 --- 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 2c41931f..b0d39bea 100644 --- 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 64ff21e1..4b0a7855 100644 --- 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) {