huffinit.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1993-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* huffman coding initialization
*
* David Korn
* AT&T Laboratories
*/
#include "huffman.h"
#include <error.h>
/* the heap */
typedef struct
{
long int count;
int node;
} Heap_t;
static int lastnode;
{
register int n;
register unsigned char *inbuff;
register int i, c;
{
return((Huff_t*)0);
}
for (i=0; i<END; i++)
count[i] = 0;
{
if(size>=0)
{
if(n > size)
n = size;
size -= n;
}
while (n > 0)
}
if(n < 0)
{
return((Huff_t*)0);
}
for (i=0; i<END; i++)
/* put occurring chars in heap with their counts */
for (i=END; i>=0; i--)
{
parent[i] = 0;
if (count[i] > 0)
{
}
}
for (i=n/2; i>=1; i--)
/* build Huffman tree */
while (n > 1)
{
n--;
}
/* assign lengths to encoding for each character */
for (i=1; i<=HUFFLEV; i++)
for (i=0; i<=END; i++)
{
c = 0;
c++;
}
return(hp);
}
/* makes a heap out of heap[i],...,heap[n] */
{
register int k;
register int lastparent = n/2;
while (i <= lastparent)
{
k = 2*i;
k++;
break;
i = k;
}
}