added function 'con_by_mark' to look up a con holding the given mark
This commit is contained in:
parent
9613a0744d
commit
c4a84385d6
|
@ -126,6 +126,13 @@ Con *con_by_window_id(xcb_window_t window);
|
|||
*/
|
||||
Con *con_by_frame_id(xcb_window_t frame);
|
||||
|
||||
/**
|
||||
* Returns the container with the given mark or NULL if no such container
|
||||
* exists.
|
||||
*
|
||||
*/
|
||||
Con *con_by_mark(const char *mark);
|
||||
|
||||
/**
|
||||
* Returns the first container below 'con' which wants to swallow this window
|
||||
* TODO: priority
|
||||
|
|
15
src/con.c
15
src/con.c
|
@ -460,6 +460,21 @@ Con *con_by_frame_id(xcb_window_t frame) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the container with the given mark or NULL if no such container
|
||||
* exists.
|
||||
*
|
||||
*/
|
||||
Con *con_by_mark(const char *mark) {
|
||||
Con *con;
|
||||
TAILQ_FOREACH(con, &all_cons, all_cons) {
|
||||
if (con->mark != NULL && strcmp(con->mark, mark) == 0)
|
||||
return con;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the first container below 'con' which wants to swallow this window
|
||||
* TODO: priority
|
||||
|
|
Loading…
Reference in New Issue