plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

kmap.c (706B)


      1 #include	<u.h>
      2 #include	<libc.h>
      3 #include	<bio.h>
      4 #include	<libg.h>
      5 #include	"hdr.h"
      6 #include	"../kuten208.h"
      7 
      8 /*
      9 	map: put kuten for runes from..to into chars
     10 */
     11 
     12 void
     13 kmap(int from, int to, long *chars)
     14 {
     15 	long *l, *ll;
     16 	int k, k1, n;
     17 
     18 	for(n = from; n <= to; n++)
     19 		chars[n-from] = 0;
     20 	for(l = tabkuten208, ll = tabkuten208+KUTEN208MAX; l < ll; l++)
     21 		if((*l >= from) && (*l <= to))
     22 			chars[*l-from] = l-tabkuten208;
     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 }