X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fsorter.h;h=89cf9f0df7f4e5b5160658d5a0b99f8747943ff7;hb=969ce845f3bf35bb7423bac705d46196bb863e72;hp=d9ae7a00db4572bbd09d92810e53d7c6458b1856;hpb=557dc31fa097cfe3b8fdbc087e27da6db7317819;p=libucw.git diff --git a/lib/sorter/sorter.h b/lib/sorter/sorter.h index d9ae7a00..89cf9f0d 100644 --- a/lib/sorter/sorter.h +++ b/lib/sorter/sorter.h @@ -52,7 +52,7 @@ * SORT_HASH_BITS signals that a monotone hashing function returning a given number of * bits is available. Monotone hash is a function f such that f(x) < f(y) * implies x < y and which is approximately uniformly distributed. - * uns PREFIX_hash(SORT_KEY *a, SORT_KEY *b) + * uns PREFIX_hash(SORT_KEY *a) * * Unification: * @@ -172,9 +172,18 @@ static inline void P(copy_data)(P(key) *key, struct fastbuf *in, struct fastbuf #endif } +#if defined(SORT_VAR_KEY) || defined(SORT_VAR_DATA) || defined(SORT_UNIFY) #include "lib/sorter/s-internal.h" +#else +#include "lib/sorter/s-fixint.h" +#endif + #include "lib/sorter/s-twoway.h" +#if defined(SORT_HASH_BITS) || defined(SORT_INT) +#include "lib/sorter/s-radix.h" +#endif + static struct fastbuf *P(sort)( #ifdef SORT_INPUT_FILE byte *in, @@ -223,13 +232,16 @@ static struct fastbuf *P(sort)( #ifdef SORT_HASH_BITS ctx.hash_bits = SORT_HASH_BITS; + ctx.radix_split = P(radix_split); #elif defined(SORT_INT) ctx.hash_bits = 0; while (ctx.hash_bits < 32 && (int_range >> ctx.hash_bits)) ctx.hash_bits++; + ctx.radix_split = P(radix_split); #endif ctx.internal_sort = P(internal); + ctx.internal_estimate = P(internal_estimate); ctx.twoway_merge = P(twoway_merge); sorter_run(&ctx);