Sync OpenBSD patchset 320:

Reference count clients and sessions rather than relying on a saved index for
cmd-choose-*.
This commit is contained in:
Tiago Cunha
2009-09-07 23:59:19 +00:00
parent 1de812d5a8
commit 930f67f474
7 changed files with 113 additions and 46 deletions

10
tmux.h
View File

@ -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 <nicm@users.sourceforge.net>
@ -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);