Previous: keyval_perror, Up: KeyVal [Contents]
compare KeyVal
structures, alphabetically
#include <suplib/keyval.h> int keyval_cmp( const void *v1, const void *v2 );
const void *v1
pointer to first
KeyVal
structureconst void *v2
pointer to second
KeyVal
structure
keyval_cmp
is an alphabetical comparison routine for
KeyVal
structures intended for use by bsearch
or
qsort
.
It returns ‘-1’ if the first structure is lexically earlier than the second, ‘0’ if they are the same, and ‘1’ if the first is lexically after the second.
Diab Jerius