The branch, hooks has been updated
via 49aba762dd836d9400ef306eeab555c40a501ce6 (commit)
from d12b830caca60c2c3b888e66c967283d9dcef620 (commit)
- Log -----------------------------------------------------------------
commit 49aba762dd836d9400ef306eeab555c40a501ce6
Author: Thomas Adam <[email protected]>
Commit: Thomas Adam <[email protected]>
Define struct alerts for holding alert info
As a preparatory step in making the default session consider sessions with
alerts as being preferred, define a structure to hold this information.
---
server-window.c | 10 ++++++++++
server.c | 1 +
tmux.h | 11 +++++++++++
3 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/server-window.c b/server-window.c
index b523299..d5e29fe 100644
--- a/server-window.c
+++ b/server-window.c
@@ -21,9 +21,13 @@
#include <event.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include "tmux.h"
+struct alerts alerts;
+RB_GENERATE(alerts, alert, entry, alert_cmp);
+
int server_window_check_bell(struct session *, struct winlink *);
int server_window_check_activity(struct session *, struct winlink *);
int server_window_check_silence(struct session *, struct winlink *);
@@ -41,6 +45,12 @@ const struct window_flag_hook
window_flag_hook_names[] = {
{WINLINK_SILENCE, "on-window-silence"},
};
+int
+alert_cmp(struct alert *a1, struct alert *a2)
+{
+ return (strcmp(a1->s->name, a2->s->name));
+}
+
/* Window functions that need to happen every loop. */
void
server_window_loop(void)
diff --git a/server.c b/server.c
index 9b11e01..e3d5008 100644
--- a/server.c
+++ b/server.c
@@ -145,6 +145,7 @@ server_start(int lockfd, char *lockfile)
RB_INIT(&sessions);
RB_INIT(&dead_sessions);
TAILQ_INIT(&session_groups);
+ RB_INIT(&alerts);
mode_key_init_trees();
key_bindings_init();
utf8_build();
diff --git a/tmux.h b/tmux.h
index fedb5da..ad98fd5 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1085,6 +1085,14 @@ struct session {
RB_HEAD(sessions, session);
ARRAY_DECL(sessionslist, struct session *);
+/* Alert information. */
+struct alert {
+ struct session *s;
+ struct winlinks windows;
+ RB_ENTRY(alert) entry;
+};
+RB_HEAD(alerts, alert);
+
/* TTY information. */
struct tty_key {
char ch;
@@ -1942,6 +1950,9 @@ void server_client_status_timer(void);
void server_client_loop(void);
/* server-window.c */
+extern struct alerts alerts;
+RB_PROTOTYPE(alerts, alert, entry, alert_cmp);
+int alert_cmp(struct alert *, struct alert *);
void server_window_loop(void);
/* server-fn.c */
-----------------------------------------------------------------------
Summary of changes:
server-window.c | 10 ++++++++++
server.c | 1 +
tmux.h | 11 +++++++++++
3 files changed, 22 insertions(+), 0 deletions(-)
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs