+/* Guidelines for creating custom hash and test functions:
+
+ - The test function returns non-zero for keys that are considered
+ "equal", zero otherwise.
+
+ - The hash function returns a number that represents the
+ "distinctness" of the object. In more precise terms, it means
+ that for any two objects that test "equal" under the test
+ function, the hash function MUST produce the same result.
+
+ This does not mean that all different objects must produce
+ different values (that would be "perfect" hashing), only that
+ non-distinct objects must produce the same values! For instance,
+ a hash function that returns 0 for any given object is a
+ perfectly valid (albeit extremely bad) hash function. A hash
+ function that hashes a string by adding up all its characters is
+ another example of a valid (but still quite bad) hash function.
+
+ It is not hard to make hash and test functions agree about
+ equality. For example, if the test function compares strings
+ case-insensitively, the hash function can lower-case the
+ characters when calculating the hash value. That ensures that
+ two strings differing only in case will hash the same.
+
+ - To prevent performance degradation, choose a hash function with
+ as good "spreading" as possible. A good hash function will use
+ all the bits of the input when calculating the hash, and will
+ react to even small changes in input with a completely different
+ output. But don't make the hash function itself overly slow,
+ because you'll be incurring a non-negligible overhead to all hash
+ table operations. */
+
+/*
+ * Support for hash tables whose keys are strings.
+ *
+ */
+
+/* Base 31 hash function. Taken from Gnome's glib, modified to use
+ standard C types.
+
+ We used to use the popular hash function from the Dragon Book, but
+ this one seems to perform much better, both by being faster and by
+ generating less collisions. */
+
+static unsigned long
+hash_string (const void *key)