1 /* Catacomb Armageddon Source Code
\r
2 * Copyright (C) 1993-2014 Flat Rock Software
\r
4 * This program is free software; you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation; either version 2 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License along
\r
15 * with this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
22 // FUNCTION : General defines, prototypes, typedefs used in all the
\r
23 // supported compression techniques used in JAMPAK Ver x.x
\r
30 //==========================================================================
\r
32 // PARAMETER PASSING TYPES
\r
35 // SOURCE PARAMS (LO BYTE)
\r
37 #define SRC_FILE (0x0001) // GE Buffered IO
\r
38 #define SRC_FFILE (0x0002) // Stdio File IO (fwrite etc.)
\r
39 #define SRC_MEM (0x0004) // Std void ptr (alloc etc)
\r
40 #define SRC_BFILE (0x0008) // Buffered File I/O
\r
42 #define SRC_TYPES (SRC_FILE | SRC_FFILE | SRC_MEM | SRC_BFILE)
\r
44 // DESTINATION PARAMS (HI BYTE)
\r
46 #define DEST_FILE (0x0100) // GE Buffered IO
\r
47 #define DEST_FFILE (0x0200) // Stdio File IO (fwrite etc.)
\r
48 #define DEST_MEM (0x0400) // Std void ptr (alloc etc)
\r
49 #define DEST_IMEM (0x0800) // ID Memory alloc
\r
51 #define DEST_TYPES (DEST_FILE | DEST_FFILE | DEST_MEM | DEST_IMEM)
\r
55 //=========================================================================
\r
59 // NOTE: The only reason for changing from COMP to CMP1 and having multi
\r
60 // comp header structs is for downward compatablity.
\r
63 #define COMP ("COMP") // Comp type is ct_LZW ALWAYS!
\r
64 #define CMP1 ("CMP1") // Comp type is determined in header.
\r
68 // COMPRESSION TYPES
\r
70 typedef enum ct_TYPES
\r
72 ct_NONE = 0, // No compression - Just data..Rarely used!
\r
73 ct_LZW, // LZW data compression
\r
79 // FILE CHUNK HEADER FORMATS
\r
84 unsigned long DecompLen;
\r
91 unsigned CompType; // SEE: ct_TYPES above for list of pos.
\r
92 unsigned long OrginalLen; // Orginal FileLength of compressed Data.
\r
93 unsigned long CompressLen; // Length of data after compression (A MUST for LZHUFF!)
\r
98 //---------------------------------------------------------------------------
\r
100 // FUNCTION PROTOTYPEING
\r
102 //---------------------------------------------------------------------------
\r
104 char WritePtr(long outfile, unsigned char data, unsigned PtrType);
\r
105 int ReadPtr(long infile, unsigned PtrType);
\r