summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-10 10:02:49 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-10 10:02:49 +0000
commit1a7d94b31f73fd2780347ed40c36a275984d82f5 (patch)
treec75a5b36b46e37774308415dee9f0d21d80cf252 /usr.bin/tmux/tmux.h
parent930bee8dee77f0a986fac1edcc836ff0d62c5165 (diff)
Add "grouped sessions" which have independent name, options, current window and
so on but where the linked windows are synchronized (ie creating, killing windows and so on are mirrored between the sessions). A grouped session may be created by passing -t to new-session. Had this around for a while, tested by a couple of people.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 2fd7ad7e771..2b6f66297d6 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.123 2009/10/10 09:46:11 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.124 2009/10/10 10:02:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -739,10 +739,10 @@ struct winlink {
struct window *window;
RB_ENTRY(winlink) entry;
- SLIST_ENTRY(winlink) sentry;
+ TAILQ_ENTRY(winlink) sentry;
};
RB_HEAD(winlinks, winlink);
-SLIST_HEAD(winlink_stack, winlink);
+TAILQ_HEAD(winlink_stack, winlink);
/* Layout direction. */
enum layout_type {
@@ -797,6 +797,13 @@ struct session_alert {
SLIST_ENTRY(session_alert) entry;
};
+struct session_group {
+ TAILQ_HEAD(, session) sessions;
+
+ TAILQ_ENTRY(session_group) entry;
+};
+TAILQ_HEAD(session_groups, session_group);
+
struct session {
char *name;
struct timeval tv;
@@ -824,6 +831,8 @@ struct session {
struct environ environ;
int references;
+
+ TAILQ_ENTRY(session) gentry;
};
ARRAY_DECL(sessions, struct session *);
@@ -1456,7 +1465,9 @@ void server_write_session(
void server_redraw_client(struct client *);
void server_status_client(struct client *);
void server_redraw_session(struct session *);
+void server_redraw_session_group(struct session *);
void server_status_session(struct session *);
+void server_status_session_group(struct session *);
void server_redraw_window(struct window *);
void server_status_window(struct window *);
void server_lock(void);
@@ -1464,9 +1475,10 @@ void server_lock_session(struct session *);
void server_lock_client(struct client *);
int server_unlock(const char *);
void server_kill_window(struct window *);
-int server_link_window(
+int server_link_window(struct session *,
struct winlink *, struct session *, int, int, int, char **);
void server_unlink_window(struct session *, struct winlink *);
+void server_destroy_session_group(struct session *);
void server_destroy_session(struct session *);
void server_set_identify(struct client *);
void server_clear_identify(struct client *);
@@ -1719,6 +1731,7 @@ char *default_window_name(struct window *);
/* session.c */
extern struct sessions sessions;
extern struct sessions dead_sessions;
+extern struct session_groups session_groups;
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);
@@ -1739,6 +1752,13 @@ int session_next(struct session *, int);
int session_previous(struct session *, int);
int session_select(struct session *, int);
int session_last(struct session *);
+struct session_group *session_group_find(struct session *);
+u_int session_group_index(struct session_group *);
+void session_group_add(struct session *, struct session *);
+void session_group_remove(struct session *);
+void session_group_synchronize_to(struct session *);
+void session_group_synchronize_from(struct session *);
+void session_group_synchronize1(struct session *, struct session *);
/* utf8.c */
void utf8_build(void);