From 2dce2a8a0ebd95e9e65d9d53206c4b2babc2af2f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 10 Sep 2022 19:13:02 +0200 Subject: Added fst_cube prototypes --- src/fst.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/fst.c (limited to 'src/fst.c') diff --git a/src/fst.c b/src/fst.c new file mode 100644 index 0000000..91c022a --- /dev/null +++ b/src/fst.c @@ -0,0 +1,58 @@ +#define FST_C + +#include "fst.h" + +static void fst_to_ep(FstCube fst, int *ep); + +FstCube +cube_to_fst(Cube *cube) +{ + Cube c; + FstCube ret; + + copy_cube(cube, &c); + ret.uf_eofb = index_eofb(&c); + ret.uf_eposepe = index_eposepe(&c); + ret.uf_coud = index_coud(&c); + ret.uf_cp = index_cp(&c); + copy_cube(cube, &c); + transform_cube(fr, &c); + ret.fr_eofb = index_eofb(&c); + ret.fr_eposepe = index_eposepe(&c); + ret.fr_coud = index_coud(&c); + transform_cube(rd, &c); + ret.rd_eofb = index_eofb(&c); + ret.rd_eposepe = index_eposepe(&c); + ret.rd_coud = index_coud(&c); + + return ret; +} + +FstCube +fst_inverse(FstCube fst) +{ + /* TODO */ +} + +FstCube +fst_move(Move m, FstCube fst) +{ + /* TODO */ +} + +void +fst_to_cube(FstCube fst, Cube *cube) +{ + invindex_eofb((uint64_t)fst.uf_eofb, cube); + fst_to_ep(fst, cube->ep); + invindex_coud((uint64_t)fst.uf_coud, cube); + invindex_cp((uint64_t)fst.uf_cp, cube); +} + +static void +fst_to_ep(FstCube fst, int *ep) +{ + /* TODO */ +} + +#endif -- cgit v1.3