diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-26 11:42:59 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-26 11:42:59 -0500 |
commit | f52e03ff473a504a9a12a98b68b9b923de664fe2 (patch) | |
tree | 0fced1a3bd65ce47d1766fac1f928d34c3e8f0d4 /wayland.c | |
parent | a5db589efaedebf2b01a61baa2efc917a7e45d68 (diff) |
Import Eric Anholts hash table implementation
Adapted from git://people.freedesktop.org/~anholt/hash_table.
Diffstat (limited to 'wayland.c')
-rw-r--r-- | wayland.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -50,7 +50,7 @@ struct wl_client { struct wl_display { struct wl_object base; struct wl_event_loop *loop; - struct wl_hash *objects; + struct wl_hash_table *objects; struct wl_list pending_frame_list; uint32_t client_id_range; @@ -109,7 +109,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data) if (len < size) break; - object = wl_hash_lookup(client->display->objects, p[0]); + object = wl_hash_table_lookup(client->display->objects, p[0]); if (object == NULL) { wl_client_post_event(client, &client->display->base, WL_DISPLAY_INVALID_OBJECT, p[0]); @@ -247,7 +247,7 @@ wl_client_add_surface(struct wl_client *client, surface->base.implementation = (void (**)(void)) implementation; surface->client = client; - wl_hash_insert(display->objects, &surface->base); + wl_hash_table_insert(display->objects, id, surface); wl_list_insert(client->surface_list.prev, &surface->link); return 0; @@ -259,7 +259,7 @@ wl_client_remove_surface(struct wl_client *client, { struct wl_display *display = client->display; - wl_hash_remove(display->objects, &surface->base); + wl_hash_table_remove(display->objects, surface->base.id); wl_list_remove(&surface->link); } @@ -305,7 +305,7 @@ wl_display_create(void) return NULL; } - display->objects = wl_hash_create(); + display->objects = wl_hash_table_create(); if (display->objects == NULL) { free(display); return NULL; @@ -333,7 +333,7 @@ WL_EXPORT void wl_display_add_object(struct wl_display *display, struct wl_object *object) { object->id = display->id++; - wl_hash_insert(display->objects, object); + wl_hash_table_insert(display->objects, object->id, object); } WL_EXPORT int |