2 * defines types used in nspark
4 * $Header: spark.h 1.8 95/08/01 $
6 * Revision 1.8 95/08/01 xx:xx:xx BB
7 * Added MSDOS6 and MSDOS7 macros
9 * Revision 1.7 94/11/09 10:36:00 auj
10 * Added Windows NT support.
12 * Revision 1.6 93/04/05 12:34:56 arb
13 * Added RISC OS support.
15 * Revision 1.5 92/11/04 16:57:32 duplain
16 * Completed CT_xxx types.
18 * Revision 1.4 92/10/23 14:06:57 duplain
19 * Added test for Sys V.4 when defining Sys V file and path name lengths.
21 * Revision 1.3 92/10/06 12:22:11 duplain
22 * Removed "days_since_1900" from struct date.
24 * Revision 1.2 92/09/30 10:28:13 duplain
25 * Added W_OPENMODE and R_OPENMODE.
27 * Revision 1.1 92/09/29 18:02:41 duplain
36 * globalise system-type defines...
38 #if defined(RISCOS2) || defined(RISCOS3)
41 /* BB changed next line */
42 /* #if defined(MSDOS2) || defined(MSDOS3) || defined(MSDOS4) || defined(MSDOS5) || defined(WINNT) */
43 #if defined(MSDOS2) || defined(MSDOS3) || defined(MSDOS4) || \
44 defined(MSDOS5) || defined(MSDOS6) || defined(MSDOS7) || \
45 defined(MSDOS32) || defined(WINNT)
50 * "Word" must be a 4-byte type.
51 * "Halfword" must be a 2-byte type.
52 * "Byte" must be a 1-byte type.
54 #if defined (MSDOS) && !defined(WINNT) && !defined(MSDOS32)
55 typedef unsigned long Word
;
56 typedef unsigned int Halfword
;
57 typedef unsigned char Byte
;
59 typedef unsigned int Word
;
60 typedef unsigned short Halfword
;
61 typedef unsigned char Byte
;
65 * define the path seperator character, and file open mode string.
69 #define PATHSEPSTR "/"
70 #define W_OPENMODE "w"
71 #define R_OPENMODE "r"
75 #define PATHSEPSTR "."
76 #define W_OPENMODE "w"
77 #define R_OPENMODE "r"
81 #define PATHSEP '/' /* Win NT uses \ as the seperator, but MSC
82 allows /, so use that as it makes life
83 easier in filename translation. */
84 #define PATHSEPSTR "/"
87 #define PATHSEPSTR "\\"
89 #define W_OPENMODE "wb"
90 #define R_OPENMODE "rb"
94 * define maximum filename and pathname length
97 #define FILENAMELEN 256
98 #define PATHNAMELEN 1024
101 #define FILENAMELEN 10
102 #define PATHNAMELEN 256
106 #define FILENAMELEN 256
107 #define PATHNAMELEN 1024
109 #define FILENAMELEN 12 /* including dot */
110 #define PATHNAMELEN 256
115 * stream error enumeration
117 typedef enum {FNOERR
, FEND
, FRWERR
} Ferror
;
122 typedef enum {NOEXIST
, ISFILE
, ISDIR
} Ftype
;
125 * un-archiving status
127 typedef enum {NOERR
, RERR
, WERR
, CRCERR
} Status
;
130 * compressed file header
133 Byte comptype
; /* compression type */
134 char name
[14]; /* name of file */
135 Word complen
; /* compressed length */
136 Halfword date
; /* file creation date */
137 Halfword time
; /* file creation time */
138 Halfword crc
; /* Cyclic Redundancy Check */
139 Word origlen
; /* original length */
140 Word load
; /* load address */
141 Word exec
; /* exec address */
142 Word attr
; /* file attributes */
146 char magic
[4]; /* Should be SQSH */
147 Word origlen
; /* Original length */
148 Word load
; /* load address */
149 Word exec
; /* exec address */
150 Word reserved
; /* For future use */
154 * universal date structure
166 * compress type (passed to uncompress())
168 typedef enum { COMPRESS
, SQUASH
, CRUNCH
, UNIX_COMPRESS
} CompType
;
173 #define CT_NOTCOMP (Byte)0x01 /* not compressed (old) */
174 #define CT_NOTCOMP2 (Byte)0x02 /* not compressed (new) */
175 #define CT_PACK (Byte)0x03 /* run length */
176 #define CT_PACKSQUEEZE (Byte)0x04 /* run length + Huffman squeezing */
177 #define CT_LZOLD (Byte)0x05 /* Lempel-Ziv (old) */
178 #define CT_LZNEW (Byte)0x06 /* Lempel-Ziv (new) */
179 #define CT_LZW (Byte)0x07 /* Lempel-Ziv Welch */
180 #define CT_CRUNCH (Byte)0x08 /* Dynamic LZW with adaptive reset */
181 #define CT_SQUASH (Byte)0x09 /* PKARC squashing */
182 #define CT_COMP (Byte)0x7f /* UNIX compress */
185 * other spark defines
187 #define STARTBYTE (Byte)0x1a /* start of archive marker */
188 #define RUNMARK (Byte)0x90 /* start of run (pack/unpack) */
189 #define ARCHPACK (Byte)0x80 /* bit-7 set in comptype if Archie */
191 #endif /* __SPARK_H */