#include "brt-internal.h" #include #include int keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) { if (key1len==key2len) { return memcmp(key1,key2,key1len); } else if (key1len0); assert(keycompare("a",1, "aa",2)<0); assert(keycompare("b",1, "aa",2)>0); assert(keycompare("aa",2, "b",1)<0); assert(keycompare("aaaba",5, "aaaba",5)==0); assert(keycompare("aaaba",5, "aaaaa",5)>0); assert(keycompare("aaaaa",5, "aaaba",5)<0); assert(keycompare("aaaaa",3, "aaaba",3)==0); }