File: dns_sort.c

package info (click to toggle)
bglibs 2.04%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,468 kB
  • sloc: ansic: 15,821; perl: 674; sh: 63; makefile: 29
file content (13 lines) | stat: -rw-r--r-- 281 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "dns.h"

static int mxcmp(const void* aptr, const void* bptr)
{
  const struct dns_mx* a = aptr;
  const struct dns_mx* b = bptr;
  return (int)a->distance - (int)b->distance;
}

void dns_sort_mx(struct dns_mx* mxs, int count)
{
  qsort(mxs, count, sizeof *mxs, mxcmp);
}