6 * The code makes two assumptions: strlen(ld) is 1 or 2; latintab[i].ld can be a
7 * prefix of latintab[j].ld only when j<i.
11 char *ld; /* must be seen before using this conversion */
12 char *si; /* options for last input characters */
13 Rune so[60]; /* the corresponding Rune for each si entry */
20 * Given 5 characters k[0]..k[4], find the rune or return -1 for failure.
29 for(i=0; i<4; i++,k++){
31 if('0'<=*k && *k<='9')
33 else if('a'<=*k && *k<='f')
35 else if('A'<=*k && *k<='F')
44 * Given n characters k[0]..k[n-1], find the corresponding rune or return -1 for
45 * failure, or something < -1 if n is too small. In the latter case, the result
46 * is minus the required n.
49 _latin1(Rune *k, int n)
62 for(l=latintab; l->ld!=0; l++)
68 else if(l->ld[1] != k[1])
74 for(p=l->si; *p!=0; p++)
76 return l->so[p - l->si];