kmap.c 706 B

12345678910111213141516171819202122232425262728293031323334
  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. map: put kuten for runes from..to into chars
  9. */
  10. void
  11. kmap(int from, int to, long *chars)
  12. {
  13. long *l, *ll;
  14. int k, k1, n;
  15. for(n = from; n <= to; n++)
  16. chars[n-from] = 0;
  17. for(l = tabkuten208, ll = tabkuten208+KUTEN208MAX; l < ll; l++)
  18. if((*l >= from) && (*l <= to))
  19. chars[*l-from] = l-tabkuten208;
  20. k = 0;
  21. k1 = 0; /* not necessary; just shuts ken up */
  22. for(n = from; n <= to; n++)
  23. if(chars[n-from] == 0){
  24. k++;
  25. k1 = n;
  26. }
  27. if(k){
  28. fprint(2, "%s: %d/%d chars found (missing include 0x%x=%d)\n", argv0, (to-from+1-k), to-from+1, k1, k1);
  29. /*exits("map problem");/**/
  30. }
  31. }