shash_get, _shash_get, shash_get_ptr, _shash_get_ptr, shash_exists - look up in a shash |
#include <hash.h> #define shash_get(shash,key,value) _shash_get((shash),(key),&(value)) int _shash_get (shash, const char *key, void *value); #define shash_get_ptr(h,key,ptr) _shash_get_ptr ((h),(key),&(ptr)) int _shash_get_ptr (shash, const char *key, void **ptr); #define shash_exists(shash,key) _shash_get_ptr ((shash), (key), 0) |
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 shash, this pointer may become invalid. |
shash_exists simply tests whether or not key exists in the shash. If so, it returns true, otherwise false. |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
c2lib-1.2.13 |