Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / diskimage / dms / xdms.h
blob5fabba8e544afeab430e541eecb01903e53f7019
1 /*
2 * xDMS v1.3 - Portable DMS archive unpacker - Public Domain
3 * Written by Andre Rodrigues de la Rocha <adlroc@usa.net>
5 */
7 #ifndef XDMS_H
8 #define XDMS_H
10 #ifndef EXEC_TYPES_H
11 #include <exec/types.h>
12 #endif
14 #include <string.h>
16 struct xdms_data {
17 UWORD PWDCRC;
18 UWORD quick_text_loc;
19 UWORD medium_text_loc;
20 UWORD heavy_text_loc;
21 UWORD deep_text_loc;
22 int init_deep_tabs;
23 UBYTE *text;
25 UBYTE *indata;
26 ULONG bitcount;
27 ULONG bitbuf;
29 struct {
30 UWORD freq[628]; // freq[T + 1]
31 UWORD prnt[941]; // prnt[T + N_CHAR]
32 UWORD son[627]; // son[T];
33 } u_deep;
35 struct {
36 UWORD left[1019]; // left[2 * NC - 1]
37 UWORD right[1028]; // right[2 * NC - 1 + 9]
38 UBYTE c_len[510]; // c_len[NC]
39 UBYTE pt_len[20]; // pt_len[NPT]
40 UWORD c_table[4096];
41 UWORD pt_table[256];
42 UWORD lastlen, np;
43 } u_heavy;
46 /* crc_csum.c */
47 UWORD Calc_CheckSum (const UBYTE *mem, ULONG size);
48 UWORD CreateCRC (const UBYTE *mem, ULONG size);
50 /* getbits.c */
51 extern const ULONG mask_bits[];
52 void initbitbuf (struct xdms_data *xdms, UBYTE *in);
53 #define INITBITBUF(in) initbitbuf(xdms, in)
54 #define GETBITS(n) ((UWORD)(xdms->bitbuf >> (xdms->bitcount-(n))))
55 #define DROPBITS(n) {xdms->bitbuf &= mask_bits[xdms->bitcount-=(n)]; while (xdms->bitcount<16) {xdms->bitbuf = (xdms->bitbuf << 8) | *xdms->indata++; xdms->bitcount += 8;}}
57 /* tables.c */
58 extern const UBYTE d_code[];
59 extern const UBYTE d_len[];
61 /* maketbl.c */
62 UWORD make_table (struct xdms_data *xdms, UWORD nchar, UBYTE bitlen[],UWORD tablebits, UWORD table[]);
64 /* u_init.c */
65 void Init_Decrunchers (struct xdms_data *xdms);
67 /* u_deep.c */
68 UWORD Unpack_DEEP (struct xdms_data *xdms, UBYTE *in, UBYTE *out, UWORD origsize);
70 /* u_heavy.c */
71 UWORD Unpack_HEAVY (struct xdms_data *xdms, UBYTE *in, UBYTE *out, UBYTE flags, UWORD origsize);
73 /* u_medium.c */
74 UWORD Unpack_MEDIUM (struct xdms_data *xdms, UBYTE *in, UBYTE *out, UWORD origsize);
76 /* u_quick.c */
77 UWORD Unpack_QUICK(struct xdms_data *xdms, UBYTE *in, UBYTE *out, UWORD origsize);
79 /* u_rle.c */
80 UWORD Unpack_RLE (struct xdms_data *xdms, UBYTE *in, UBYTE *out, UWORD origsize);
82 #endif