8000 GitHub - emiflake/ash-map: A HashMap implementation
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

emiflake/ash-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AshMap travis badge lang

A C89 HashMap implementation

Usage

AshMap hopes to provide a simple and useable interface for using hashmaps

void	print_node(size_t bucket_n, size_t node_n, t_bucket_node *node)
{
	printf("[%zu, %zu]: \"%s\" => \"%s\", \n", bucket_n, node_n, node->key, node->value);
}

int main(void) {
	t_hashmap	*map;

	map = ash_hashmap_new(ash_hash);

	ash_hashmap_insert(map, "foo", "bar"));
	ash_hashmap_insert(map, "bar", "foo"));

	if (ash_hashmap_get(map, "foo"))
		printf("Silly foo!\n");

	ash_hashmap_foreach_enum(map, print_node);
	ash_hashmap_clean(map, my_cleaner);
}

About

A HashMap implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0