free_abbrev_list (abbrev_list *list)
{
  abbrev_entry *abbrv = list->first_abbrev;

  while (abbrv)
    {
      abbrev_attr *attr = abbrv->first_attr;

      while (attr)
	{
	  abbrev_attr *next_attr = attr->next;
	  free (attr);
	  attr = next_attr;
	}

      abbrev_entry *next_abbrev = abbrv->next;
      free (abbrv);
      abbrv = next_abbrev;
    }

  abbrev_list *next = list->next;
  free (list);
  return next;
}
free_abbrev_list (abbrev_list *list)
{
  abbrev_entry *abbrv = list->first_abbrev;

  while (abbrv)
    {
      abbrev_attr *attr = abbrv->first_attr;

      while (attr)
	{
	  abbrev_attr *next_attr = attr->next;
	  free (attr);
	  attr = next_attr;
	}

      abbrev_entry *next_abbrev = abbrv->next;
      free (abbrv);
      abbrv = next_abbrev;
    }

  abbrev_list *next = list->next;
  free (list);
  return next;
}