*
*/
ssize_t slurp(const char *path, char **buf);
+
+/**
+ * Convert a direction to its corresponding orientation.
+ *
+ */
+orientation_t orientation_from_direction(direction_t direction);
return;
}
- orientation_t o = (direction == D_LEFT || direction == D_RIGHT ? HORIZ : VERT);
+ orientation_t o = orientation_from_direction(direction);
Con *same_orientation = con_parent_with_orientation(con, o);
/* The do {} while is used to 'restart' at this point with a different
}
/* Go up in the tree and search for a container to resize */
- const orientation_t search_orientation = ((direction == D_LEFT || direction == D_RIGHT) ? HORIZ : VERT);
+ const orientation_t search_orientation = orientation_from_direction(direction);
const bool dir_backwards = (direction == D_UP || direction == D_LEFT);
while (first->type != CT_WORKSPACE &&
first->type != CT_FLOATING_CON &&
}
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;
+}