summaryrefslogtreecommitdiffstats
path: root/src/cmd/tcs/font/bmap.c
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-04-21 01:15:41 +0000
committerwkj <devnull@localhost>2004-04-21 01:15:41 +0000
commita31db67d14c0e50353eac3db342f3c969cabdf76 (patch)
tree0cebd9a65bab940355f5be0751f53238366555d7 /src/cmd/tcs/font/bmap.c
parentba03b8910dd07511378e6f1007faf0539ed25598 (diff)
downloadplan9port-a31db67d14c0e50353eac3db342f3c969cabdf76.tar.gz
plan9port-a31db67d14c0e50353eac3db342f3c969cabdf76.zip
Add tcs; it compiles in my world, but I haven't tried it in Russ's yet.
Diffstat (limited to 'src/cmd/tcs/font/bmap.c')
-rw-r--r--src/cmd/tcs/font/bmap.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/cmd/tcs/font/bmap.c b/src/cmd/tcs/font/bmap.c
new file mode 100644
index 00000000..7861d658
--- /dev/null
+++ b/src/cmd/tcs/font/bmap.c
@@ -0,0 +1,34 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <libg.h>
+#include "hdr.h"
+#include "../big5.h"
+
+/*
+ map: put big5 for runes from..to into chars
+*/
+
+void
+bmap(int from, int to, long *chars)
+{
+ long *l, *ll;
+ int k, k1, n;
+
+ for(n = from; n <= to; n++)
+ chars[n-from] = 0;
+ for(l = tabbig5, ll = tabbig5+BIG5MAX; l < ll; l++)
+ if((*l >= from) && (*l <= to))
+ chars[*l-from] = l-tabbig5;
+ k = 0;
+ k1 = 0; /* not necessary; just shuts ken up */
+ for(n = from; n <= to; n++)
+ if(chars[n-from] == 0){
+ k++;
+ k1 = n;
+ }
+ if(k){
+ fprint(2, "%s: %d/%d chars found (missing include 0x%x=%d)\n", argv0, (to-from+1-k), to-from+1, k1, k1);
+ /*exits("map problem");/**/
+ }
+}