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
30 // LZW_THRESHOLD :encode string into position and length if match_length is
\r
31 // greater than this
\r
33 #define LZW_THRESHOLD 2
\r
35 // index for root of binary search trees
\r
38 #define LZW_NIL LZW_N
\r
44 // NOTE: The only reason for changing from COMP to CMP2 and having multi
\r
45 // comp header structs is for downward compatablity.
\r
48 #define COMP ("COMP") // Comp type is ct_LZW ALWAYS!
\r
49 #define CMP2 ("CMP2") // Comp type is determined in header.
\r
53 // COMPRESSION TYPES
\r
58 // FILE CHUNK HEADER FORMATS
\r
63 unsigned long DecompLen;
\r
71 unsigned long DecompLen;
\r
77 extern BufferedIO lzwBIO;
\r
81 // PARAMETER PASSING TYPES (POINTER TYPES)
\r
84 #define SRC_FILE (0x0001) // C's non-buffered file i/o
\r
85 #define SRC_FFILE (0x0002) // C's buffered ffile i/o
\r
86 #define SRC_MEM (0x0004) // FAR memory Ptrs
\r
87 #define SRC_BFILE (0x0008) // Buffered File I/O
\r
89 #define SRC_TYPES (SRC_FILE | SRC_FFILE | SRC_MEM | SRC_BFILE)
\r
91 #define DEST_FILE (0x0100) // C's non-buffered file i/o
\r
92 #define DEST_FFILE (0x0200) // C's buffered ffile i/o
\r
93 #define DEST_MEM (0x0400) // FAR memory Ptrs
\r
95 #define DEST_TYPES (DEST_FILE | DEST_FFILE | DEST_MEM)
\r
98 //---------------------------------------------------------------------------
\r
99 // FUNCTION PROTOTYPEING
\r
100 //---------------------------------------------------------------------------
\r
102 //void DecompressFILEtoFILE(FILE *infile, FILE *outfile);
\r
103 //unsigned long CompressFILEtoFILE(FILE *infile, FILE *outfile,unsigned long DataLength);
\r
106 unsigned long lzwCompress(void far *infile, void far *outfile,unsigned long DataLength,unsigned PtrTypes);
\r
107 void lzwDecompress(void far *infile, void far *outfile,unsigned long DataLength,unsigned PtrTypes);
\r
109 int WritePtr(long outfile, unsigned char data, unsigned PtrType);
\r
110 int ReadPtr(long infile, unsigned PtrType);
\r
112 //memptr InitBufferedIO(int handle, BufferedIO *bio);
\r
113 //void FreeBufferedIO(BufferedIO *bio);
\r
114 //byte bio_readch(BufferedIO *bio);
\r
116 unsigned long BLoad(char *SourceFile, memptr *DstPtr);
\r
117 memptr LoadLIBFile(char *LibName,char *FileName,memptr *MemPtr);
\r
118 int LoadLIBShape(char *SLIB_Filename, char *Filename,struct Shape *SHP);
\r