diff options
Diffstat (limited to 'src/fst.c')
| -rw-r--r-- | src/fst.c | 58 |
1 files changed, 58 insertions, 0 deletions
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 @@ | |||
| 1 | #define FST_C | ||
| 2 | |||
| 3 | #include "fst.h" | ||
| 4 | |||
| 5 | static void fst_to_ep(FstCube fst, int *ep); | ||
| 6 | |||
| 7 | FstCube | ||
| 8 | cube_to_fst(Cube *cube) | ||
| 9 | { | ||
| 10 | Cube c; | ||
| 11 | FstCube ret; | ||
| 12 | |||
| 13 | copy_cube(cube, &c); | ||
| 14 | ret.uf_eofb = index_eofb(&c); | ||
| 15 | ret.uf_eposepe = index_eposepe(&c); | ||
| 16 | ret.uf_coud = index_coud(&c); | ||
| 17 | ret.uf_cp = index_cp(&c); | ||
| 18 | copy_cube(cube, &c); | ||
| 19 | transform_cube(fr, &c); | ||
| 20 | ret.fr_eofb = index_eofb(&c); | ||
| 21 | ret.fr_eposepe = index_eposepe(&c); | ||
| 22 | ret.fr_coud = index_coud(&c); | ||
| 23 | transform_cube(rd, &c); | ||
| 24 | ret.rd_eofb = index_eofb(&c); | ||
| 25 | ret.rd_eposepe = index_eposepe(&c); | ||
| 26 | ret.rd_coud = index_coud(&c); | ||
| 27 | |||
| 28 | return ret; | ||
| 29 | } | ||
| 30 | |||
| 31 | FstCube | ||
| 32 | fst_inverse(FstCube fst) | ||
| 33 | { | ||
| 34 | /* TODO */ | ||
| 35 | } | ||
| 36 | |||
| 37 | FstCube | ||
| 38 | fst_move(Move m, FstCube fst) | ||
| 39 | { | ||
| 40 | /* TODO */ | ||
| 41 | } | ||
| 42 | |||
| 43 | void | ||
| 44 | fst_to_cube(FstCube fst, Cube *cube) | ||
| 45 | { | ||
| 46 | invindex_eofb((uint64_t)fst.uf_eofb, cube); | ||
| 47 | fst_to_ep(fst, cube->ep); | ||
| 48 | invindex_coud((uint64_t)fst.uf_coud, cube); | ||
| 49 | invindex_cp((uint64_t)fst.uf_cp, cube); | ||
| 50 | } | ||
| 51 | |||
| 52 | static void | ||
| 53 | fst_to_ep(FstCube fst, int *ep) | ||
| 54 | { | ||
| 55 | /* TODO */ | ||
| 56 | } | ||
| 57 | |||
| 58 | #endif | ||
