aboutsummaryrefslogtreecommitdiff
path: root/tools/tool.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/tool.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/tool.h b/tools/tool.h
index 59407b6..5eec318 100644
--- a/tools/tool.h
+++ b/tools/tool.h
@@ -11,11 +11,12 @@
11static void log_stderr(const char *, ...); 11static void log_stderr(const char *, ...);
12static void log_stdout(const char *, ...); 12static void log_stdout(const char *, ...);
13static double timerun(void (*)(void), const char *); 13static double timerun(void (*)(void), const char *);
14static void getfilename(const char *, const char *, char *);
14static void writetable(const char *, int64_t, const char *); 15static void writetable(const char *, int64_t, const char *);
15static int64_t generatetable(const char *, const char *, char **); 16static int64_t generatetable(const char *, const char *, char **);
16static int64_t derivetable(uint8_t, char **); 17static int64_t derivetable(uint8_t, char **);
17static int getdata(const char *, const char *, char **, const char *); 18static int getdata(const char *, const char *, char **, const char *);
18static void gendata_run(const char *, const char *, const char *, uint64_t[static 21]); 19static void gendata_run(const char *, const char *, uint64_t[static 21]);
19static void derivedata_run(uint8_t, const char *, uint64_t[static 21]); 20static void derivedata_run(uint8_t, const char *, uint64_t[static 21]);
20 21
21static void 22static void
@@ -73,6 +74,17 @@ timerun(void (*run)(void), const char *name)
73} 74}
74 75
75static void 76static void
77getfilename(const char *solver, const char *options, char *filename)
78{
79 uint8_t h, k;
80
81 /* Only h48 supported for now */
82 parse_h48_options(options, &h, &k, NULL);
83
84 sprintf(filename, "tables/%sh%dk%d", solver, h, k);
85}
86
87static void
76writetable(const char *buf, int64_t size, const char *filename) 88writetable(const char *buf, int64_t size, const char *filename)
77{ 89{
78 FILE *f; 90 FILE *f;
@@ -193,13 +205,12 @@ static void
193gendata_run( 205gendata_run(
194 const char *solver, 206 const char *solver,
195 const char *options, 207 const char *options,
196 const char *filename, /* TODO: remove filename, use solver name */
197 uint64_t expected[static 21] 208 uint64_t expected[static 21]
198) { 209) {
199 int64_t size; 210 int64_t size;
200 char *buf; 211 char *buf, filename[1024];
201 212
202 213 getfilename(solver, options, filename);
203 size = generatetable(solver, options, &buf); 214 size = generatetable(solver, options, &buf);
204 switch (size) { 215 switch (size) {
205 case -1: 216 case -1:

Generated with cgit - Back to sebastiano.tronto.net