Off-topic for c.l.c, followup-to set.
Sergei Koveshnikov <> writes:
> Hello,
>
> I am trying to use hash management (from <search.h>).
> I can add and search however I can't update entries in the hash table...
> In the manual I found following note:
> ============
> man (3) HSEARCH
> SVID and POSIX 1003.1-2001 specify that action is significant only for
> unsuccessful searches, so that an ENTER should not do anything for a
> successful search. The libc and glibc implementations update the data
> for the given key in this case.
> Individual hash table entries can be added, but not deleted
> ============
>
> Could you look at my example in the attached file `hash.c'
> and give me some hints?
The standard hash table API is horribly broken, and not even portable
among different Unixes (opposite return values from hsearch_r() in
glibc vs. Tru64). You might want to take a look at the hash tables in
my libtc library (
http://libtc.sf.net/).
--
Måns Rullgård