X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fsorter%2Fsorter.h;h=939aeb6be61734414da19656e4b59625c7c5c166;hb=HEAD;hp=568ced03ea4a79d04a8d4944bf0ad9a794e2c272;hpb=031256ad2e123eec58521f8e3eb9496c197641d2;p=libucw.git diff --git a/ucw/sorter/sorter.h b/ucw/sorter/sorter.h index 568ced03..939aeb6b 100644 --- a/ucw/sorter/sorter.h +++ b/ucw/sorter/sorter.h @@ -62,17 +62,17 @@ * bits is available. A monotone hash is a function f from keys to integers * such that f(x) < f(y) implies x < y, which is approximately uniformly * distributed. It should be declared as: - * uns PREFIX_hash(SORT_KEY *a) + * uint PREFIX_hash(SORT_KEY *a) * * Unification: * * SORT_UNIFY merge items with identical keys. It requires the following functions: - * void PREFIX_write_merged(struct fastbuf *f, SORT_KEY **keys, void **data, uns n, void *buf) + * void PREFIX_write_merged(struct fastbuf *f, SORT_KEY **keys, void **data, uint n, void *buf) * takes n records in memory with keys which compare equal and writes * a single record to the given fastbuf. `buf' points to a buffer which * is guaranteed to hold the sum of workspace requirements (see below) * over all given records. The function is allowed to modify all its inputs. - * void PREFIX_copy_merged(SORT_KEY **keys, struct fastbuf **data, uns n, struct fastbuf *dest) + * void PREFIX_copy_merged(SORT_KEY **keys, struct fastbuf **data, uint n, struct fastbuf *dest) * takes n records with keys in memory and data in fastbufs and writes * a single record. Used only if SORT_DATA_SIZE or SORT_UNIFY_WORKSPACE * is defined. @@ -114,8 +114,9 @@ * undef'd. */ -#include "ucw/sorter/common.h" -#include "ucw/fastbuf.h" +#include +#include +#include #include @@ -142,7 +143,7 @@ typedef u64 P(hash_t); #define SORT_INT SORT_INT64 #define SORT_LONG_HASH #else -typedef uns P(hash_t); +typedef uint P(hash_t); #endif #ifdef SORT_INT @@ -197,7 +198,7 @@ static inline void P(copy_data)(P(key) *key, struct fastbuf *in, struct fastbuf } #if defined(SORT_UNIFY) && !defined(SORT_VAR_DATA) && !defined(SORT_UNIFY_WORKSPACE) -static inline void P(copy_merged)(P(key) **keys, struct fastbuf **data UNUSED, uns n, struct fastbuf *dest) +static inline void P(copy_merged)(P(key) **keys, struct fastbuf **data UNUSED, uint n, struct fastbuf *dest) { P(write_merged)(dest, keys, NULL, n, NULL); } @@ -205,17 +206,17 @@ static inline void P(copy_merged)(P(key) **keys, struct fastbuf **data UNUSED, u #if defined(SORT_HASH_BITS) || defined(SORT_INT) #define SORT_INTERNAL_RADIX -#include "ucw/sorter/s-radix.h" +#include #endif #if defined(SORT_VAR_KEY) || defined(SORT_VAR_DATA) || defined(SORT_UNIFY_WORKSPACE) -#include "ucw/sorter/s-internal.h" +#include #else -#include "ucw/sorter/s-fixint.h" +#include #endif -#include "ucw/sorter/s-twoway.h" -#include "ucw/sorter/s-multiway.h" +#include +#include static struct fastbuf *P(sort)( #ifdef SORT_INPUT_FILE