Function hashmap_add

Function Documentation

status_t hashmap_add(struct hashmap *map, const void *key, const void *data)

Add a node to the hashmap.

This function takes the key and data for the new node, calculates the hash for it, and then adds it to the correct bucket. If the bucket is currently full, it returns failure, unless RCSW_DS_HASHMAP_LINPROB was passed during initialization. If the node already exists in the bucket, failure is returned (no duplicates are allowed).

Parameters:
  • map – The hashmap handle.

  • key – The key to add.

  • data – The data to add.

Returns:

status_t