sortlist.c revision cd60cef97d8cd3864a0ae5fe6c1ea22dcb6f2fda
/*
* Copyright (C) 2000, 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: sortlist.c,v 1.7 2001/10/30 19:45:33 gson Exp $ */
#include <config.h>
#include <named/sortlist.h>
unsigned int i;
goto dont_sort;
/*
* 'e' refers to the current 'top level statement'
* in the sortlist (see ARM).
*/
if (e->type == dns_aclelementtype_nestedacl) {
goto dont_sort;
goto dont_sort;
} else {
/*
* BIND 8 allows bare elements at the top level
* as an undocumented feature.
*/
try_elt = e;
}
&matched_elt)) {
else
goto dont_sort;
return (NS_SORTLISTTYPE_2ELEMENT);
} else {
*argp = matched_elt;
return (NS_SORTLISTTYPE_1ELEMENT);
}
}
}
/* No match; don't sort. */
return (NS_SORTLISTTYPE_NONE);
}
int
int match;
if (match > 0)
return (match);
else if (match < 0)
else
return (INT_MAX / 2);
}
int
NULL)) {
return (0);
} else {
return (INT_MAX);
}
}
void
void **argp)
{
switch (sortlisttype) {
case NS_SORTLISTTYPE_1ELEMENT:
break;
case NS_SORTLISTTYPE_2ELEMENT:
break;
case NS_SORTLISTTYPE_NONE:
break;
default:
"unexpected return from ns_sortlist_setup(): "
"%d", sortlisttype);
break;
}
}