Implement mapping from string to layout as extra function

This commit is contained in:
s3rb31
2017-02-21 02:12:39 +01:00
parent 367811be2d
commit 3410cb256d
3 changed files with 34 additions and 14 deletions

View File

@ -69,6 +69,14 @@ Rect rect_sub(Rect a, Rect b);
*/
__attribute__((pure)) bool name_is_digits(const char *name);
/**
* Set 'out' to the layout_t value for the given layout. The function
* returns true on success or false if the passed string is not a valid
* layout name.
*
*/
bool layout_from_name(const char *layout_str, layout_t *out);
/**
* Parses the workspace name as a number. Returns -1 if the workspace should be
* interpreted as a "named workspace".