-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpm.h
48 lines (40 loc) · 983 Bytes
/
cpm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef CPM_H
#define CMP_H
/* Prevent multiple inclusion */
/* cpm.h
Various definitions for Workshop E
*/
/* The bitmap */
extern unsigned char bitmap[12];
/* 360Kb disk with 4Kb blocks -> 11.25 bytes for bitmap
so round up to 12 */
/* The directory entry */
struct CPMdirent
{
signed char usercode;
char filename[9];
char filetype[4];
char extent;
char blockcount;
char blocks[16];
};
/* Modelled on the description in [1].
The two unused bytes have been added to the
end of the two name parameters to allow them
to be C strings
*/
/* The Directory */
extern struct CPMdirent directory[128];
int toggle_bit(int block);
/* Toggles the value of the bit block, in
the external array bitmap.
returns the current value of the bit
Does NOT validate block!!!
*/
int block_status(int block);
/* Returns if block block is allocated
returns 0 if bitmap bit is 0, not
0 if bitmap bit is 1
Does NOT validate block!!!
*/
#endif