sort.c
432 Bytes
#include <stdlib.h>
#include <search.h>
#include "http/header.h"
static
inline
int
comp (const void * _a, const void * _b)
{
const HttpHeader a = *(const HttpHeader *)_a;
const HttpHeader b = *(const HttpHeader *)_b;
return (a->hash < b->hash)? -1 : (a->hash > b->hash)? 1 : 0;
}
void
httpHeaderSort(const HttpHeader header[], int nheader)
{
qsort((void*)header, nheader, sizeof(HttpHeader), comp);
}
// vim: set ts=4 sw=4: