Initialise and free capabilities

This commit is contained in:
James Booth
2013-01-20 00:35:40 +00:00
parent 7920a9b2f1
commit 22589e8798
3 changed files with 22 additions and 0 deletions

View File

@@ -23,9 +23,20 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "common.h"
#include "capabilities.h"
GHashTable *capabilities;
void
caps_init(void)
{
capabilities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
(GDestroyNotify)caps_destroy);
}
Capabilities *
caps_create(const char * const client, const char * const version)
{
@@ -55,3 +66,9 @@ caps_destroy(Capabilities *caps)
FREE_SET_NULL(caps);
}
}
void
caps_close(void)
{
g_hash_table_destroy(capabilities);
}