2
* cbmdos.h - Common CBM DOS routines.
5
* Andreas Boose <viceteam@t-online.de>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
32
/* CBM DOS Input Processor Error Codes. */
33
#define CBMDOS_IPE_OK 0
34
#define CBMDOS_IPE_DELETED 1
35
#define CBMDOS_IPE_SEL_PARTN 2 /* 1581 */
36
#define CBMDOS_IPE_UNIMPL 3
37
#define CBMDOS_IPE_MEMORY_READ 4
39
#define CBMDOS_IPE_WRITE_ERROR 25
40
#define CBMDOS_IPE_WRITE_PROTECT_ON 26
41
#define CBMDOS_IPE_SYNTAX 30
42
#define CBMDOS_IPE_INVAL 31
43
#define CBMDOS_IPE_LONG_LINE 32
44
#define CBMDOS_IPE_BAD_NAME 33
45
#define CBMDOS_IPE_NO_NAME 34
47
#define CBMDOS_IPE_NO_RECORD 50
48
#define CBMDOS_IPE_OVERFLOW 51
50
#define CBMDOS_IPE_NOT_WRITE 60
51
#define CBMDOS_IPE_NOT_OPEN 61
52
#define CBMDOS_IPE_NOT_FOUND 62
53
#define CBMDOS_IPE_FILE_EXISTS 63
54
#define CBMDOS_IPE_BAD_TYPE 64
55
#define CBMDOS_IPE_NO_BLOCK 65
56
#define CBMDOS_IPE_ILLEGAL_TRACK_OR_SECTOR 66
58
#define CBMDOS_IPE_NO_CHANNEL 70
59
#define CBMDOS_IPE_DISK_FULL 72
60
#define CBMDOS_IPE_DOS_VERSION 73
61
#define CBMDOS_IPE_NOT_READY 74
62
#define CBMDOS_IPE_BAD_PARTN 77 /* 1581 */
64
#define CBMDOS_IPE_NOT_EMPTY 80 /* dir to remove not empty */
65
#define CBMDOS_IPE_PERMISSION 81 /* permission denied */
67
/* CBM DOS File Types */
68
#define CBMDOS_FT_DEL 0
69
#define CBMDOS_FT_SEQ 1
70
#define CBMDOS_FT_PRG 2
71
#define CBMDOS_FT_USR 3
72
#define CBMDOS_FT_REL 4
73
#define CBMDOS_FT_CBM 5 /* 1581 partition */
74
#define CBMDOS_FT_REPLACEMENT 0x20
75
#define CBMDOS_FT_LOCKED 0x40
76
#define CBMDOS_FT_CLOSED 0x80
78
/* CBM DOS Access Control Methods */
79
#define CBMDOS_FAM_READ 0
80
#define CBMDOS_FAM_WRITE 1
81
#define CBMDOS_FAM_APPEND 2
83
/* CBM DOS directory definitions. */
84
#define CBMDOS_SLOT_NAME_LENGTH 16
87
struct cbmdos_cmd_parse_s {
89
unsigned int cmdlength;
91
unsigned int secondary;
92
unsigned int parselength;
93
unsigned int readmode;
94
unsigned int filetype;
95
unsigned int recordlength;
97
typedef struct cbmdos_cmd_parse_s cbmdos_cmd_parse_t;
100
extern const char *cbmdos_errortext(unsigned int code);
101
extern const char *cbmdos_filetype_get(unsigned int filetype);
103
extern unsigned int cbmdos_parse_wildcard_check(const char *name,
105
extern unsigned int cbmdos_parse_wildcard_compare(const BYTE *name1,
107
extern BYTE *cbmdos_dir_slot_create(const char *name, unsigned int len);
109
extern unsigned int cbmdos_command_parse(cbmdos_cmd_parse_t *cmd_parse);