-/* $OpenBSD: server-client.c,v 1.232 2017/05/16 12:57:26 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.233 2017/05/29 20:37:30 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
static void server_client_dispatch_identify(struct client *, struct imsg *);
static void server_client_dispatch_shell(struct client *);
+/* Number of attached clients. */
+u_int
+server_client_how_many(void)
+{
+ struct client *c;
+ u_int n;
+
+ n = 0;
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (c->session != NULL && (~c->flags & CLIENT_DETACHING))
+ n++;
+ }
+ return (n);
+}
+
/* Identify mode callback. */
static void
server_client_callback_identify(__unused int fd, __unused short events,
-/* $OpenBSD: tmux.h,v 1.771 2017/05/29 18:06:34 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.772 2017/05/29 20:37:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
void server_add_accept(int);
/* server-client.c */
+u_int server_client_how_many(void);
void server_client_set_identify(struct client *);
void server_client_clear_identify(struct client *, struct window_pane *);
void server_client_set_key_table(struct client *, const char *);