diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-18 14:26:45 +0200 |
| commit | 18c9a8b8905304cf5f8fc15825769046a3144866 (patch) | |
| tree | a7807bb32b0a5d9ded7d3cedccc598f64a9b00fe /src/core | |
| parent | f25a10e19eca294c4e6a99e4f80ce5cfd11a0e5f (diff) | |
| download | nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.tar.gz nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.zip | |
Reorganized folder structure
Diffstat (limited to '')
| -rw-r--r-- | src/core/constant_cubes.h (renamed from src/constant_cubes.h) | 0 | ||||
| -rw-r--r-- | src/core/core.h | 13 | ||||
| -rw-r--r-- | src/core/cube.h (renamed from src/cube_generic.h) | 0 | ||||
| -rw-r--r-- | src/core/io_cube.h (renamed from src/io_cube.h) | 0 | ||||
| -rw-r--r-- | src/core/io_moves.h (renamed from src/io_move_trans.h) | 25 | ||||
| -rw-r--r-- | src/core/io_trans.h | 25 | ||||
| -rw-r--r-- | src/core/moves.h (renamed from src/moves.h) | 0 | ||||
| -rw-r--r-- | src/core/transform.h (renamed from src/cube_transform.h) | 0 | ||||
| -rw-r--r-- | src/core/transform_with_switch.h (renamed from src/cube_transform_with_switch.h) | 0 |
9 files changed, 38 insertions, 25 deletions
diff --git a/src/constant_cubes.h b/src/core/constant_cubes.h index b7748d8..b7748d8 100644 --- a/src/constant_cubes.h +++ b/src/core/constant_cubes.h | |||
diff --git a/src/core/core.h b/src/core/core.h new file mode 100644 index 0000000..6ffd76f --- /dev/null +++ b/src/core/core.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #include "constant_cubes.h" | ||
| 2 | #include "io_moves.h" | ||
| 3 | #include "io_trans.h" | ||
| 4 | #include "cube.h" | ||
| 5 | #include "io_cube.h" | ||
| 6 | #include "moves.h" | ||
| 7 | |||
| 8 | /* TODO: work in progress */ | ||
| 9 | #if 0 | ||
| 10 | #include "transform.h" | ||
| 11 | #else | ||
| 12 | #include "transform_with_switch.h" | ||
| 13 | #endif | ||
diff --git a/src/cube_generic.h b/src/core/cube.h index fe36f90..fe36f90 100644 --- a/src/cube_generic.h +++ b/src/core/cube.h | |||
diff --git a/src/io_cube.h b/src/core/io_cube.h index 956494d..956494d 100644 --- a/src/io_cube.h +++ b/src/core/io_cube.h | |||
diff --git a/src/io_move_trans.h b/src/core/io_moves.h index cfeb93c..eb6290e 100644 --- a/src/io_move_trans.h +++ b/src/core/io_moves.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | _static uint8_t readmove(char); | 1 | _static uint8_t readmove(char); |
| 2 | _static uint8_t readmodifier(char); | 2 | _static uint8_t readmodifier(char); |
| 3 | _static uint8_t readtrans(const char *); | ||
| 4 | _static int writemoves(uint8_t *, int, char *); | 3 | _static int writemoves(uint8_t *, int, char *); |
| 5 | _static void writetrans(uint8_t, char *); | ||
| 6 | 4 | ||
| 7 | _static uint8_t | 5 | _static uint8_t |
| 8 | readmove(char c) | 6 | readmove(char c) |
| @@ -40,19 +38,6 @@ readmodifier(char c) | |||
| 40 | } | 38 | } |
| 41 | } | 39 | } |
| 42 | 40 | ||
| 43 | _static uint8_t | ||
| 44 | readtrans(const char *buf) | ||
| 45 | { | ||
| 46 | uint8_t t; | ||
| 47 | |||
| 48 | for (t = 0; t < 48; t++) | ||
| 49 | if (!strncmp(buf, transstr[t], 11)) | ||
| 50 | return t; | ||
| 51 | |||
| 52 | LOG("readtrans error\n"); | ||
| 53 | return _error; | ||
| 54 | } | ||
| 55 | |||
| 56 | _static int | 41 | _static int |
| 57 | writemoves(uint8_t *m, int n, char *buf) | 42 | writemoves(uint8_t *m, int n, char *buf) |
| 58 | { | 43 | { |
| @@ -75,13 +60,3 @@ writemoves(uint8_t *m, int n, char *buf) | |||
| 75 | 60 | ||
| 76 | return b - buf; | 61 | return b - buf; |
| 77 | } | 62 | } |
| 78 | |||
| 79 | _static void | ||
| 80 | writetrans(uint8_t t, char *buf) | ||
| 81 | { | ||
| 82 | if (t >= 48) | ||
| 83 | memcpy(buf, "error trans", 11); | ||
| 84 | else | ||
| 85 | memcpy(buf, transstr[t], 11); | ||
| 86 | buf[11] = '\0'; | ||
| 87 | } | ||
diff --git a/src/core/io_trans.h b/src/core/io_trans.h new file mode 100644 index 0000000..7187b7a --- /dev/null +++ b/src/core/io_trans.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | _static uint8_t readtrans(const char *); | ||
| 2 | _static void writetrans(uint8_t, char *); | ||
| 3 | |||
| 4 | _static uint8_t | ||
| 5 | readtrans(const char *buf) | ||
| 6 | { | ||
| 7 | uint8_t t; | ||
| 8 | |||
| 9 | for (t = 0; t < 48; t++) | ||
| 10 | if (!strncmp(buf, transstr[t], 11)) | ||
| 11 | return t; | ||
| 12 | |||
| 13 | LOG("readtrans error\n"); | ||
| 14 | return _error; | ||
| 15 | } | ||
| 16 | |||
| 17 | _static void | ||
| 18 | writetrans(uint8_t t, char *buf) | ||
| 19 | { | ||
| 20 | if (t >= 48) | ||
| 21 | memcpy(buf, "error trans", 11); | ||
| 22 | else | ||
| 23 | memcpy(buf, transstr[t], 11); | ||
| 24 | buf[11] = '\0'; | ||
| 25 | } | ||
diff --git a/src/moves.h b/src/core/moves.h index 7da6405..7da6405 100644 --- a/src/moves.h +++ b/src/core/moves.h | |||
diff --git a/src/cube_transform.h b/src/core/transform.h index 358b051..358b051 100644 --- a/src/cube_transform.h +++ b/src/core/transform.h | |||
diff --git a/src/cube_transform_with_switch.h b/src/core/transform_with_switch.h index d3a108c..d3a108c 100644 --- a/src/cube_transform_with_switch.h +++ b/src/core/transform_with_switch.h | |||
