/* 31/01/01 Header for Tinytim libtiny Net Yaroze Compression library v1.0 */ /* compressed file/data header id's */ #define ID_ZLIB 0x7A4C6942 /* zLiB */ #define ID_HUFF 0x48754666 /* HuFf */ /* function error return codes */ #define T_LEN_ERROR 0 /* source length zero */ #define T_ID_ERROR -1 /* header id incorrect */ #define T_MEM_ERROR -2 /* malloc failure */ #define T_BUF_ERROR -3 /* compressed data buffer too small (compressed data would be larger than original) */ #define T_DATA_ERROR -4 /* compressed data is corrupt */ /* compressed data header structure */ typedef struct { u_int id; /* compression type identifier */ u_int orig_size; /* original file length */ u_int comp_size; /* compressed file length */ }S_HDR; /* library function prototypes */ int z_compress(u_char *source_p, u_int sourcelen, u_char *destination_p); int z_uncompress(u_char *source_p, u_char *destination_p); int huf_compress(u_char *source_p, u_int sourcelen, u_char *destination_p); int huf_uncompress(u_char *source_p, u_char *destination_p);