4 * The code makes two assumptions: strlen(ld) is 1 or 2; latintab[i].ld can be a
5 * prefix of latintab[j].ld only when j<i.
9 char *ld; /* must be seen before using this conversion */
10 char *si; /* options for last input characters */
11 Rune *so; /* the corresponding Rune for each si entry */
18 * Given 5 characters k[0]..k[4], find the rune or return -1 for failure.
27 for(i=0; i<4; i++,k++){
29 if('0'<=*k && *k<='9')
31 else if('a'<=*k && *k<='f')
33 else if('A'<=*k && *k<='F')
42 * Given n characters k[0]..k[n-1], find the corresponding rune or return -1 for
43 * failure, or something < -1 if n is too small. In the latter case, the result
44 * is minus the required n.
47 latin1(Rune *k, int n)
58 for(l=latintab; l->ld!=0; l++)
64 else if(l->ld[1] != k[1])
70 for(p=l->si; *p!=0; p++)
72 return l->so[p - l->si];