hash_get(3)

NAME
hash_get, _hash_get, hash_get_ptr, _hash_get_ptr, hash_exists - look up in a hash

SYNOPSIS
#include <hash.h>

#define hash_get(h,key,value) _hash_get ((h), &(key), &(value))
int _hash_get (hash, const void *key, void *value);
#define hash_get_ptr(h,key,ptr) _hash_get_ptr ((h), &(key), &(ptr))
int _hash_get_ptr (hash, const void *key, void **ptr);
#define hash_exists(h,key) _hash_get_ptr ((h), &(key), 0)

DESCRIPTION

Get the value associated with key key and return true. If there is no value associated with key, this returns false and value is left unchanged.

The *_ptr variants return a pointer rather than copying out the entire value object. The pointer is typically only valid for a short period of time. Particularly if you insert or remove elements from the hash, this pointer may become invalid.

hash_exists simply tests whether or not key exists in the hash. If so, it returns true, otherwise false.

AUTHOR
Richard Jones <rich@annexia.org>

LICENSE
GNU LGPL (see http://www.gnu.org/)

VERSION
c2lib-1.2.14