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 */
20 char *ThisPartitionType;
21 char ThisPartitionLetter[3];
25 /* initialize all the inserts to blanks */
26 memset(insert,c(' '),4*21);
29 /* Sort the partitions */
30 sort_part_table(c(4)); /* AC000 */
32 /* loop thru the partitions, only print stuff if it is there */
33 partition_found = FALSE;
34 partition_num = c(0); /* AC000 */
36 for (i=u(0); i < u(4); i++) /* AC000 */
39 if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
42 partition_found = TRUE;
44 strcpy(ThisPartitionLetter," ");
45 switch(part_table[cur_disk][sort[i]].sys_id)
47 case DOSNEW: /* AN000 */
50 ThisPartitionType = DOS_part;
51 part_table[cur_disk][sort[i]].drive_letter = table_drive_letter(); /* AN000 */
52 sprintf(ThisPartitionLetter,"%c%c",
53 part_table[cur_disk][sort[i]].drive_letter,
54 ( part_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':');
57 ThisPartitionType = EXTENDED_part;
60 ThisPartitionType = BAD_BLOCK_part;
63 ThisPartitionType = XENIX_part;
66 ThisPartitionType = XENIX_part;
69 ThisPartitionType = PCIX_part;
72 ThisPartitionType = NON_DOS_part;
76 io += sprintf(&insert[io],"%-2.2s%c%c%-7.7s%4.0d%3.0d%%",
79 (part_table[cur_disk][sort[i]].boot_ind == uc(0x80)) ? 'A' : ' ',
81 part_table[cur_disk][sort[i]].mbytes_used,
82 part_table[cur_disk][sort[i]].percent_used);
90 /* Do a clearscreen to erase previous data */
91 clear_screen(u(8),u(0),u(12),u(79)); /* AC000 */
93 if (partition_found) display(menu_14);
94 else display(status_8);
96 /* Return true if partitions exist, false otherwise */
97 if (partition_found) return(TRUE);
104 char table_drive_letter()
109 /* Put in drive letter in display */
110 if (cur_disk == c(0)) /* AC000 */
112 /* There is a primary partition on 80h, so drive C: */
113 drive_letter = c('C'); /* AC000 */
117 /* We are on drive 81h, so assume D: */
118 drive_letter = c('D'); /* AC000 */
120 /* See if primary exists on 80h drive */
121 /* First, set cur_drive to 0 */
122 cur_disk = c(0); /* AC000 */
124 /* Check for primary on drive 80h */
125 if (!(find_partition_type(uc(DOS12)) || find_partition_type(uc(DOS16)) || find_partition_type(uc(DOSNEW)))) /* AC000 */
127 drive_letter = c('C'); /* AC000 */
129 /* restore cur_disk to normal */
130 cur_disk = c(1); /* AC000 */
132 return(drive_letter);