Hash tables



Hello,

I use structures of this type:

  struct {
      const char *key;
      union {....} value;
      int          value_type;
  }

Comparing the keyword with a certain string I determine, which value
is used (read from a file, should be printed, ...) and value_type
tells me, which data type from the union has to be choosen.

This seems me to be a case for the g_hash_...() functions instead of
every time 
  for ( all possible keys )
     strcmp( key, string )

to determine the value.  Unfortunately I can't find any documentation
about the hash functions.

Do I suspect right if I could enhance my code with hash tables?
Could someone point me to a description or simple example for this
functions?

Kind regards

         Andreas.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]