Introduce orientation_from_direction

This commit is contained in:
Orestis Floros
2018-08-23 15:36:23 +03:00
parent 72cc719c5d
commit 6e1b79e057
4 changed files with 16 additions and 2 deletions

View File

@ -507,3 +507,11 @@ ssize_t slurp(const char *path, char **buf) {
}
return (ssize_t)n;
}
/*
* Convert a direction to its corresponding orientation.
*
*/
orientation_t orientation_from_direction(direction_t direction) {
return (direction == D_LEFT || direction == D_RIGHT) ? HORIZ : VERT;
}