summaryrefslogtreecommitdiff
path: root/wayland-util.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-12-12 11:05:17 -0500
committerKristian Høgsberg <krh@hinata.localdomain>2008-12-12 12:17:47 -0500
commit864c468b4232c9529fc90cf76f5686657bab9c27 (patch)
tree67e22d387b10da88f2285aec4a41151c6ee9a80b /wayland-util.c
parent997e71eb1e6322fb91b0c8be2fe7e29c68b8b4df (diff)
Make sure we initialize object hash.
This patch also move the hash implementation details to wayland-util.c.
Diffstat (limited to 'wayland-util.c')
-rw-r--r--wayland-util.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/wayland-util.c b/wayland-util.c
index 6bdbf31..1a154ac 100644
--- a/wayland-util.c
+++ b/wayland-util.c
@@ -21,8 +21,34 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "wayland.h"
+struct wl_hash {
+ struct wl_object **objects;
+ uint32_t count, alloc;
+};
+
+struct wl_hash *
+wl_hash_create(void)
+{
+ struct wl_hash *hash;
+
+ hash = malloc(sizeof *hash);
+ if (hash == NULL)
+ return hash;
+
+ memset(hash, 0, sizeof *hash);
+
+ return hash;
+}
+
+void
+wl_hash_destroy(struct wl_hash *hash)
+{
+ free(hash);
+}
+
int wl_hash_insert(struct wl_hash *hash, struct wl_object *object)
{
struct wl_object **objects;