]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/sort-test.c
The write_merged() hook is no longer required in simple cases.
[libucw.git] / lib / sorter / sort-test.c
index 7e3bfd0d61d9a41ac2fe7a1be0149047252ed424..9a822d141847037182f8a40cf3553bd8a16d8904 100644 (file)
@@ -11,6 +11,7 @@
 #include "lib/getopt.h"
 #include "lib/conf.h"
 #include "lib/fastbuf.h"
+#include "lib/ff-binary.h"
 #include "lib/hashfunc.h"
 #include "lib/md5.h"
 
@@ -50,6 +51,7 @@ struct key1 {
 #define SORT_OUTPUT_FB
 #define SORT_UNIQUE
 #define SORT_INT(k) (k).x
+#define SORT_DELETE_INPUT 0
 
 #include "lib/sorter/sorter.h"
 
@@ -93,13 +95,6 @@ static inline void s2_write_merged(struct fastbuf *f, struct key2 **k, void **d
   bwrite(f, k[0], sizeof(struct key2));
 }
 
-static inline void s2_copy_merged(struct key2 **k, struct fastbuf **d UNUSED, uns n, struct fastbuf *dest)
-{
-  for (uns i=1; i<n; i++)
-    k[0]->cnt += k[i]->cnt;
-  bwrite(dest, k[0], sizeof(struct key2));
-}
-
 #define SORT_KEY_REGULAR struct key2
 #define SORT_PREFIX(x) s2_##x
 #define SORT_INPUT_FB
@@ -493,6 +488,7 @@ static int s5_presort(struct fastbuf *dest, void *buf, size_t bufsize)
 #define SORT_PREFIX(x) s5_##x
 #define SORT_DATA_SIZE(k) (4*(k).cnt)
 #define SORT_UNIFY
+#define SORT_UNIFY_WORKSPACE(k) SORT_DATA_SIZE(k)
 #define SORT_INPUT_PRESORT
 #define SORT_OUTPUT_THIS_FB
 #define SORT_INT(k) (k).x
@@ -503,6 +499,7 @@ static int s5_presort(struct fastbuf *dest, void *buf, size_t bufsize)
 #define SORT_PREFIX(x) s5b_##x
 #define SORT_DATA_SIZE(k) (4*(k).cnt)
 #define SORT_UNIFY
+#define SORT_UNIFY_WORKSPACE(k) SORT_DATA_SIZE(k)
 #define SORT_INPUT_FB
 #define SORT_OUTPUT_THIS_FB
 #define SORT_INT(k) (k).x