home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / comm / misc / elcheapofax / rcs / codes.c,v < prev    next >
Text File  |  1993-12-21  |  1KB  |  75 lines

  1. head    1.2;
  2. access;
  3. symbols
  4.     OCT93:1.2;
  5. locks;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.2
  10. date    93.06.11.16.33.37;    author Rhialto;    state Exp;
  11. branches;
  12. next    1.1;
  13.  
  14. 1.1
  15. date    93.06.11.14.53.53;    author Rhialto;    state Exp;
  16. branches;
  17. next    ;
  18.  
  19.  
  20. desc
  21. @Test program to print g3 run length codes
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @First real RCS checkin
  28. @
  29. text
  30. @/* $Id$
  31.  * $Log$
  32.  */
  33. #include <stdio.h>
  34. #include "gdevdfg3.h"
  35.  
  36. void
  37. dumptable(struct tableentry *t, int size, char *descr)
  38. {
  39.     printf("%s:\n", descr);
  40.     while (size > 0) {
  41.     unsigned int m;
  42.  
  43.     m = 1 << (t->length - 1);
  44.     while (m) {
  45.         putchar((t->code & m)? '1' : '0');
  46.         m >>= 1;
  47.     }
  48.     printf("%*d %s\n", 20 - t->length, t->count, descr);
  49.     t++;
  50.     size--;
  51.     }
  52. }
  53.  
  54. int
  55. main(int argc, char **argv)
  56. {
  57. #define SZ(table)   (sizeof(table)/sizeof(table[0]))
  58.     dumptable(twtable, SZ(twtable), "white run length");
  59.     dumptable(mwtable, SZ(mwtable), "white run length");
  60.     dumptable(tbtable, SZ(tbtable), "black run length");
  61.     dumptable(mbtable, SZ(mbtable), "black run length");
  62.     dumptable(extable, SZ(extable), "extended");
  63. }
  64.  
  65. @
  66.  
  67.  
  68. 1.1
  69. log
  70. @Initial revision
  71. @
  72. text
  73. @d1 3
  74. @
  75.