#include <limits.h>#include <dirent.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <ctype.h>#include <signal.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <utime.h>#include <stdio.h>Include dependency graph for compress.c:

Go to the source code of this file.
Defines | |
| #define | AZTEC86 1 |
| #define | min(a, b) ((a>b) ? b : a) |
| #define | SACREDMEM 0 |
| #define | USERMEM 450000 |
| #define | REGISTER register |
| #define | DOTZ ".Z" |
| #define | DEFAULTBITS 13 |
| #define | BITS 16 |
| #define | PBITS 16 |
| #define | HSIZE 69001 |
| #define | BIT_MASK 0x1f |
| #define | BLOCK_MASK 0x80 |
| #define | INIT_BITS 9 |
| #define | ARGVAL() (*++(*argv) || (--argc && *++argv)) |
| #define | MAXCODE(n_bits) ((1 << (n_bits)) - 1) |
| #define | HTABSIZE ((size_t)(HSIZE*sizeof(count_int))) |
| #define | CODETABSIZE ((size_t)(HSIZE*sizeof(unsigned short))) |
| #define | htabof(i) htab[i] |
| #define | codetabof(i) codetab[i] |
| #define | tab_prefixof(i) codetabof(i) |
| #define | tab_suffixof(i) ((char_type *)(htab))[i] |
| #define | de_stack ((char_type *)&tab_suffixof(1<<BITS)) |
| #define | CHECK_GAP 10000 |
| #define | FIRST 257 |
| #define | CLEAR 256 |
Typedefs | |
| typedef long int | code_int |
| typedef long int | count_int |
| typedef unsigned char | char_type |
Functions | |
| _PROTOTYPE (int main,(int argc, char **argv)) | |
| _PROTOTYPE (void Usage,(void)) | |
| _PROTOTYPE (void onintr,(int dummy)) | |
| _PROTOTYPE (void output,(code_int code)) | |
| _PROTOTYPE (int foreground,(void)) | |
| _PROTOTYPE (code_int getcode,(void)) | |
| _PROTOTYPE (void copystat,(char *ifname, char *ofname)) | |
| _PROTOTYPE (void cl_hash,(count_int hsize)) | |
| _PROTOTYPE (void prratio,(FILE *stream, long int num, long int den)) | |
| void | Usage () |
| int | main (int argc, char **argv) |
| void | compress () |
| void | output (code_int code) |
| void | decompress () |
| code_int | getcode () |
| void | writeerr () |
| void | copystat (char *ifname, char *ofname) |
| int | foreground () |
| void | onintr (int dummy) |
| void | oops (int dummy) |
| void | cl_block () |
| void | cl_hash (REGISTER count_int hsize) |
| void | prratio (FILE *stream, long int num, long int den) |
| void | version () |
Variables | |
| char_type | magic_header [] = "\037\235" |
| int | n_bits |
| int | maxbits = DEFAULTBITS |
| code_int | maxcode |
| code_int | maxmaxcode = 1 << BITS |
| count_int * | htab |
| unsigned short * | codetab |
| code_int | hsize = HSIZE |
| count_int | fsize |
| code_int | free_ent = 0 |
| int | exit_stat = 0 |
| int | nomagic = 0 |
| int | zcat_flg = 0 |
| int | quiet = 0 |
| int | block_compress = BLOCK_MASK |
| int | clear_flg = 0 |
| long int | ratio = 0 |
| count_int | checkpoint = CHECK_GAP |
| int | force = 0 |
| char | ofname [100] |
| void(* | bgnd_flag )() |
| int | do_decomp = 0 |
| static int | offset |
| long int | in_count = 1 |
| long int | bytes_out |
| long int | out_count = 0 |
| static char | buf [BITS] |
| char_type | lmask [9] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00} |
| char_type | rmask [9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff} |
|
|
Definition at line 172 of file compress.c. Referenced by main(). |
|
|
Definition at line 52 of file compress.c. |
|
|
Definition at line 154 of file compress.c. |
|
|
Definition at line 83 of file compress.c. |
|
|
Definition at line 155 of file compress.c. |
|
|
Definition at line 258 of file compress.c. Referenced by cl_block(), and compress(). |
|
|
Definition at line 265 of file compress.c. |
|
|
Definition at line 195 of file compress.c. Referenced by compress(). |
|
|
Definition at line 191 of file compress.c. Referenced by main(). |
|
|
Definition at line 215 of file compress.c. |
|
|
Definition at line 79 of file compress.c. |
|
|
Definition at line 73 of file compress.c. |
|
|
Definition at line 264 of file compress.c. Referenced by chkdev(), cl_block(), compress(), getone(), and markzone(). |
|
|
Definition at line 114 of file compress.c. |
|
|
Definition at line 194 of file compress.c. Referenced by compress(). |
|
|
Definition at line 190 of file compress.c. Referenced by main(). |
|
|
Definition at line 159 of file compress.c. Referenced by compress(), decompress(), getcode(), and output(). |
|
|
Definition at line 181 of file compress.c. Referenced by compress(), decompress(), getcode(), and output(). |
|
|
Definition at line 54 of file compress.c. |
|
|
Definition at line 88 of file compress.c. |
|
|
Definition at line 72 of file compress.c. Referenced by cl_block(), cl_hash(), compress(), decompress(), getcode(), output(), and prratio(). |
|
|
Definition at line 65 of file compress.c. |
|
|
Definition at line 209 of file compress.c. Referenced by decompress(). |
|
|
Definition at line 214 of file compress.c. Referenced by decompress(). |
|
|
Definition at line 69 of file compress.c. |
|
|
Definition at line 149 of file compress.c. |
|
|
Definition at line 134 of file compress.c. |
|
|
Definition at line 143 of file compress.c. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 1459 of file compress.c. References CHECK_GAP, checkpoint, cl_hash(), CLEAR, clear_flg, debug, FIRST, fprintf(), output, prratio(), ratio, REGISTER, and verbose. Referenced by compress(). |
|
|
Definition at line 1501 of file compress.c. References htab, j, k, m1, memset(), and REGISTER. Referenced by cl_block(), and compress(). |
|
|
Definition at line 740 of file compress.c. References block_compress, c, CHECK_GAP, checkpoint, cl_block(), cl_hash(), clear_flg, codetabof, EOF, ferror, FIRST, free_ent, getc, hsize, htabof, i, INIT_BITS, L, long(), magic_header, maxbits, MAXCODE, maxcode, maxmaxcode, n_bits, nomagic, output, putc, ratio, REGISTER, stdin, stdout, and writeerr(). |
|
||||||||||||
|
Definition at line 1347 of file compress.c. References chmod, chown, close, do_decomp, exit_stat, fflush(), fileno(), force, fprintf(), ofname, perror(), quiet, S_IFMT, S_IFREG, stat::st_atime, stat::st_gid, stat::st_mode, stat::st_mtime, stat::st_nlink, stat::st_uid, stat, stdout, time_t, timep, unlink, and utime. |
|
|
Definition at line 1034 of file compress.c. References INIT_BITS, MAXCODE, maxcode, n_bits, REGISTER, stackp, tab_prefixof, and tab_suffixof. Referenced by main(). |
|
|
Definition at line 1424 of file compress.c. |
|
|
Definition at line 1126 of file compress.c. References bits, BITS, bp, clear_flg, fread(), free_ent, INIT_BITS, maxbits, MAXCODE, maxcode, maxmaxcode, n_bits, REGISTER, size, and stdin. |
|
||||||||||||
|
Definition at line 289 of file compress.c. References ARGVAL, atoi, bgnd_flag, codetab, CODETABSIZE, cp, debug, DEBUG, exit(), fprintf(), htab, HTABSIZE, malloc(), maxbits, nextarg(), NULL, overwrite(), SIG_IGN, SIGINT, signal(), SIGSEGV, stderr, stdin, stdout, strcmp, strrchr(), tempname, Usage(), and version. |
|
|
Definition at line 1441 of file compress.c. References exit(), ofname, SIG_IGN, SIGINT, signal(), and unlink. |
|
|
Definition at line 1449 of file compress.c. References do_decomp, exit(), fprintf(), ofname, SIG_IGN, signal(), SIGSEGV, and unlink. |
|
|
Definition at line 887 of file compress.c. References bits, bp, clear_flg, col(), debug, ferror, fflush(), fprintf(), free_ent, fwrite(), INIT_BITS, maxbits, MAXCODE, maxcode, maxmaxcode, n_bits, putc, REGISTER, stderr, stdout, verbose, and writeerr(). |
|
||||||||||||||||
|
Definition at line 1565 of file compress.c. References fprintf(), int(), L, putc, and REGISTER. Referenced by cl_block(). |
|
|
Definition at line 238 of file compress.c. |
|
|
Definition at line 1586 of file compress.c. |
|
|
Definition at line 1340 of file compress.c. References exit(), ofname, perror(), and unlink. Referenced by compress(), and output(). |
|
|
Definition at line 280 of file compress.c. Referenced by foreground(), and main(). |
|
|
Definition at line 255 of file compress.c. Referenced by compress(). |
|
|
Definition at line 881 of file compress.c. |
|
|
Definition at line 721 of file compress.c. |
|
|
Definition at line 259 of file compress.c. Referenced by cl_block(), and compress(). |
|
|
Definition at line 256 of file compress.c. Referenced by cl_block(), compress(), getcode(), and output(). |
|
|
Definition at line 189 of file compress.c. Referenced by main(). |
|
|
Definition at line 286 of file compress.c. Referenced by copystat(), and oops(). |
|
|
Definition at line 219 of file compress.c. Referenced by copystat(). |
|
|
Definition at line 267 of file compress.c. |
|
|
Definition at line 218 of file compress.c. Referenced by compress(), getcode(), and output(). |
|
|
Definition at line 198 of file compress.c. Referenced by sendfile(). |
|
|
Definition at line 197 of file compress.c. Referenced by compress(). |
|
|
Definition at line 188 of file compress.c. |
|
|
Definition at line 720 of file compress.c. Referenced by diskio(). |
|
|
Definition at line 884 of file compress.c. Referenced by inflate_fast(). |
|
|
Definition at line 151 of file compress.c. Referenced by compress(). |
|
|
Definition at line 175 of file compress.c. Referenced by compress(), getcode(), main(), and output(). |
|
|
Definition at line 176 of file compress.c. Referenced by compress(), decompress(), getcode(), and output(). |
|
|
Definition at line 177 of file compress.c. Referenced by compress(), getcode(), and output(). |
|
|
Definition at line 174 of file compress.c. Referenced by compress(), decompress(), getcode(), and output(). |
|
|
Definition at line 247 of file compress.c. Referenced by compress(). |
|
|
Definition at line 719 of file compress.c. |
|
|
Definition at line 268 of file compress.c. Referenced by copystat(), encode(), main(), makename(), onintr(), oops(), and writeerr(). |
|
|
Definition at line 722 of file compress.c. |
|
|
Definition at line 249 of file compress.c. Referenced by copystat(). |
|
|
Definition at line 257 of file compress.c. Referenced by cl_block(), compress(), do_extract_currentfile(), and do_list(). |
|
|
Definition at line 885 of file compress.c. |
|
|
Definition at line 248 of file compress.c. |
1.4.6