]> 4ch.mooo.com Git - 16.git/blob - 16/cawat/JAMPAK.H
wwww
[16.git] / 16 / cawat / JAMPAK.H
1 /* Catacomb Armageddon Source Code\r
2  * Copyright (C) 1993-2014 Flat Rock Software\r
3  *\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
8  *\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
13  *\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
17  */\r
18 \r
19 //\r
20 //\r
21 //\r
22 //\r
23 //\r
24 \r
25 \r
26 #define LZW_N           4096\r
27 #define LZW_F           18\r
28 \r
29 \r
30 // LZW_THRESHOLD :encode string into position and length if match_length is\r
31 // greater than this\r
32 \r
33 #define LZW_THRESHOLD                           2\r
34 \r
35 // index for root of binary search trees\r
36 //\r
37 \r
38 #define LZW_NIL                         LZW_N\r
39 \r
40 \r
41 //\r
42 // FILE CHUNK IDs\r
43 //\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
46 //\r
47 \r
48 #define COMP                                    ("COMP")                // Comp type is ct_LZW ALWAYS!\r
49 #define CMP2                                    ("CMP2")                // Comp type is determined in header.\r
50 \r
51 \r
52 //\r
53 //      COMPRESSION TYPES\r
54 //\r
55 \r
56 #if 0\r
57 //\r
58 //      FILE CHUNK HEADER FORMATS\r
59 //\r
60 \r
61 struct COMPStruct\r
62 {\r
63         unsigned long DecompLen;\r
64 \r
65 };\r
66 \r
67 \r
68 struct CMP2Header\r
69 {\r
70         unsigned CompType;\r
71         unsigned long DecompLen;\r
72 \r
73 };\r
74 #endif\r
75 \r
76 memptr segptr;\r
77 extern BufferedIO lzwBIO;\r
78 \r
79 \r
80 //\r
81 //        PARAMETER PASSING TYPES (POINTER TYPES)\r
82 //\r
83 \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
88 \r
89 #define SRC_TYPES                       (SRC_FILE | SRC_FFILE | SRC_MEM | SRC_BFILE)\r
90 \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
94 \r
95 #define DEST_TYPES                      (DEST_FILE | DEST_FFILE | DEST_MEM)\r
96 \r
97 \r
98 //---------------------------------------------------------------------------\r
99 //                                                              FUNCTION PROTOTYPEING\r
100 //---------------------------------------------------------------------------\r
101 \r
102 //void DecompressFILEtoFILE(FILE *infile, FILE *outfile);\r
103 //unsigned long CompressFILEtoFILE(FILE *infile, FILE *outfile,unsigned long DataLength);\r
104 \r
105 \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
108 \r
109 int WritePtr(long outfile, unsigned char data, unsigned PtrType);\r
110 int ReadPtr(long infile, unsigned PtrType);\r
111 \r
112 //memptr InitBufferedIO(int handle, BufferedIO *bio);\r
113 //void FreeBufferedIO(BufferedIO *bio);\r
114 //byte bio_readch(BufferedIO *bio);\r
115 \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