[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Adding a real HashTable implementation to gnulib
From: |
Ben Pfaff |
Subject: |
Re: [RFC] Adding a real HashTable implementation to gnulib |
Date: |
Mon, 26 Nov 2018 15:22:55 -0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Nov 27, 2018 at 12:16:16AM +0100, Darshit Shah wrote:
> I recently tried to use the hash table implementation in gnulib which resides
> in the "hash" module. However, I quickly realised that the hash table in
> gnulib
> seems to be what is otherwise popularly known as a hash set, i.e., it supports
> storing and retrieving just values from the structure.
>
> On the other hand, a hash table is usually expected to have a key->value
> mapping that is stored.
>
> Within GNU Wget, we have a fairly portable version of a hash table implemented
> which I think would be a good addition for gnulib. What do you think?
>
> If I get a positive response here, I could extract that code and turn it into
> a
> hash table module for gnulib. We should be able to reuse some part of the
> existing code in "hash.c" for this purpose as well
Can you point to the Wget hash table?
I'm pretty fond of the hash table implementation we have in PSPP:
http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/hmap.h
http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/hmap.c