Blame arch.h

9953f6
#ifndef ARCH_H
9953f6
#define ARCH_H
9953f6
9953f6
9953f6
#include "buffer.h"
9953f6
9953f6
9953f6
enum {
9953f6
    RES_RETRY,
9953f6
    RES_DONE,
9953f6
    RES_FAIL
9953f6
};
9953f6
9953f6
9953f6
typedef unsigned short Code;
9953f6
9953f6
9953f6
typedef struct Entry {
9953f6
    struct Entry *parent, *prev, *next;
9953f6
    Code children[256];
9953f6
    Byte value;
9953f6
} Entry;
9953f6
9953f6
9953f6
typedef struct Arch {
9953f6
    Buffer rb, wb;
9953f6
    Entry root, *entries, *first, *last;
9953f6
    Code nextcode;
9953f6
    unsigned int codebits;
9953f6
} Arch;
9953f6
9953f6
9953f6
int arch_init(Arch *a);
9953f6
void arch_deinit(Arch *a);
9953f6
int arch_deflate(Arch *a, int final);
9953f6
int arch_inflate(Arch *a, int final);
9953f6
9953f6
9953f6
#endif