if (! entry1->cluster)  return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1); else if (! entry2->cluster)  return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1); else  return hol_cluster_cmp (entry1->cluster, entry2->cluster);
{  if (! entry1->cluster)  return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1); else if (! entry2->cluster)  return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1); else  return hol_cluster_cmp (entry1->cluster, entry2->cluster); }
hol_entry_cmp (const struct hol_entry *entry1,	       const struct hol_entry *entry2){  /* The group numbers by which the entries should be ordered; if either is     in a cluster, then this is just the group within the cluster.  */  int group1 = entry1->group, group2 = entry2->group;  if (entry1->cluster != entry2->cluster)    /* The entries are not within the same cluster, so we can't compare them       directly, we have to use the appropiate clustering level too.  */    if (! entry1->cluster)      /* ENTRY1 is at the `base level', not in a cluster, so we have to	 compare it's group number with that of the base cluster in which	 ENTRY2 resides.  Note that if they're in the same group, the	 clustered option always comes laster.  */      return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1);    else if (! entry2->cluster)      /* Likewise, but ENTRY2's not in a cluster.  */      return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1);    else      /* Both entries are in clusters, we can just compare the clusters.  */      return hol_cluster_cmp (entry1->cluster, entry2->cluster);  else if (group1 == group2)    /* The entries are both in the same cluster and group, so compare them       alphabetically.  */    {      int short1 = hol_entry_first_short (entry1);      int short2 = hol_entry_first_short (entry2);      int doc1 = odoc (entry1->opt);      int doc2 = odoc (entry2->opt);      const char *long1 = hol_entry_first_long (entry1);      const char *long2 = hol_entry_first_long (entry2);      if (doc1)	doc1 = canon_doc_option (&long1);      if (doc2)	doc2 = canon_doc_option (&long2);      if (doc1 != doc2)	/* `documentation' options always follow normal options (or	   documentation options that *look* like normal options).  */	return doc1 - doc2;      else if (!short1 && !short2 && long1 && long2)	/* Only long options.  */	return __strcasecmp (long1, long2);      else	/* Compare short/short, long/short, short/long, using the first	   character of long options.  Entries without *any* valid	   options (such as options with OPTION_HIDDEN set) will be put	   first, but as they're not displayed, it doesn't matter where	   they are.  */	{	  char first1 = short1 ? short1 : long1 ? *long1 : 0;	  char first2 = short2 ? short2 : long2 ? *long2 : 0;	  int lower_cmp = tolower (first1) - tolower (first2);	  /* Compare ignoring case, except when the options are both the	     same letter, in which case lower-case always comes first.  */	  return lower_cmp ? lower_cmp : first2 - first1;	}    }  else    /* Within the same cluster, but not the same group, so just compare       groups.  */    return group_cmp (group1, group2, 0);}