aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-04-25 20:45:02 +0000
committerThomas Adam <thomas@xteddy.org>2015-04-25 20:45:02 +0000
commit72e9ebf2ece28c986050162bf4f401a6a7679f53 (patch)
treec31a424328859542a7a1248a9e411aac8fc5b3e9 /window.c
parent56e1132db485aeb0730ce7782533ca441e63afef (diff)
parenta568b9cadce002f6f7e8ee914c995242bd70cce5 (diff)
downloadrtmux-72e9ebf2ece28c986050162bf4f401a6a7679f53.tar.gz
rtmux-72e9ebf2ece28c986050162bf4f401a6a7679f53.tar.bz2
rtmux-72e9ebf2ece28c986050162bf4f401a6a7679f53.zip
Merge branch 'obsd-master'
Diffstat (limited to 'window.c')
-rw-r--r--window.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/window.c b/window.c
index cac4036b..762442d0 100644
--- a/window.c
+++ b/window.c
@@ -48,6 +48,8 @@
* it reaches zero.
*/
+ARRAY_DECL(window_pane_list, struct window_pane *);
+
/* Global window list. */
struct windows windows;
@@ -253,6 +255,21 @@ winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl)
}
struct window *
+window_find_by_id_str(const char* s)
+{
+ const char *errstr;
+ u_int id;
+
+ if (*s != '@')
+ return (NULL);
+
+ id = strtonum(s + 1, 0, UINT_MAX, &errstr);
+ if (errstr != NULL)
+ return (NULL);
+ return (window_find_by_id(id));
+}
+
+struct window *
window_find_by_id(u_int id)
{
struct window w;
@@ -652,7 +669,21 @@ window_printable_flags(struct session *s, struct winlink *wl)
return (xstrdup(flags));
}
-/* Find pane in global tree by id. */
+struct window_pane *
+window_pane_find_by_id_str(const char *s)
+{
+ const char *errstr;
+ u_int id;
+
+ if (*s != '%')
+ return (NULL);
+
+ id = strtonum(s + 1, 0, UINT_MAX, &errstr);
+ if (errstr != NULL)
+ return (NULL);
+ return (window_pane_find_by_id(id));
+}
+
struct window_pane *
window_pane_find_by_id(u_int id)
{