home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
comm
/
misc
/
elcheapofax
/
rcs
/
codes.c,v
< prev
next >
Wrap
Text File
|
1993-12-21
|
1KB
|
75 lines
head 1.2;
access;
symbols
OCT93:1.2;
locks;
comment @ * @;
1.2
date 93.06.11.16.33.37; author Rhialto; state Exp;
branches;
next 1.1;
1.1
date 93.06.11.14.53.53; author Rhialto; state Exp;
branches;
next ;
desc
@Test program to print g3 run length codes
@
1.2
log
@First real RCS checkin
@
text
@/* $Id$
* $Log$
*/
#include <stdio.h>
#include "gdevdfg3.h"
void
dumptable(struct tableentry *t, int size, char *descr)
{
printf("%s:\n", descr);
while (size > 0) {
unsigned int m;
m = 1 << (t->length - 1);
while (m) {
putchar((t->code & m)? '1' : '0');
m >>= 1;
}
printf("%*d %s\n", 20 - t->length, t->count, descr);
t++;
size--;
}
}
int
main(int argc, char **argv)
{
#define SZ(table) (sizeof(table)/sizeof(table[0]))
dumptable(twtable, SZ(twtable), "white run length");
dumptable(mwtable, SZ(mwtable), "white run length");
dumptable(tbtable, SZ(tbtable), "black run length");
dumptable(mbtable, SZ(mbtable), "black run length");
dumptable(extable, SZ(extable), "extended");
}
@
1.1
log
@Initial revision
@
text
@d1 3
@