-/* $OpenBSD: server.c,v 1.180 2018/03/08 08:09:10 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.181 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
RB_INIT(&all_window_panes);
TAILQ_INIT(&clients);
RB_INIT(&sessions);
- RB_INIT(&session_groups);
key_bindings_init();
gettimeofday(&start_time, NULL);
-/* $OpenBSD: session.c,v 1.79 2018/05/04 08:21:42 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.80 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
struct sessions sessions;
static u_int next_session_id;
-struct session_groups session_groups;
+struct session_groups session_groups = RB_INITIALIZER(&session_groups);
static void session_free(int, short, void *);
static void session_group_remove(struct session *);
static void session_group_synchronize1(struct session *, struct session *);
-RB_GENERATE(sessions, session, entry, session_cmp);
-
int
session_cmp(struct session *s1, struct session *s2)
{
return (strcmp(s1->name, s2->name));
}
+RB_GENERATE(sessions, session, entry, session_cmp);
-RB_GENERATE(session_groups, session_group, entry, session_group_cmp);
-
-int
+static int
session_group_cmp(struct session_group *s1, struct session_group *s2)
{
return (strcmp(s1->name, s2->name));
}
+RB_GENERATE_STATIC(session_groups, session_group, entry, session_group_cmp);
/*
* Find if session is still alive. This is true if it is still on the global
-/* $OpenBSD: tmux.h,v 1.834 2018/08/02 11:44:07 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.835 2018/08/02 11:56:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
/* session.c */
extern struct sessions sessions;
-extern struct session_groups session_groups;
int session_cmp(struct session *, struct session *);
RB_PROTOTYPE(sessions, session, entry, session_cmp);
-int session_group_cmp(struct session_group *, struct session_group *);
-RB_PROTOTYPE(session_groups, session_group, entry, session_group_cmp);
int session_alive(struct session *);
struct session *session_find(const char *);
struct session *session_find_by_id_str(const char *);