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 */
26 unsigned insert_offset;
28 first_display = FALSE;
29 second_display = FALSE;
30 third_display = FALSE;
31 fourth_display = FALSE;
33 /* See what the starting drive letter is */
34 drive_letter = c(SEA); /* AC000 */
36 /* See if primary on drive 1 */
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 */
43 /* There is a Primary partition on drive 1, so increment for first logical drive */
48 /* See if there is a second drive */
49 if (number_of_drives == uc(2)) /* AC000 */
52 /* Go see if DOS partition on drive 2 */
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*/
60 /* There is a Primary partition on drive 2, so increment for first logical drive */
63 /* Are we on drive 2? If so, we got to find all the drives on drive 1 */
64 if (temp == c(1)) /* AC000 */
66 /* Next, we need to see what is on drive 1 */
67 for (i=u(0); i < u(23); i++) /* AC000 */
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 */
74 /* Found one, so kick up the first available drive letter */
80 /* Reset the cur_drive to where it was */
87 /* loop thru the partitions, only print stuff if it is there */
89 /* Get the drives in order by location on disk */
90 sort_ext_table(c(23)); /* AC000 */
92 /* initialize all the inserts to blanks */
93 memset(insert,c(' '),(24*29));
95 drive_num = c(0); /* AC000 */
100 for (i=u(0); i < u(23); i++) /* AC000 */
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 */
109 /* We found one, now get the info */
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;
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 );
133 /* Display the column of drives */
137 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
141 pinsert = &insert[0];
147 pinsert = &insert[6*29];
151 if ( drive_num > 12 )
153 pinsert = &insert[12*29];
157 if ( drive_num > 18 )
159 pinsert = &insert[18*29];
162 pinsert = &insert[0];
166 /* Didn't find any */
169 /* Wipe out display and put up message */
170 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
174 /* Return the highest drive letter found */
176 return(drive_letter);