diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-06-15 08:31:41 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-06-15 08:31:41 +0000 |
commit | 218f6e2cd9279e079ee3c19e90109d6f20cf343d (patch) | |
tree | c53de827c92cae1f0946892298a2723286d2bec2 /src | |
parent | 967932e75d1ab512d4c5c3cb9443d90d68ec39a5 (diff) |
Added coucal_fetch_value()
Diffstat (limited to 'src')
-rw-r--r-- | src/coucal.c | 3 | ||||
-rw-r--r-- | src/coucal.h | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/coucal.c b/src/coucal.c index e925c75..38273ce 100644 --- a/src/coucal.c +++ b/src/coucal.c @@ -1156,8 +1156,7 @@ coucal_value* coucal_fetch_value_hashes(coucal hashtable, return NULL; } -static coucal_value* coucal_fetch_value(coucal hashtable, - coucal_key_const name) { +coucal_value* coucal_fetch_value(coucal hashtable, coucal_key_const name) { const coucal_hashkeys hashes = coucal_calc_hashes(hashtable, name); return coucal_fetch_value_hashes(hashtable, name, &hashes); } diff --git a/src/coucal.h b/src/coucal.h index 2012db5..92f4541 100644 --- a/src/coucal.h +++ b/src/coucal.h @@ -423,6 +423,15 @@ COUCAL_EXTERN int coucal_inc(coucal hashtable, coucal_key_const name); COUCAL_EXTERN int coucal_dec(coucal hashtable, coucal_key_const name); /** + * Fetch an entry value from the hashtable. + * Returns NULL if the entry could not be found. + * The returned pointer is only valid until next call to this library, and can + * be used for read or write operations. + **/ +COUCAL_EXTERN coucal_value* coucal_fetch_value(coucal hashtable, + coucal_key_const name); + +/** * Fetch an entry value from the hashtable, given a name, and its hashes. * Returns NULL if the entry could not be found. * The returned pointer is only valid until next call to this library, and can |