diff options
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c index 78d46a2a..f4588b57 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _XOPEN_SOURCE 700 | 1 | #define _XOPEN_SOURCE 700 |
2 | #include <assert.h> | ||
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |
4 | #include <unistd.h> | 5 | #include <unistd.h> |
@@ -138,3 +139,18 @@ bool parse_boolean(const char *boolean, bool current) { | |||
138 | // All other values are false to match i3 | 139 | // All other values are false to match i3 |
139 | return false; | 140 | return false; |
140 | } | 141 | } |
142 | |||
143 | enum wlr_direction opposite_direction(enum wlr_direction d) { | ||
144 | switch (d) { | ||
145 | case WLR_DIRECTION_UP: | ||
146 | return WLR_DIRECTION_DOWN; | ||
147 | case WLR_DIRECTION_DOWN: | ||
148 | return WLR_DIRECTION_UP; | ||
149 | case WLR_DIRECTION_RIGHT: | ||
150 | return WLR_DIRECTION_LEFT; | ||
151 | case WLR_DIRECTION_LEFT: | ||
152 | return WLR_DIRECTION_RIGHT; | ||
153 | } | ||
154 | assert(false); | ||
155 | return 0; | ||
156 | } | ||