From c2c6ca25d5d14f7c9c280ad3b74577ff6b1569fa Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 18 Oct 2011 22:11:27 +0100 Subject: [PATCH] Make the barconfig list a TAILQ --- include/config.h | 4 ++-- src/config.c | 2 +- src/ipc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/config.h b/include/config.h index 200d393f..a4a274cf 100644 --- a/include/config.h +++ b/include/config.h @@ -26,7 +26,7 @@ typedef struct Barconfig Barconfig; extern char *current_configpath; extern Config config; extern SLIST_HEAD(modes_head, Mode) modes; -extern SLIST_HEAD(barconfig_head, Barconfig) barconfigs; +extern TAILQ_HEAD(barconfig_head, Barconfig) barconfigs; /** * Used during the config file lexing/parsing to keep the state of the lexer @@ -235,7 +235,7 @@ struct Barconfig { char *urgent_workspace_bg; } colors; - SLIST_ENTRY(Barconfig) configs; + TAILQ_ENTRY(Barconfig) configs; }; /** diff --git a/src/config.c b/src/config.c index 3ea18258..d39a5761 100644 --- a/src/config.c +++ b/src/config.c @@ -21,7 +21,7 @@ char *current_configpath = NULL; Config config; struct modes_head modes; -struct barconfig_head barconfigs; +struct barconfig_head barconfigs = TAILQ_HEAD_INITIALIZER(barconfigs); /** * Ungrabs all keys, to be called before re-grabbing the keys because of a diff --git a/src/ipc.c b/src/ipc.c index 60f55966..1ae6bb0a 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -487,7 +487,7 @@ IPC_HANDLER(get_bar_config) { strncpy(bar_id, (const char*)message, message_size); LOG("IPC: looking for config for bar ID \"%s\"\n", bar_id); Barconfig *current, *config = NULL; - SLIST_FOREACH(current, &barconfigs, configs) { + TAILQ_FOREACH(current, &barconfigs, configs) { if (strcmp(current->id, bar_id) != 0) continue; -- 2.39.5