#define VERBOSE /* If defined, prints verbose
program progress when it's
running... */
short father[512];
unsigned short code[256], heap_length;
unsigned long compress_charcount, file_size, heap[257];
unsigned char code_length[256];
long frequency_count[512];
#ifdef VERBOSE
printf ("(1) Getting Frequency Counts.\n");
#endif
fseek (ifile, 0L, 0);
get_frequency_count ();
#ifdef VERBOSE
printf ("(2) Building Initial Heap.\n");
#endif
build_initial_heap ();
#ifdef VERBOSE
printf ("(3) Building the Code Tree.\n");
#endif
build_code_tree ();
#ifdef VERBOSE
printf ("(4) Generating the Code Table.\n");
#endif
if (!generate_code_table ())
printf ("ERROR! Code Value Out of Range. Cannot Compress.\n");
else
{
#ifdef VERBOSE
printf ("(5) Compressing & Creating the Output File.\n");
#endif
This function counts the number of occurrences of each byte in the data
that are to be compressed.
**************************************************************************/
void get_frequency_count ()
{
register unsigned long loop;