From 930f67f4740b2ecca065be653339d5cf51c9a19f Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Mon, 7 Sep 2009 23:59:19 +0000 Subject: Sync OpenBSD patchset 320: Reference count clients and sessions rather than relying on a saved index for cmd-choose-*. --- tmux.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 23921b59..2995fb0c 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.438 2009-09-07 23:48:54 tcunha Exp $ */ +/* $Id: tmux.h,v 1.439 2009-09-07 23:59:19 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -810,11 +810,14 @@ struct session { SLIST_HEAD(, session_alert) alerts; #define SESSION_UNATTACHED 0x1 /* not attached to any clients */ +#define SESSION_DEAD 0x2 int flags; struct termios tio; struct environ environ; + + int references; }; ARRAY_DECL(sessions, struct session *); @@ -937,6 +940,7 @@ struct client { #define CLIENT_SUSPENDED 0x40 #define CLIENT_BAD 0x80 #define CLIENT_IDENTIFY 0x100 +#define CLIENT_DEAD 0x200 int flags; struct timeval identify_timer; @@ -961,6 +965,8 @@ struct client { struct mode_key_data prompt_mdata; struct session *session; + + int references; }; ARRAY_DECL(clients, struct client *); @@ -1426,6 +1432,7 @@ const char *key_string_lookup_key(int); /* server.c */ extern struct clients clients; +extern struct clients dead_clients; int server_client_index(struct client *); int server_start(char *); @@ -1700,6 +1707,7 @@ char *default_window_name(struct window *); /* session.c */ extern struct sessions sessions; +extern struct sessions dead_sessions; void session_alert_add(struct session *, struct window *, int); void session_alert_cancel(struct session *, struct winlink *); int session_alert_has(struct session *, struct winlink *, int); -- cgit