1 /***********************************************************
3 ***********************************************************/
6 extern struct lha_opts opts;
9 decode_start(struct lzh_istream *rp)
11 huf_decode_start(rp, opts.method);
15 decode(struct huf_t *huf, struct lzh_istream *rp, uint count,
16 char *buf, unsigned int *slide_off, int *slide_len)
17 /* The calling function must keep the number of
18 bytes to be processed. This function decodes
19 either 'count' bytes or 'DICSIZ' bytes, whichever
20 is smaller, into the array 'buffer[]' of size
22 Call decode_start() once for each new file
23 before calling this function. */
28 while (--*slide_len >= 0) {
29 buf[r] = buf[*slide_off];
30 *slide_off = (*slide_off+1) & (MAXDICSIZ - 1);
35 c = decode_c(huf, rp);
42 *slide_len = c - (UCHAR_MAX + 1 - THRESHOLD);
43 *slide_off = (r - decode_p(huf, rp) - 1) & (MAXDICSIZ - 1);
44 while (--*slide_len >= 0) {
45 buf[r] = buf[*slide_off];
46 *slide_off = (*slide_off+1) & (MAXDICSIZ - 1);