Commit 470866d7 authored by Mike Iovine's avatar Mike Iovine
Browse files

Remove unused import

parent 593d7870
No related merge requests found
Showing with 3 additions and 24 deletions
+3 -24
......@@ -10,7 +10,7 @@ huffman : huffman.c
cc huffman.c -o huffman
inflate : inflate.c
cc inflate.c -o inflate -lm
cc inflate.c -o inflate
clean :
rm myzip0 myunzip0 huffman inflate
......@@ -4,36 +4,16 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "inflate.h"
/* Types of huffman codes */
#define FIXED 1
#define DYNAMIC 2
/* Maximum length for any Huffman code */
#define MAX_LENGTH 15
/* Dummy value for min_codes in huffman_t structs */
#define NO_CODE -1
typedef struct huffman {
/* bl_counts[i] = number of codes of length i */
int bl_counts[MAX_LENGTH + 1];
/* This stores the alphabet.
* alphabet[i] returns an array of alphabet symbols of length bl_counts[i].
*/
int *alphabet[MAX_LENGTH + 1];
/* Suppose we are reading a code and we want an index into the alphabet array.
* These are basically the numerical offsets for such an index.
* So if the code we are reading has value c and is of length i,
* its alphabet character is indexed by (c - min_codes[i]).
*/
int min_codes[MAX_LENGTH + 1];
} huffman_t;
/*
* Constants for FIXED code type
*/
......@@ -323,7 +303,6 @@ int *read_lens(char *buf, huffman_t *hf_codes, int num_symbols, int num_codes) {
return lens;
}
/* Read the block starting at the n-th bit */
void read_block(char *buf, FILE *out) {
/* First bit is the BFINAL flag */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment