P
Pieter Claassen
Is there any reasonable standard hash table storage in C on Linux?
AFAICT the one in glibc has a data struct where the key and value pairs
both have to be null terminated pointers. In my case, that is fine for the
key, but I need to store a complex struct as the value and short of doing
dangerous things like printing the memory location of the value struct and
then recasting it when I want to get to the struct (which I think is
dangerous), I don't want to use non-standard libraries.
Also, what is a good way to generate a hash from a very large 96bit
identifier? the linux/hash.h only does longs which is a 32 bit number on
my machine.
Any help appreciated.
Thanks,
Pieter
AFAICT the one in glibc has a data struct where the key and value pairs
both have to be null terminated pointers. In my case, that is fine for the
key, but I need to store a complex struct as the value and short of doing
dangerous things like printing the memory location of the value struct and
then recasting it when I want to get to the struct (which I think is
dangerous), I don't want to use non-standard libraries.
Also, what is a good way to generate a hash from a very large 96bit
identifier? the linux/hash.h only does longs which is a 32 bit number on
my machine.
Any help appreciated.
Thanks,
Pieter