Blob


1 #include <u.h>
2 #include <libc.h>
3 #include <bio.h>
4 #include <libg.h>
5 #include "hdr.h"
6 #include "../big5.h"
8 /*
9 map: put big5 for runes from..to into chars
10 */
12 void
13 bmap(int from, int to, long *chars)
14 {
15 long *l, *ll;
16 int k, k1, n;
18 for(n = from; n <= to; n++)
19 chars[n-from] = 0;
20 for(l = tabbig5, ll = tabbig5+BIG5MAX; l < ll; l++)
21 if((*l >= from) && (*l <= to))
22 chars[*l-from] = l-tabbig5;
23 k = 0;
24 k1 = 0; /* not necessary; just shuts ken up */
25 for(n = from; n <= to; n++)
26 if(chars[n-from] == 0){
27 k++;
28 k1 = n;
29 }
30 if(k){
31 fprint(2, "%s: %d/%d chars found (missing include 0x%x=%d)\n", argv0, (to-from+1-k), to-from+1, k1, k1);
32 /*exits("map problem");/**/
33 }
34 }