From 37da2899f40661e3e9631e497da8dc59b971cbd0 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 17:07:39 +0000 Subject: 20060303a --- libdraw/computil.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libdraw/computil.c (limited to 'libdraw/computil.c') diff --git a/libdraw/computil.c b/libdraw/computil.c new file mode 100644 index 00000000..3ec103b8 --- /dev/null +++ b/libdraw/computil.c @@ -0,0 +1,37 @@ +#include "lib9.h" +#include "draw.h" + +/* + * compressed data are seuences of byte codes. + * if the first byte b has the 0x80 bit set, the next (b^0x80)+1 bytes + * are data. otherwise, it's two bytes specifying a previous string to repeat. + */ +void +_twiddlecompressed(uchar *buf, int n) +{ + uchar *ebuf; + int j, k, c; + + ebuf = buf+n; + while(buf < ebuf){ + c = *buf++; + if(c >= 128){ + k = c-128+1; + for(j=0; j