diff options
Diffstat (limited to 'src/solvers/coord/common.h')
| -rw-r--r-- | src/solvers/coord/common.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/solvers/coord/common.h b/src/solvers/coord/common.h deleted file mode 100644 index 1d6e622..0000000 --- a/src/solvers/coord/common.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #include "eo.h" | ||
| 2 | |||
| 3 | coord_t *all_coordinates[] = { | ||
| 4 | &coordinate_eo, | ||
| 5 | NULL | ||
| 6 | }; | ||
| 7 | |||
| 8 | STATIC void append_coord_name(const coord_t *, char *); | ||
| 9 | STATIC coord_t *parse_coord(const char *, int); | ||
| 10 | STATIC uint8_t parse_axis(const char *, int); | ||
| 11 | |||
| 12 | STATIC void | ||
| 13 | append_coord_name(const coord_t *coord, char *str) | ||
| 14 | { | ||
| 15 | int i, j; | ||
| 16 | |||
| 17 | i = 0; | ||
| 18 | j = strlen(str); | ||
| 19 | while (coord->name[i]) str[j++] = coord->name[i++]; | ||
| 20 | |||
| 21 | str[j] = '\0'; | ||
| 22 | } | ||
| 23 | |||
| 24 | STATIC coord_t * | ||
| 25 | parse_coord(const char *coord, int n) | ||
| 26 | { | ||
| 27 | int i; | ||
| 28 | |||
| 29 | for (i = 0; all_coordinates[i] != NULL; i++) | ||
| 30 | if (!strncmp(all_coordinates[i]->name, coord, n)) | ||
| 31 | return all_coordinates[i]; | ||
| 32 | |||
| 33 | return NULL; | ||
| 34 | } | ||
| 35 | |||
| 36 | STATIC uint8_t | ||
| 37 | parse_axis(const char *axis, int n) | ||
| 38 | { | ||
| 39 | if (!strncmp(axis, "UD", n) || !strncmp(axis, "DU", n)) { | ||
| 40 | return AXIS_UD; | ||
| 41 | } else if (!strncmp(axis, "RL", n) || !strncmp(axis, "LR", n)) { | ||
| 42 | return AXIS_RL; | ||
| 43 | } else if (!strncmp(axis, "FB", n) || !strncmp(axis, "BF", n)) { | ||
| 44 | return AXIS_FB; | ||
| 45 | } | ||
| 46 | |||
| 47 | return UINT8_ERROR; | ||
| 48 | } | ||
