]> mj.ucw.cz Git - libucw.git/blob - ucw/sorter/config.c
tableprinter: return value of table_set_col_opt changed to int
[libucw.git] / ucw / sorter / config.c
1 /*
2  *      UCW Library -- Universal Sorter: Configuration
3  *
4  *      (c) 2007 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include <ucw/lib.h>
11 #include <ucw/conf.h>
12 #include <ucw/fastbuf.h>
13 #include <ucw/sorter/common.h>
14
15 uint sorter_trace;
16 uint sorter_trace_array;
17 u64 sorter_bufsize = 65536;
18 uint sorter_debug;
19 uint sorter_min_radix_bits;
20 uint sorter_max_radix_bits;
21 uint sorter_add_radix_bits;
22 uint sorter_min_multiway_bits;
23 uint sorter_max_multiway_bits;
24 uint sorter_threads;
25 u64 sorter_thread_threshold = 1048576;
26 u64 sorter_thread_chunk = 4096;
27 u64 sorter_radix_threshold = 4096;
28 struct fb_params sorter_fb_params;
29 struct fb_params sorter_small_fb_params;
30 u64 sorter_small_input;
31
32 static struct cf_section sorter_config = {
33   CF_ITEMS {
34     CF_UINT("Trace", &sorter_trace),
35     CF_UINT("TraceArray", &sorter_trace_array),
36     CF_SECTION("FileAccess", &sorter_fb_params, &fbpar_cf),
37     CF_SECTION("SmallFileAccess", &sorter_fb_params, &fbpar_cf),
38     CF_U64("SmallInput", &sorter_small_input),
39     CF_U64("SortBuffer", &sorter_bufsize),
40     CF_UINT("Debug", &sorter_debug),
41     CF_UINT("MinRadixBits", &sorter_min_radix_bits),
42     CF_UINT("MaxRadixBits", &sorter_max_radix_bits),
43     CF_UINT("AddRadixBits", &sorter_add_radix_bits),
44     CF_UINT("MinMultiwayBits", &sorter_min_multiway_bits),
45     CF_UINT("MaxMultiwayBits", &sorter_max_multiway_bits),
46     CF_UINT("Threads", &sorter_threads),
47     CF_U64("ThreadThreshold", &sorter_thread_threshold),
48     CF_U64("ThreadChunk", &sorter_thread_chunk),
49     CF_U64("RadixThreshold", &sorter_radix_threshold),
50     CF_END
51   }
52 };
53
54 static void CONSTRUCTOR sorter_init_config(void)
55 {
56   cf_declare_section("Sorter", &sorter_config, 0);
57 }