version 1.18, 2011/09/22 10:41:04 |
version 1.19, 2015/01/16 06:40:06 |
|
|
* Any file produced by compress(1) can be read. |
* Any file produced by compress(1) can be read. |
*/ |
*/ |
|
|
#include <sys/param.h> |
|
#include <sys/stat.h> |
#include <sys/stat.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
|
|
#include <fcntl.h> |
#include <fcntl.h> |
#include "compress.h" |
#include "compress.h" |
|
|
|
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
|
|
#define BITS 16 /* Default bits. */ |
#define BITS 16 /* Default bits. */ |
#define HSIZE 69001 /* 95% occupancy */ |
#define HSIZE 69001 /* 95% occupancy */ |
#define ZBUFSIZ 8192 /* I/O buffer size */ |
#define ZBUFSIZ 8192 /* I/O buffer size */ |
|
|
zs->zs_ebp = bp + bits; |
zs->zs_ebp = bp + bits; |
} |
} |
zs->zs_offset = 0; |
zs->zs_offset = 0; |
zs->zs_size = MIN(zs->zs_n_bits, zs->zs_ebp - zs->zs_bp); |
zs->zs_size = MINIMUM(zs->zs_n_bits, zs->zs_ebp - zs->zs_bp); |
if (zs->zs_size == 0) |
if (zs->zs_size == 0) |
return -1; |
return -1; |
/* Round size down to integral number of codes. */ |
/* Round size down to integral number of codes. */ |