URI:
       tgmap.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tgmap.c (673B)
       ---
            1 #include        <u.h>
            2 #include        <libc.h>
            3 #include        <bio.h>
            4 #include        <libg.h>
            5 #include        "hdr.h"
            6 #include        "../gb.h"
            7 
            8 /*
            9         map: put gb for runes from..to into chars
           10 */
           11 
           12 void
           13 gmap(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 = tabgb, ll = tabgb+GBMAX; l < ll; l++)
           21                 if((*l >= from) && (*l <= to))
           22                         chars[*l-from] = l-tabgb;
           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 }