Configuration is shared with the old sorter.
-# Makefile for the UCW Library (c) 1997--2006 Martin Mares <mj@ucw.cz>
+# Makefile for the UCW Library (c) 1997--2007 Martin Mares <mj@ucw.cz>
DIRS+=lib
+LIBUCW=$(o)/lib/libucw.$(LS)
ifdef CONFIG_UCW_DBTOOL
PROGS+=$(o)/lib/db-tool
include $(s)/lib/regex/Makefile
endif
-LIBUCW=$(o)/lib/libucw.$(LS)
+include $(s)/lib/sorter/Makefile
+
LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
$(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
#ifndef _UCW_SORTER_GLOBALS_H
#define _UCW_SORTER_GLOBALS_H
-extern uns sorter_trace;
-extern uns sorter_presort_bufsize;
-extern uns sorter_stream_bufsize;
+/* The old sorter shares configuration with the new one */
+#include "lib/sorter/common.h"
extern uns sorter_pass_counter;
*/
#include "lib/lib.h"
-#include "lib/conf.h"
-#include "lib/fastbuf.h"
#include "lib/sorter-globals.h"
-#include <unistd.h>
-#include <sys/fcntl.h>
-
-uns sorter_trace;
-uns sorter_presort_bufsize = 65536;
-uns sorter_stream_bufsize = 65536;
-
-static struct cf_section sorter_config = {
- CF_ITEMS {
- CF_UNS("Trace", &sorter_trace),
- CF_UNS("PresortBuffer", &sorter_presort_bufsize),
- CF_UNS("StreamBuffer", &sorter_stream_bufsize),
- CF_END
- }
-};
-
-static void CONSTRUCTOR sorter_init_config(void)
-{
- cf_declare_section("Sorter", &sorter_config, 0);
-}
-
uns sorter_pass_counter;
--- /dev/null
+# Makefile for the UCW Sorter (c) 2007 Martin Mares <mj@ucw.cz>
+
+DIRS+=lib/sorter
+
+LIBUCW_MODS+=sorter/config
--- /dev/null
+/*
+ * UCW Library -- Universal Sorter
+ *
+ * (c) 2007 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
+ */
+
+#ifndef _UCW_SORTER_COMMON_H
+#define _UCW_SORTER_COMMON_H
+
+/* Configuration, some of the variables are used by the old sorter, too. */
+extern uns sorter_trace, sorter_presort_bufsize, sorter_stream_bufsize;
+
+#endif
--- /dev/null
+/*
+ * UCW Library -- Universal Sorter -- Configuration
+ *
+ * (c) 2007 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
+ */
+
+#include "lib/lib.h"
+#include "lib/conf.h"
+#include "lib/fastbuf.h"
+#include "lib/sorter/common.h"
+
+uns sorter_trace;
+uns sorter_presort_bufsize = 65536;
+uns sorter_stream_bufsize = 65536;
+
+static struct cf_section sorter_config = {
+ CF_ITEMS {
+ CF_UNS("Trace", &sorter_trace),
+ CF_UNS("PresortBuffer", &sorter_presort_bufsize),
+ CF_UNS("StreamBuffer", &sorter_stream_bufsize),
+ CF_END
+ }
+};
+
+static void CONSTRUCTOR sorter_init_config(void)
+{
+ cf_declare_section("Sorter", &sorter_config, 0);
+}