home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Workbench / Archivers / PPCxDMS.lha / PPCxDMS / source.lha / src / getbits.c < prev    next >
C/C++ Source or Header  |  1998-02-28  |  632b  |  34 lines

  1.  
  2. /*
  3.  *     xDMS  v1.1  -  Portable DMS archive unpacker  -  Public Domain
  4.  *     Written by     Andre R. de la Rocha  <adlroc@usa.net>
  5.  *     Functions/macros to get a variable number of bits
  6.  * 
  7.  */
  8.  
  9. #include "cdata.h"
  10. #include "getbits.h"
  11.  
  12.  
  13. ULONG mask_bits[]={
  14.     0x000000,0x000001,0x000003,0x000007,0x00000f,0x00001f,
  15.     0x00003f,0x00007f,0x0000ff,0x0001ff,0x0003ff,0x0007ff,
  16.     0x000fff,0x001fff,0x003fff,0x007fff,0x00ffff,0x01ffff,
  17.     0x03ffff,0x07ffff,0x0fffff,0x1fffff,0x3fffff,0x7fffff,
  18.     0xffffff};
  19.  
  20.  
  21. UCHAR *indata, bitcount;
  22. ULONG bitbuf;
  23.  
  24.  
  25.  
  26. void initbitbuf(UCHAR *in){
  27.     bitbuf = 0;
  28.     bitcount = 0;
  29.     indata = in;
  30.     DROPBITS(0);
  31. }    
  32.  
  33.  
  34.