-Workspace *workspace_get(int number) {
- Workspace *ws = NULL;
- TAILQ_FOREACH(ws, workspaces, workspaces)
- if (ws->num == number)
- return ws;
-
- /* If we are still there, we could not find the requested workspace. */
- int last_ws = TAILQ_LAST(workspaces, workspaces_head)->num;
-
- DLOG("We need to initialize that one, last ws = %d\n", last_ws);
+Con *workspace_get(const char *num) {
+ Con *output, *workspace = NULL, *current;
+
+ /* TODO: could that look like this in the future?
+ GET_MATCHING_NODE(workspace, croot, strcasecmp(current->name, num) != 0);
+ */
+ TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
+ TAILQ_FOREACH(current, &(output->nodes_head), nodes) {
+ if (strcasecmp(current->name, num) != 0)
+ continue;
+
+ workspace = current;
+ break;
+ }
+ }