summaryrefslogtreecommitdiffstats
path: root/control-notify.c
diff options
context:
space:
mode:
authornicm <nicm>2015-04-24 23:17:11 +0000
committernicm <nicm>2015-04-24 23:17:11 +0000
commitaeedb464a6ee038289ddcfefae437928ab020cb1 (patch)
tree0428a0446bd50d08e4b0fe6741644e36d8b1a071 /control-notify.c
parent583b4ab72b7bf66fda8ab63a08fe435483de5e5a (diff)
Convert clients list into a TAILQ.
Diffstat (limited to 'control-notify.c')
-rw-r--r--control-notify.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/control-notify.c b/control-notify.c
index 747ef5b4..943d670c 100644
--- a/control-notify.c
+++ b/control-notify.c
@@ -64,11 +64,9 @@ control_notify_window_layout_changed(struct window *w)
struct session *s;
struct format_tree *ft;
struct winlink *wl;
- u_int i;
const char *template;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
s = c->session;
@@ -100,10 +98,8 @@ control_notify_window_unlinked(unused struct session *s, struct window *w)
{
struct client *c;
struct session *cs;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
cs = c->session;
@@ -120,10 +116,8 @@ control_notify_window_linked(unused struct session *s, struct window *w)
{
struct client *c;
struct session *cs;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
cs = c->session;
@@ -140,10 +134,8 @@ control_notify_window_renamed(struct window *w)
{
struct client *c;
struct session *cs;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL)
continue;
cs = c->session;
@@ -174,10 +166,8 @@ void
control_notify_session_renamed(struct session *s)
{
struct client *c;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;
@@ -189,10 +179,8 @@ void
control_notify_session_created(unused struct session *s)
{
struct client *c;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;
@@ -204,10 +192,8 @@ void
control_notify_session_close(unused struct session *s)
{
struct client *c;
- u_int i;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
+ TAILQ_FOREACH(c, &clients, entry) {
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;