X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Futil.c;h=a59283a8dd044a788a645b3296b481bcce4c621d;hb=d407393d0da3dce2382b60c6abf6540a174798a1;hp=dc3444f7b6aa950be8b4696896ac55b1cc4033fc;hpb=f6f198c3fed90cfc4672588cf3d6a8c712f06f97;p=i3%2Fi3 diff --git a/src/util.c b/src/util.c index dc3444f7..a59283a8 100644 --- a/src/util.c +++ b/src/util.c @@ -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; +}