18 static int ordermapmax = 0;
19 static int ordermapindex = 0;
23 OrderFor(ident, order)
28 ordermapmax = (nidents > TWENTY ? nidents : TWENTY) * 2;
29 /* Assume nidents read is indication of the No of
30 idents in the .aux file (*2 for good luck !) */
31 ordermap = xmalloc(ordermapmax * sizeof(struct order));
34 if (ordermapindex < ordermapmax) {
35 ordermap[ ordermapindex ].ident = copystring(ident);
36 ordermap[ ordermapindex ].order = order;
39 Disaster("order map overflow");
44 * Get the order of to be used for "ident" if there is one.
45 * Otherwise, return 0 which is the minimum ordering value.
54 for (i = 0; i < ordermapindex; i++) {
55 if (strcmp(ordermap[i].ident, ident) == 0) { /* got it */
56 return(ordermap[i].order);
64 * Reorder on the basis of information from ".aux" file.
76 for (i = 0; i < nidents-1; i++) {
78 for (j = i+1; j < nidents; j++) {
79 o1 = OrderOf(identtable[ j ]->name);
80 o2 = OrderOf(identtable[ min ]->name);
82 if (o1 < o2 ) min = j;
85 e = identtable[ min ];
86 identtable[ min ] = identtable[ i ];