summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/FDISK/VDISPLAY.C
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/FDISK/VDISPLAY.C')
-rw-r--r--v4.0/src/CMD/FDISK/VDISPLAY.C180
1 files changed, 180 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/VDISPLAY.C b/v4.0/src/CMD/FDISK/VDISPLAY.C
new file mode 100644
index 0000000..41b6285
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/VDISPLAY.C
@@ -0,0 +1,180 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "string.h"
8#include "stdio.h"
9#include "memory.h"
10
11/* */
12char volume_display()
13
14BEGIN
15
16unsigned i;
17unsigned x;
18char drive_found;
19char drive_letter;
20char drive_num;
21char temp;
22char first_display;
23char second_display;
24char third_display;
25char fourth_display;
26unsigned insert_offset;
27
28 first_display = FALSE;
29 second_display = FALSE;
30 third_display = FALSE;
31 fourth_display = FALSE;
32
33 /* See what the starting drive letter is */
34 drive_letter = c(SEA); /* AC000 */
35
36 /* See if primary on drive 1 */
37 temp = cur_disk;
38 cur_disk = c(0); /* AC000 */
39 if ( (find_partition_type(uc(DOS12))) ||
40 (find_partition_type(uc(DOS16))) ||
41 (find_partition_type(uc(DOSNEW)))) /* AC000 */
42 BEGIN
43 /* There is a Primary partition on drive 1, so increment for first logical drive */
44 drive_letter++;
45 END
46 cur_disk = temp;
47
48 /* See if there is a second drive */
49 if (number_of_drives == uc(2)) /* AC000 */
50 BEGIN
51
52 /* Go see if DOS partition on drive 2 */
53 temp = cur_disk;
54 cur_disk = c(1); /* AC000 */
55 if ( (find_partition_type(uc(DOS12))) ||
56 (find_partition_type(uc(DOS16))) ||
57 (find_partition_type(uc(DOSNEW)))) /*AC000*/
58 BEGIN
59
60 /* There is a Primary partition on drive 2, so increment for first logical drive */
61 drive_letter++;
62 END
63 /* Are we on drive 2? If so, we got to find all the drives on drive 1 */
64 if (temp == c(1)) /* AC000 */
65 BEGIN
66 /* Next, we need to see what is on drive 1 */
67 for (i=u(0); i < u(23); i++) /* AC000 */
68 BEGIN
69 /* See if there is a logical drive we understand in PC-DOS land */
70 if ( (ext_table[0][i].sys_id == uc(DOS12)) ||
71 (ext_table[0][i].sys_id == uc(DOS16)) ||
72 (ext_table[0][i].sys_id == uc(DOSNEW)) ) /* AC000 */
73 BEGIN
74 /* Found one, so kick up the first available drive letter */
75 drive_letter++;
76 END
77 END
78 END
79
80 /* Reset the cur_drive to where it was */
81 cur_disk = temp;
82 END
83
84
85
86
87 /* loop thru the partitions, only print stuff if it is there */
88
89 /* Get the drives in order by location on disk */
90 sort_ext_table(c(23)); /* AC000 */
91
92 /* initialize all the inserts to blanks */
93 memset(insert,c(' '),(24*29));
94
95 drive_num = c(0); /* AC000 */
96 drive_found = FALSE;
97 first_display = TRUE;
98 insert_offset = 0;
99
100 for (i=u(0); i < u(23); i++) /* AC000 */
101 BEGIN
102
103 /* See if entry exists */
104 if ( (ext_table[cur_disk][sort[i]].sys_id == uc(DOS12)) ||
105 (ext_table[cur_disk][sort[i]].sys_id == uc(DOS16)) ||
106 (ext_table[cur_disk][sort[i]].sys_id == uc(DOSNEW)) ) /* AC000 */
107 BEGIN
108
109 /* We found one, now get the info */
110 drive_found = TRUE;
111
112 /* Get the drive letter - make sure it is Z: or less*/
113 /* Put it in the message, and set it up for next time */
114 if (drive_letter > c('Z'))
115 ext_table[cur_disk][sort[i]].drive_letter = c(' ');
116 else ext_table[cur_disk][sort[i]].drive_letter = drive_letter;
117
118 insert_offset += sprintf(&insert[insert_offset],"%c%c%-11.11s%4.0d%-8.8s%3.0d%%",
119 ext_table[cur_disk][sort[i]].drive_letter,
120 ( ext_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':',
121 ext_table[cur_disk][sort[i]].vol_label,
122 ext_table[cur_disk][sort[i]].mbytes_used,
123 ext_table[cur_disk][sort[i]].system,
124 ext_table[cur_disk][sort[i]].percent_used );
125
126
127 drive_letter++;
128 drive_num++;
129
130 END
131 END
132
133 /* Display the column of drives */
134 if (drive_found)
135 BEGIN
136
137 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
138
139 if ( drive_num > 0 )
140 BEGIN
141 pinsert = &insert[0];
142 display(menu_19);
143 END
144
145 if ( drive_num > 6 )
146 BEGIN
147 pinsert = &insert[6*29];
148 display(menu_43);
149 END
150
151 if ( drive_num > 12 )
152 BEGIN
153 pinsert = &insert[12*29];
154 display(menu_20);
155 END
156
157 if ( drive_num > 18 )
158 BEGIN
159 pinsert = &insert[18*29];
160 display(menu_44);
161 END
162 pinsert = &insert[0];
163 END
164 else
165 BEGIN
166 /* Didn't find any */
167 if (first_display)
168 BEGIN
169 /* Wipe out display and put up message */
170 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
171 display(status_9);
172 END
173 END
174 /* Return the highest drive letter found */
175 drive_letter--;
176 return(drive_letter);
177
178END
179
180 \ No newline at end of file