-/* Hash a value label. */
-unsigned
-hash_int_val_lab (const void *vl_, void *vls_)
-{
- const struct int_val_lab *vl = vl_;
- const struct val_labs *vls = vls_;
-
- if (vls->width == 0)
- return hsh_hash_double (vl->value.f);
- else
- return hsh_hash_bytes (vl->value.s, sizeof vl->value.s);
-}
-
-/* Free a value label. */
-void
-free_int_val_lab (void *vl_, void *vls_ UNUSED)
-{
- struct int_val_lab *vl = vl_;
-
- atom_destroy (vl->label);
- free (vl);
-}
-\f
-/* Atoms. */
-
-/* An atom. */
-struct atom
- {
- char *string; /* String value. */
- unsigned ref_count; /* Number of references. */
- };
-
-static hsh_compare_func compare_atoms;
-static hsh_hash_func hash_atom;
-static hsh_free_func free_atom;
-
-/* Hash table of atoms. */
-static struct hsh_table *atoms;
-
-/* Creates and returns an atom for STRING. */
-static struct atom *
-atom_create (const char *string)
-{
- struct atom a;
- void **app;
-
- assert (string != NULL);
-
- if (atoms == NULL)
- atoms = hsh_create (8, compare_atoms, hash_atom, free_atom, NULL);
-
- a.string = (char *) string;
- app = hsh_probe (atoms, &a);
- if (*app != NULL)
- {
- struct atom *ap = *app;
- ap->ref_count++;
- return ap;
- }
- else
- {
- struct atom *ap = xmalloc (sizeof *ap);
- ap->string = xstrdup (string);
- ap->ref_count = 1;
- *app = ap;
- return ap;
- }
-}
-
-/* Destroys ATOM. */
-static void
-atom_destroy (struct atom *atom)
-{
- if (atom != NULL)
- {
- assert (atom->ref_count > 0);
- atom->ref_count--;
- if (atom->ref_count == 0)
- hsh_force_delete (atoms, atom);
- }
-}
-
-/* Returns the string associated with ATOM. */
-static char *
-atom_to_string (const struct atom *atom)