Move queue initialization to queues.c

This commit is contained in:
Benedikt Heine 2017-10-06 14:53:04 +02:00
parent 7f335b79d2
commit 7110734b6e
3 changed files with 13 additions and 4 deletions

View File

@ -240,10 +240,7 @@ static void teardown(void)
int dunst_main(int argc, char *argv[]) int dunst_main(int argc, char *argv[])
{ {
/*TODO: move to queues.c */ queues_init();
history = g_queue_new();
displayed = g_queue_new();
queue = g_queue_new();
cmdline_load(argc, argv); cmdline_load(argc, argv);

View File

@ -14,6 +14,13 @@ GQueue *queue = NULL; /* all new notifications get into here */
GQueue *displayed = NULL; /* currently displayed notifications */ GQueue *displayed = NULL; /* currently displayed notifications */
GQueue *history = NULL; /* history of displayed notifications */ GQueue *history = NULL; /* history of displayed notifications */
void queues_init(void)
{
history = g_queue_new();
displayed = g_queue_new();
queue = g_queue_new();
}
bool notification_replace_by_id(notification *new) bool notification_replace_by_id(notification *new)
{ {

View File

@ -9,6 +9,11 @@ extern GQueue *queue;
extern GQueue *displayed; extern GQueue *displayed;
extern GQueue *history; extern GQueue *history;
/*
* Initialise neccessary queues
*/
void queues_init(void);
/* /*
* Replace the notification which matches the id field of * Replace the notification which matches the id field of
* the new notification. The given notification is inserted * the new notification. The given notification is inserted