1 /*****************************************************************************/
3 /* apple2_filetype.h */
5 /* Apple ][ file type definitions */
9 /* (C) 2017 Bill Chatfield, <bill_chatfield@yahoo.com> */
12 /* This software is provided 'as-is', without any expressed or implied */
13 /* warranty. In no event will the authors be held liable for any damages */
14 /* arising from the use of this software. */
16 /* Permission is granted to anyone to use this software for any purpose, */
17 /* including commercial applications, and to alter it and redistribute it */
18 /* freely, subject to the following restrictions: */
20 /* 1. The origin of this software must not be misrepresented; you must not */
21 /* claim that you wrote the original software. If you use this software */
22 /* in a product, an acknowledgment in the product documentation would be */
23 /* appreciated but is not required. */
24 /* 2. Altered source versions must be plainly marked as such, and must not */
25 /* be misrepresented as being the original software. */
26 /* 3. This notice may not be removed or altered from any source */
29 /*****************************************************************************/
33 #ifndef _APPLE2_FILETYPE_H
34 #define _APPLE2_FILETYPE_H
38 /* Check for errors */
39 #if !defined(__APPLE2__)
40 # error This module may only be used when compiling for the Apple ][!
45 /*****************************************************************************/
47 /*****************************************************************************/
51 /* ProDOS general file types */
52 #define PRODOS_T_UNK 0x00 /* Unknown */
53 #define PRODOS_T_BAD 0x01 /* Bad blocks */
54 #define PRODOS_T_PCD 0x02 /* Pascal code */
55 #define PRODOS_T_PTX 0x03 /* Pascal text */
56 #define PRODOS_T_TXT 0x04 /* ASCII text */
57 #define PRODOS_T_PDA 0x05 /* Pascal data */
58 #define PRODOS_T_BIN 0x06 /* Binary */
59 #define PRODOS_T_FNT 0x07 /* Apple III font */
60 #define PRODOS_T_FOT 0x08 /* Hi-res, dbl hi-res graphics */
61 #define PRODOS_T_BA3 0x09 /* Apple III BASIC program */
62 #define PRODOS_T_DA3 0x09 /* Apple III BASIC data */
63 #define PRODOS_T_WPF 0x0A /* Generic word processing */
64 #define PRODOS_T_SOS 0x0B /* SOS system */
65 #define PRODOS_T_DIR 0x0F /* ProDOS directory */
67 /* ProDOS productivity file types */
68 #define PRODOS_T_RPD 0x10 /* RPS data */
69 #define PRODOS_T_RPI 0x11 /* RPS index */
70 #define PRODOS_T_AFD 0x12 /* AppleFile discard */
71 #define PRODOS_T_AFM 0x13 /* AppleFile model */
72 #define PRODOS_T_AFR 0x14 /* AppleFile report */
73 #define PRODOS_T_SCL 0x15 /* Screen library */
74 #define PRODOS_T_PFS 0x16 /* PFS document */
75 #define PRODOS_T_ADB 0x19 /* AppleWorks database */
76 #define PRODOS_T_AWP 0x1A /* AppleWorks word processing */
77 #define PRODOS_T_ASP 0x1B /* AppleWorks spreadsheet */
79 /* ProDOS code file types */
80 #define PRODOS_T_TDM 0x20 /* Desktop Manager */
81 #define PRODOS_T_IPS 0x21 /* Instant Pascal source */
82 #define PRODOS_T_UPV 0x22 /* USCD Pascal volume */
83 #define PRODOS_T_3SD 0x29 /* SOS directory */
84 #define PRODOS_T_8SC 0x2A /* Source code */
85 #define PRODOS_T_8OB 0x2B /* Object code */
86 #define PRODOS_T_8IC 0x2C /* Interpreted code */
87 #define PRODOS_T_8LD 0x2D /* Language data */
88 #define PRODOS_T_P8C 0x2E /* ProDOS 8 code module */
90 /* ProDOS miscellaneous file types */
91 #define PRODOS_T_OCR 0x41 /* Optical char recognition */
92 #define PRODOS_T_FTD 0x42 /* File type definitions */
94 /* ProDOS Apple IIgs general file types */
95 #define PRODOS_T_GWP 0x50 /* Apple IIgs word processing */
96 #define PRODOS_T_GSS 0x51 /* Apple IIgs spreadsheet */
97 #define PRODOS_T_GDB 0x52 /* Apple IIgs database */
98 #define PRODOS_T_DRW 0x53 /* Object oriented graphics */
99 #define PRODOS_T_GDP 0x54 /* Apple IIgs desktop publish */
100 #define PRODOS_T_HMD 0x55 /* HyperMedia */
101 #define PRODOS_T_EDU 0x56 /* Educational program data */
102 #define PRODOS_T_STN 0x57 /* Stationary */
103 #define PRODOS_T_HLP 0x58 /* Help */
104 #define PRODOS_T_COM 0x59 /* Communications */
105 #define PRODOS_T_CFG 0x5A /* Configuration */
106 #define PRODOS_T_ANM 0x5B /* Animation */
107 #define PRODOS_T_MUM 0x5C /* Multimedia */
108 #define PRODOS_T_ENT 0x5D /* Entertainment */
109 #define PRODOS_T_DVU 0x5E /* Development utility */
111 /* ProDOS PC Transporter file types */
112 #define PRODOS_T_PRE 0x60 /* PC pre-boot */
113 #define PRODOS_T_BIO 0x6B /* PC BIOS */
114 #define PRODOS_T_NCF 0x66 /* ProDOS File Nav command file */
115 #define PRODOS_T_DVR 0x6D /* PC driver */
116 #define PRODOS_T_PRE2 0x6E /* PC pre-boot */
117 #define PRODOS_T_HDV 0x6F /* PC hard disk image */
119 /* ProDOS Kreative Software file types */
120 #define PRODOS_T_SN2 0x70 /* Sabine's Notebook 2.0 */
121 #define PRODOS_T_KMT 0x71
122 #define PRODOS_T_DSR 0x72
123 #define PRODOS_T_BAN 0x73
124 #define PRODOS_T_CG7 0x74
125 #define PRODOS_T_TNJ 0x75
126 #define PRODOS_T_SA7 0x76
127 #define PRODOS_T_KES 0x77
128 #define PRODOS_T_JAP 0x78
129 #define PRODOS_T_CSL 0x79
130 #define PRODOS_T_TME 0x7A
131 #define PRODOS_T_TLB 0x7B
132 #define PRODOS_T_MR7 0x7C
133 #define PRODOS_T_MLR 0x7D /* Mika City */
134 #define PRODOS_T_MMM 0x7E
135 #define PRODOS_T_JCP 0x7F
137 /* ProDOS GEOS file types */
138 #define PRODOS_T_GES 0x80 /* GEOS system file */
139 #define PRODOS_T_GEA 0x81 /* GEOS desk accessory */
140 #define PRODOS_T_GEO 0x82 /* GEOS application */
141 #define PRODOS_T_GED 0x83 /* GEOS document */
142 #define PRODOS_T_GEF 0x84 /* GEOS font */
143 #define PRODOS_T_GEP 0x85 /* GEOS printer driver */
144 #define PRODOS_T_GEI 0x86 /* GEOS input driver */
145 #define PRODOS_T_GEX 0x87 /* GEOS auxiliary driver */
146 #define PRODOS_T_GEV 0x89 /* GEOS swap file */
147 #define PRODOS_T_GEC 0x8B /* GEOS clock driver */
148 #define PRODOS_T_GEK 0x8C /* GEOS interface card driver */
149 #define PRODOS_T_GEW 0x8D /* GEOS formatting data */
151 /* ProDOS Apple IIgs BASIC file types */
152 #define PRODOS_T_WP 0xA0 /* WordPerfect */
153 #define PRODOS_T_GSB 0xAB /* Apple IIgs BASIC program */
154 #define PRODOS_T_TDF 0xAB /* Apple IIgs BASIC TDF */
155 #define PRODOS_T_BDF 0xAB /* Apple IIgs BASIC data */
157 /* ProDOS Apple IIgs system file types */
158 #define PRODOS_T_SRC 0xB0 /* Apple IIgs source code */
159 #define PRODOS_T_OBJ 0xB1 /* Apple IIgs object code */
160 #define PRODOS_T_LIB 0xB2 /* Apple IIgs library */
161 #define PRODOS_T_S16 0xB3 /* Apple IIgs application pgm */
162 #define PRODOS_T_RTL 0xB4 /* Apple IIgs runtime library */
163 #define PRODOS_T_EXE 0xB5 /* Apple IIgs shell script */
164 #define PRODOS_T_PIF 0xB6 /* Apple IIgs permanent init */
165 #define PRODOS_T_TIF 0xB7 /* Apple IIgs temporary init */
166 #define PRODOS_T_NDA 0xB8 /* Apple IIgs new desk accesry */
167 #define PRODOS_T_CDA 0xB9 /* Apple IIgs classic desk aces */
168 #define PRODOS_T_TOL 0xBA /* Apple IIgs tool */
169 #define PRODOS_T_DRV 0xBB /* Apple IIgs device driver */
170 #define PRODOS_T_LDF 0xBC /* Apple IIgs generic load file */
171 #define PRODOS_T_FST 0xBD /* Apple IIgs file sys translat */
172 #define PRODOS_T_DOC 0xBF /* Apple IIgs document */
174 /* ProDOS graphics file types */
175 #define PRODOS_T_PNT 0xC0 /* Apple IIgs packed sup hi-res */
176 #define PRODOS_T_PIC 0xC1 /* Apple IIgs super hi-res */
177 #define PRODOS_T_ANI 0xC2 /* PaintWorks animation */
178 #define PRODOS_T_PAL 0xC3 /* PaintWorks palette */
179 #define PRODOS_T_OOG 0xC5 /* Object-oriented graphics */
180 #define PRODOS_T_SCR 0xC6 /* Script */
181 #define PRODOS_T_CDV 0xC7 /* Apple IIgs control panel */
182 #define PRODOS_T_FON 0xC8 /* Apple IIgs font */
183 #define PRODOS_T_FND 0xC9 /* Apple IIgs Finder data */
184 #define PRODOS_T_ICN 0xCA /* Apple IIgs icon */
186 /* ProDOS audio file types */
187 #define PRODOS_T_MUS 0xD5 /* Music */
188 #define PRODOS_T_INS 0xD6 /* Instrument */
189 #define PRODOS_T_MID 0xD7 /* MIDI */
190 #define PRODOS_T_SND 0xD8 /* Apple IIgs audio */
191 #define PRODOS_T_DBM 0xDB /* DB master document */
193 /* ProDOS miscellaneous file types */
194 #define PRODOS_T_LBR 0xE0 /* Archive */
195 #define PRODOS_T_ATK 0xE2 /* AppleTalk data */
196 #define PRODOS_T_R16 0xEE /* EDASM 816 relocatable code */
197 #define PRODOS_T_PAR 0xEF /* Pascal area */
199 /* ProDOS system file types */
200 #define PRODOS_T_CMD 0xF0 /* ProDOS command file */
201 #define PRODOS_T_OVL 0xF1 /* User defined 1 */
202 #define PRODOS_T_UD2 0xF2 /* User defined 2 */
203 #define PRODOS_T_UD3 0xF3 /* User defined 3 */
204 #define PRODOS_T_UD4 0xF4 /* User defined 4 */
205 #define PRODOS_T_BAT 0xF5 /* User defined 5 */
206 #define PRODOS_T_UD6 0xF6 /* User defined 6 */
207 #define PRODOS_T_UD7 0xF7 /* User defined 7 */
208 #define PRODOS_T_PRG 0xF8 /* User defined 8 */
209 #define PRODOS_T_P16 0xF9 /* ProDOS-16 system file */
210 #define PRODOS_T_INT 0xFA /* Integer BASIC program */
211 #define PRODOS_T_IVR 0xFB /* Integer BASIC variables */
212 #define PRODOS_T_BAS 0xFC /* Applesoft BASIC program */
213 #define PRODOS_T_VAR 0xFD /* Applesoft BASIC variables */
214 #define PRODOS_T_REL 0xFE /* EDASM relocatable code */
215 #define PRODOS_T_SYS 0xFF /* ProDOS-8 system file */
217 /* The auxiliary type of a text file specifies its record length.
218 ** A record length of 0 indicates a sequential text file, which is
219 ** equivalent to text files of other operating systems like MacOS
220 ** or Windows, except that lines are delimited by carriage returns
221 ** only. An auxiliary type value greater than 0 for a text file,
222 ** which is the record length, indicates a random access text file
223 ** with fixed-length lines.
225 #define PRODOS_AUX_T_TXT_SEQ 0x0000 /* Sequential text */
227 /* 8IC auxiliary types */
228 #define PRODOS_AUX_T_8IC_APEX_PGM 0x8003 /* Apex program */
230 /* GWP auxiliary types */
231 #define PRODOS_AUX_T_GWP_TEACH 0x5445 /* Teach */
232 #define PRODOS_AUX_T_GWP_DELUXEWRITE 0x8001 /* DeluxeWrite */
233 #define PRODOS_AUX_T_GWP_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
235 /* GSS auxiliary types */
236 #define PRODOS_AUX_T_GSS_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
238 /* GDB auxiliary types */
239 #define PRODOS_AUX_T_GDB_APPLEWORKS_GS 0x8010 /* AppleWorks GS DB */
240 #define PRODOS_AUX_T_GDB_AWGS_TMPL 0x8011 /* AWGS template */
241 #define PRODOS_AUX_T_GDB_GSAS 0x8013
243 /* DRW auxiliary types */
244 #define PRODOS_AUX_T_DRW_OO_GRAPHICS 0x8013 /* AWGS O-O graphics */
246 /* GDP auxiliary types */
247 #define PRODOS_AUX_T_GDP_GRAPHICWRITER 0x8002 /* A2gs GraphicWriter */
248 #define PRODOS_AUX_T_GDP_APPLEWORKS_GS 0x8010 /* A2gs AWGS */
250 /* HMD auxiliary types */
251 #define PRODOS_AUX_T_HMD_HYPERCARD_GS 0x0001 /* HyperCard GS */
252 #define PRODOS_AUX_T_HMD_TUTOR_TECH 0x8001 /* Tutor-Tech */
253 #define PRODOS_AUX_T_HMD_HYPERSTUDIO 0x8002 /* HyperStudio */
254 #define PRODOS_AUX_T_HMD_NEXUS 0x8003 /* Nexus */
256 /* COM auxiliary types */
257 #define PRODOS_AUX_T_COM_APPLEWORKS_GS 0x8003 /* AppleWorks GS */
259 /* MLR auxiliary types */
260 #define PRODOS_AUX_T_MLR_SCRIPT 0x005C /* Mika City script */
261 #define PRODOS_AUX_T_MLR_COLOR_TABLE 0xC7AB /* Mika City color table */
262 #define PRODOS_AUX_T_MLR_CHARACTER_DEF 0xCDEF /* Mika City character def */
264 /* LDF auxiliary types */
265 #define PRODOS_AUX_T_LDF_NIFTY_LIST_MOD 0x4001 /* Nifty list module */
266 #define PRODOS_AUX_T_LDF_SUPER_INFO_MOD 0x4002 /* Super info module */
267 #define PRODOS_AUX_T_LDF_TWILIGHT_MOD 0x4004 /* Twilight module */
268 #define PRODOS_AUX_T_LDF_MARINETTI_LLM 0x4004 /* Marinetti link layer mod */
270 /* PNT auxiliary types */
271 #define PRODOS_AUX_T_PNT_PK_SUPER_HIRES 0x0001 /* Packed super hi-res */
272 #define PRODOS_AUX_T_PNT_APPLE_PREF 0x0002 /* Apple preferred format */
273 #define PRODOS_AUX_T_PNT_PK_QUICKDRAWII 0x0003 /* Packed QuickDraw II */
275 /* PIC auxiliary types */
276 #define PRODOS_AUX_T_PIC_QUICKDRAW 0x0001 /* QuickDraw image */
277 #define PRODOS_AUX_T_PIC_SHIRES_3200 0x0002 /* Super hi-res 3200 */
279 /* FON auxiliary types */
280 #define PRODOS_AUX_T_FON_QUICKDRAW_BIT 0x0000 /* QuickDraw bitmap font */
281 #define PRODOS_AUX_T_FON_POINTLESS_TT 0x0001 /* Pointless TrueType font */
283 /* SND auxiliary types */
284 #define PRODOS_AUX_T_SND_AIFF 0x0000 /* AIFF */
285 #define PRODOS_AUX_T_SND_AIFF_C 0x0001 /* AIFF-C */
286 #define PRODOS_AUX_T_SND_ASIF_INSTR 0x0002 /* ASIF instrument */
287 #define PRODOS_AUX_T_SND_SOUND_RSRC 0x0003 /* Sound resource */
288 #define PRODOS_AUX_T_SND_MIDI_SYNTH_WAV 0x0004 /* MIDI synth wave */
289 #define PRODOS_AUX_T_SND_HYPERSTUDIO 0x8001 /* HyperStudio sound */
291 /* LBR auxiliary types */
292 #define PRODOS_AUX_T_LBR_ALU 0x0000 /* ALU */
293 #define PRODOS_AUX_T_LBR_APPLE_SINGLE 0x0001 /* AppleSingle */
294 #define PRODOS_AUX_T_LBR_APPLEDBL_HDR 0x0002 /* AppleDouble header */
295 #define PRODOS_AUX_T_LBR_APPLEDBL_DATA 0x0003 /* AppleDouble data */
296 #define PRODOS_AUX_T_LBR_BINARY_II 0x8000 /* Binary II */
297 #define PRODOS_AUX_T_LBR_APPLELINK_ACU 0x8001 /* AppleLink ACU */
298 #define PRODOS_AUX_T_LBR_SHRINKIT 0x8002 /* ShrinkIt */
300 /* LBR auxiliary types */
301 #define PRODOS_AUX_T_ATK_EASYMNT_ALIAS 0x0000 /* EasyMount alias */
303 /* BAS auxiliary types */
304 #define PRODOS_AUX_T_BAS_PGM_LOAD_ADDR 0x0801 /* Applesoft pgm load addr */
308 /*****************************************************************************/
310 /*****************************************************************************/
314 /* The file stream implementation and the POSIX I/O functions will use the
315 ** following variables to determine the file type and auxiliary type to use.
316 ** This applies specifically to the fopen and open functions.
318 extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
319 extern unsigned int _auxtype; /* Default: 0 */
321 /* End of apple2_filetype.h */