mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Add a hash remove implementation
This commit is contained in:
		
							parent
							
								
									ecf65fe041
								
							
						
					
					
						commit
						f15ce9f400
					
				
					 2 changed files with 11 additions and 4 deletions
				
			
		| 
						 | 
					@ -88,11 +88,18 @@ wl_hash_lookup(struct wl_hash *hash, uint32_t id)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
wl_hash_delete(struct wl_hash *hash, struct wl_object *object)
 | 
					wl_hash_remove(struct wl_hash *hash, struct wl_object *object)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* writeme */
 | 
						int i;
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (i = 0; i < hash->count; i++) {
 | 
				
			||||||
 | 
							if (hash->objects[i]->id == object->id) {
 | 
				
			||||||
 | 
								hash->objects[i] = hash->objects[hash->count - 1];
 | 
				
			||||||
 | 
								hash->count--;
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WL_EXPORT void
 | 
					WL_EXPORT void
 | 
				
			||||||
wl_list_init(struct wl_list *list)
 | 
					wl_list_init(struct wl_list *list)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,7 +69,7 @@ struct wl_hash *wl_hash_create(void);
 | 
				
			||||||
void wl_hash_destroy(struct wl_hash *hash);
 | 
					void wl_hash_destroy(struct wl_hash *hash);
 | 
				
			||||||
int wl_hash_insert(struct wl_hash *hash, struct wl_object *object);
 | 
					int wl_hash_insert(struct wl_hash *hash, struct wl_object *object);
 | 
				
			||||||
struct wl_object *wl_hash_lookup(struct wl_hash *hash, uint32_t id);
 | 
					struct wl_object *wl_hash_lookup(struct wl_hash *hash, uint32_t id);
 | 
				
			||||||
void wl_hash_delete(struct wl_hash *hash, struct wl_object *object);
 | 
					void wl_hash_remove(struct wl_hash *hash, struct wl_object *object);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wl_list {
 | 
					struct wl_list {
 | 
				
			||||||
	struct wl_list *prev;
 | 
						struct wl_list *prev;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue