summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/FDISK/PROFILE.C
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/FDISK/PROFILE.C')
-rw-r--r--v4.0/src/CMD/FDISK/PROFILE.C802
1 files changed, 802 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/PROFILE.C b/v4.0/src/CMD/FDISK/PROFILE.C
new file mode 100644
index 0000000..5bee0a5
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PROFILE.C
@@ -0,0 +1,802 @@
1
2#include <doscall.h>
3#include <profile.h>
4#include <fdiskc.msg>
5#include <subtype.h>
6#include <ctype.h>
7
8
9void main()
10
11BEGIN
12
13unsigned i;
14
15 /* Main Menu */
16 clear_screen(0,0,24,79);
17 display(menu_1);
18 display(menu_2);
19 display(menu_3);
20 display(menu_4);
21 insert[0] = 'C';
22 display(menu_5);
23 display(menu_6);
24 display(menu_7);
25
26 wait_for_ESC();
27
28
29 /* Type of DOS partition for create */
30 clear_screen(0,0,24,39);
31 display(menu_3);
32 insert[0] = 'C';
33 display(menu_5);
34 display(menu_7);
35 display(menu_8);
36 display(menu_9);
37 display(menu_10);
38 display(menu_11);
39 wait_for_ESC();
40
41 /* Shortcut screen C:*/
42 clear_screen(0,0,24,39);
43 display(menu_12);
44 insert[0] = 'C';
45 display(menu_5);
46 display(menu_11);
47 display(menu_12);
48 display(menu_13);
49 wait_for_ESC();
50
51 /* Shortcut screen D:*/
52 clear_screen(0,0,24,39);
53 display(menu_12);
54 insert[0] = 'C';
55 display(menu_5);
56 display(menu_11);
57 display(menu_12);
58 display(menu_41);
59 wait_for_ESC();
60
61
62/* Create primary DOS partition screen */
63 display(menu_12);
64 insert[0] = 'C';
65 display(menu_5);
66 for (i=0;i < 92;i++)
67 BEGIN
68 insert[i] = 'x';
69 END
70 display(menu_14);
71 insert[0] = 'x';
72 insert[1] = 'x';
73 insert[2] = 'x';
74 insert[3] = 'x';
75 display(menu_15);
76 insert[0] = 'x';
77 insert[1] = 'x';
78 insert[2] = 'x';
79 insert[3] = 'x';
80 display(menu_16);
81 insert[0] = 'x';
82 insert[1] = 'x';
83 insert[2] = 'x';
84 insert[3] = 'x';
85 display(menu_39);
86 display(menu_11);
87 wait_for_ESC();
88
89/* Create Extended Partition */
90 clear_screen(0,0,24,39);
91 display(menu_17);
92 insert[0] = 'C';
93 display(menu_5);
94 for (i=0;i < 92;i++)
95 BEGIN
96 insert[i] = 'x';
97 END
98 display(menu_14);
99 insert[0] = 'x';
100 insert[1] = 'x';
101 insert[2] = 'x';
102 insert[3] = 'x';
103 display(menu_15);
104 insert[0] = 'x';
105 insert[1] = 'x';
106 insert[2] = 'x';
107 insert[3] = 'x';
108 display(menu_16);
109 display(menu_39);
110 display(menu_11);
111 wait_for_ESC();
112
113
114/* Create logical drive screen */
115 clear_screen(0,0,24,39);
116 display(menu_18);
117 for (i=0;i < 168;i++)
118 BEGIN
119 insert[i]= 'x';
120 END
121 display(menu_19);
122 for (i=0;i < 168;i++)
123 BEGIN
124 insert[i]= 'x';
125 END
126 display(menu_20);
127 insert[0] = 'x';
128 insert[1] = 'x';
129 insert[2] = 'x';
130 insert[3] = 'x';
131 display(menu_21);
132 insert[0] = 'x';
133 insert[1] = 'x';
134 insert[2] = 'x';
135 insert[3] = 'x';
136 display(menu_22);
137 insert[0] = 'x';
138 insert[1] = 'x';
139 insert[2] = 'x';
140 insert[3] = 'x';
141 display(menu_40);
142 display(menu_11);
143 wait_for_ESC();
144
145
146/* Change active partition screen */
147 clear_screen(0,0,24,39);
148 display(menu_23);
149 insert[0] = 'C';
150 display(menu_5);
151 for (i=0;i < 92;i++)
152 BEGIN
153 insert[i] = 'x';
154 END
155 display(menu_14);
156 insert[0] = 'x';
157 insert[1] = 'x';
158 insert[2] = 'x';
159 insert[3] = 'x';
160 display(menu_15);
161 display(menu_24);
162 display(menu_11);
163 wait_for_ESC();
164
165
166/* Delete Partition Screen */
167 clear_screen(0,0,24,39);
168 display(menu_25);
169 insert[0] = 'C';
170 display(menu_5);
171 display(menu_3);
172 display(menu_26);
173 display(menu_27);
174 display(menu_7);
175 display(menu_11);
176 wait_for_ESC();
177
178/* Delete Primary Screen */
179 clear_screen(0,0,24,39);
180 display(menu_28);
181 insert[0] = 'C';
182 display(menu_5);
183 for (i=0;i < 92;i++)
184 BEGIN
185 insert[i] = 'x';
186 END
187 display(menu_14);
188 insert[0] = 'x';
189 insert[1] = 'x';
190 insert[2] = 'x';
191 insert[3] = 'x';
192 display(menu_15);
193 display(menu_29);
194 display(menu_11);
195 wait_for_ESC();
196
197
198/* Delete Extended Screen */
199 clear_screen(0,0,24,39);
200 display(menu_30);
201 insert[0] = 'C';
202 display(menu_5);
203 for (i=0;i<92;i++)
204 BEGIN
205 insert[i] = 'x';
206 END
207 display(menu_14);
208 insert[0] = 'x';
209 insert[1] = 'x';
210 insert[2] = 'x';
211 insert[3] = 'x';
212 display(menu_15);
213 display(menu_31);
214 display(menu_11);
215 wait_for_ESC();
216
217
218/* Delete Logical Drives */
219 clear_screen(0,0,24,39);
220 display(menu_32);
221 display(menu_18);
222 for (i=0;i<168;i++)
223 BEGIN
224 insert[i]='x';
225 END
226 display(menu_19);
227 insert[0] = 'x';
228 insert[1] = 'x';
229 insert[2] = 'x';
230 insert[3] = 'x';
231 display(menu_21);
232 display(menu_33);
233 display(menu_11);
234 wait_for_ESC();
235
236/* Display Partition Information */
237 clear_screen(0,0,24,39);
238 display(menu_35);
239 insert[0] = 'C';
240 display(menu_5);
241 for (i=0;i<92;i++)
242 BEGIN
243 insert[i] = 'x';
244 END
245 display(menu_14);
246 insert[0] = 'x';
247 insert[1] = 'x';
248 insert[2] = 'x';
249 insert[3] = 'x';
250 display(menu_15);
251 display(menu_36);
252 display(menu_11);
253 wait_for_ESC();
254
255/* Display Logical Drive Info */
256 clear_screen(0,0,24,39);
257 display(menu_37);
258 for (i=0;i<168;i++)
259 BEGIN
260 insert[i]='x';
261 END
262 display(menu_19);
263 for (i=0;i<168;i++)
264 BEGIN
265 insert[i]='x';
266 END
267 display(menu_20);
268 display(menu_11);
269 wait_for_ESC();
270
271/* Reboot Screen */
272 clear_screen(0,0,24,39);
273 display(menu_38);
274 wait_for_ESC();
275
276 clear_screen(0,0,24,39);
277 display(status_1);
278 wait_for_ESC();
279
280 clear_screen(0,0,24,39);
281 display(status_2);
282 wait_for_ESC();
283
284 clear_screen(0,0,24,39);
285 display(status_3);
286 wait_for_ESC();
287
288 clear_screen(0,0,24,39);
289 insert[0] = 'x';
290 display(status_4);
291 wait_for_ESC();
292
293 clear_screen(0,0,24,39);
294 display(status_5);
295 wait_for_ESC();
296
297 clear_screen(0,0,24,39);
298 display(status_6);
299 wait_for_ESC();
300
301 clear_screen(0,0,24,39);
302 display(status_7);
303 wait_for_ESC();
304
305 clear_screen(0,0,24,39);
306 display(status_8);
307 wait_for_ESC();
308
309 clear_screen(0,0,24,39);
310 display(status_9);
311 wait_for_ESC();
312
313 clear_screen(0,0,24,39);
314 display(status_10);
315 wait_for_ESC();
316
317 clear_screen(0,0,24,39);
318 display(error_1);
319 wait_for_ESC();
320
321 clear_screen(0,0,24,39);
322 display(error_2);
323 wait_for_ESC();
324
325 clear_screen(0,0,24,39);
326 display(error_3);
327 wait_for_ESC();
328
329 clear_screen(0,0,24,39);
330 display(error_4);
331 wait_for_ESC();
332
333 clear_screen(0,0,24,39);
334 display(error_5);
335 wait_for_ESC();
336
337 clear_screen(0,0,24,39);
338 display(error_6);
339 wait_for_ESC();
340
341 clear_screen(0,0,24,39);
342 display(error_7);
343 wait_for_ESC();
344
345 clear_screen(0,0,24,39);
346 display(error_8);
347 wait_for_ESC();
348
349 clear_screen(0,0,24,39);
350 display(error_9);
351 wait_for_ESC();
352
353 clear_screen(0,0,24,39);
354 display(error_10);
355 wait_for_ESC();
356
357 clear_screen(0,0,24,39);
358 display(error_12);
359 wait_for_ESC();
360
361 clear_screen(0,0,24,39);
362 display(error_13);
363 wait_for_ESC();
364
365 clear_screen(0,0,24,39);
366 display(error_14);
367 wait_for_ESC();
368
369 clear_screen(0,0,24,39);
370 display(error_15);
371 wait_for_ESC();
372
373 clear_screen(0,0,24,39);
374 display(error_16);
375 wait_for_ESC();
376
377 clear_screen(0,0,24,39);
378 display(error_17);
379 wait_for_ESC();
380
381 clear_screen(0,0,24,39);
382 display(error_19);
383 wait_for_ESC();
384
385 clear_screen(0,0,24,39);
386 display(error_20);
387 wait_for_ESC();
388
389 clear_screen(0,0,24,39);
390 display(error_21);
391 wait_for_ESC();
392
393 clear_screen(0,0,24,39);
394 display(error_22);
395 wait_for_ESC();
396
397 clear_screen(0,0,24,39);
398 insert[0]='x';
399 insert[1]='y';
400 insert[2]='-';
401 insert[3]='z';
402 display(error_23);
403 wait_for_ESC();
404
405 clear_screen(0,0,24,39);
406 display(error_24);
407 wait_for_ESC();
408
409 clear_screen(0,0,24,39);
410 display(error_25);
411 wait_for_ESC();
412
413 clear_screen(0,0,24,39);
414 display(error_26);
415 wait_for_ESC();
416
417 clear_screen(0,0,24,39);
418 display(error_27);
419 wait_for_ESC();
420
421 clear_screen(0,0,24,39);
422 display(error_28);
423 wait_for_ESC();
424
425 clear_screen(0,0,24,39);
426 insert[0]='X';
427 insert[1]=':';
428 display(error_29);
429 wait_for_ESC();
430
431 clear_screen(0,0,24,39);
432 insert[0]='X';
433 display(error_30);
434 wait_for_ESC();
435
436 clear_screen(0,0,24,39);
437 insert[0]='x';
438 insert[1]='-';
439 insert[2]='y';
440 display(error_31);
441 wait_for_ESC();
442
443 clear_screen(0,0,24,39);
444 display(error_32);
445 wait_for_ESC();
446
447 clear_screen(0,0,24,39);
448 DOSEXIT(0,0);
449
450END
451
452
453/******************* START OF SPECIFICATIONS *******************/
454/* */
455/* SUBROUTINE NAME: DISPLAY */
456/* */
457/* DESCRIPTIVE NAME: Display full screen interface messages */
458/* */
459/* FUNCTION: Displays messages and handles control characters */
460/* */
461/* NOTES: */
462/* FDISK MESSAGES */
463/* Portions of the screen that are handled in the msg are */
464/* indicated on the listing of the screen with the message */
465/* name given. If the text message is defined in another */
466/* screen, then the name is followed by a "#" character */
467/* */
468/* NOTE TO TRANSLATORS The characters inside the <> and the [] */
469/* are control characters and should not be translated. The */
470/* Control characters are defined as follows: */
471/* */
472/* <H> - Highlight the following text */
473/* <R> - Regular text */
474/* <B> - Blink the following text */
475/* <O> - Turn blinking off */
476/* <Y> - Print YES character, as set by define */
477/* <N> - Print NO character, as set by define */
478/* <W> - Sound the beep */
479/* <S> - Save cursor position for later use */
480/* <I> - Insert character from insert[] string. This string */
481/* must be set up prior to displaying the message. The */
482/* first <I> will insert Insert[0], the second */
483/* insert[1], etc....This will move the cursor one */
484/* postition. The insert[] string will be initialized */
485/* */
486/* Multiple control characters can be between the <>. */
487/* */
488/* The %####%indicates Row and column for the text and has the */
489/* format of [rrcc] where the numbers are decimal and zero */
490/* based (first row/col is 00. The numbers are in decimal, */
491/* and must be 2 characters, which means rows/cols 0-9 should */
492/* be listed as 00-09. For example, the 5th row, 3rd column */
493/* on the screen would be listed as %0402%. */
494/* */
495/* The column number is always the column desired. The row */
496/* number is an offset from the previous row. For example, if */
497/* the text just printed is on row 6, and the next text should */
498/* be printed 2 rows down in column 0, then the control strin */
499/* would be %0201%. The first row specified in the message is */
500/* assumed to be based off of row 0, it would actually specify */
501/* the actual row for the start of the msg to be printed. */
502/* */
503/* ENTRY POINTS: display(*message_name); */
504/* LINKAGE: Near call */
505/* */
506/* INPUT: char *message_name */
507/* */
508/* EXIT-NORMAL: */
509/* */
510/* EXIT-ERROR: */
511/* */
512/* EFFECTS: */
513/* input_row changed if <S> control character in message */
514/* input_col changed if <S> control character in message */
515/* */
516/* INTERNAL REFERENCES: */
517/* ROUTINES: */
518/* */
519/* EXTERNAL REFERENCES: */
520/* ROUTINES: */
521/* */
522/* viowrtcharstratt(); */
523/******************** END OF SPECIFICATIONS ********************/
524void display(s)
525
526char far *s;
527
528BEGIN
529 unsigned row;
530 unsigned col;
531 char attribute;
532 char far *attribute_ptr = &attribute;
533 unsigned insert_count;
534
535
536 /* Initialize row and col, and index into array */
537 row = 0;
538 col = 0;
539 insert_count = 0;
540 /* check for a request to display a null string */
541 if (*s == '\0')
542 BEGIN
543 /* Message string error */
544 insert[0] = '1';
545 display(debug_msg);
546 END
547 else
548 BEGIN
549 /* There is data there, lets go handle it */
550
551 attribute = 0x00;
552 /* Go until end of string */
553 while (*s != '\0')
554 BEGIN
555
556 /* Check for any imbedded control strings */
557 switch (*s)
558 BEGIN
559 /* Check for control characters */
560 case '<':
561 BEGIN
562 s++;
563 while ( (*s != '>') && (*s != '\0') )
564 BEGIN
565 switch (*s++)
566 BEGIN
567 case 'H': attribute = (attribute & 0x80) | 0x0F;
568 break;
569
570
571 case 'R': attribute = (attribute & 0x80) | 0x07;
572 break;
573
574 case 'B': attribute |= 0x80;
575 break;
576
577 case 'O': attribute &= 0x7F;
578 break;
579
580 case 'W': DOSBEEP(900,400);
581 break;
582
583 case 'I':
584 BEGIN
585 /* display next element in the array */
586 if (attribute == 0x00)
587 attribute = 0x07;
588 VIOWRTCHARSTRATT(pinsert+insert_count++,1,row,col++,attribute_ptr,0);
589 break;
590 END
591
592
593 case 'Y':
594 BEGIN
595 /* display YES character in next location */
596 *--s = YES;
597 if (attribute == 0x00)
598 attribute = 0x07;
599 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
600 break;
601 END
602
603 case 'N':
604 BEGIN
605 /* display NO character in next location */
606 *--s = NO;
607 if (attribute == 0x00)
608 attribute = 0x07;
609 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
610 break;
611 END
612
613
614 case 'S':
615 BEGIN
616 input_row = row;
617 input_col = col;
618 break;
619 END
620
621 case 'C':
622 BEGIN
623 /* Clear from current position to end of line */
624 clear_screen(row,col,row,39);
625 break;
626 END
627
628 case '\0':
629 BEGIN
630 /* Message string error - string ended in the middle of control string*/
631 insert[0] = '7';
632 display(debug_msg);
633 break;
634 END
635
636 default:
637 BEGIN
638 /* Message string error - no valid control char found */
639 insert[0] = '6';
640 display(debug_msg);
641 break;
642 END
643 END /* Switch */
644 END /* While */
645 /* Get the pointer past the '>' */
646 s++;
647 break;
648 END /* control characters */
649
650 /* Check for row,col */
651 case '%':
652 BEGIN
653 s++;
654 /* determine the row to put the message on */
655 if ( !isdigit(*s) )
656 BEGIN
657 /* Message string error */
658 insert[0] = '2';
659 display(debug_msg);
660 END
661 else
662 BEGIN
663 row = row+((unsigned)(((*s++ - '0')*10)));
664 if ( !isdigit(*s) )
665 BEGIN
666 /* Message string error */
667 insert[0] = '2';
668 display(debug_msg);
669 END
670 else
671 BEGIN
672 row = row+((unsigned)(*s++ - '0'));
673 /* determine the col to put the message on */
674 if ( !isdigit(*s) )
675 BEGIN
676 /* Message string error */
677 insert[0] = '3';
678 display(debug_msg);
679 END
680 else
681 BEGIN
682 col = ((unsigned)(*s++ - '0'));
683 if ( !isdigit(*s) )
684 BEGIN
685 /* Message string error */
686 insert[0] = '3';
687 display(debug_msg);
688 END
689 else
690 BEGIN
691 col = ((unsigned)((col* 10) + (*s++ - '0')));
692 if (*s++ != '%')
693 BEGIN
694 /* Message string error */
695 insert[0] = '4';
696 display(debug_msg);
697 END /* 2nd sq bracket */
698 END /* 2nd digit col */
699 END /* 1st digit col */
700 END /* 2nd digit row */
701 END /* 1st digit row */
702 break;
703 END
704 /* Handle anything else */
705
706
707 default:
708 BEGIN
709 /* See if attribute set to anything */
710 if (attribute == 0x00)
711 attribute = 0x07;
712 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
713 break;
714 END
715 END
716 END /* End of string check */
717 END /* No characters in string check */
718 return;
719
720END
721
722void number_in_msg(number,start)
723
724unsigned number;
725unsigned start;
726
727BEGIN
728
729unsigned i;
730
731 /* init the four spots to zero's */
732 for (i = 0; i < 4;i++)
733 BEGIN
734 insert[start+i] = ' ';
735 END
736 /* Divide the space down and get it into decimal */
737 if (number > 999)
738 BEGIN
739 insert[start] = ((char)(number/1000))+'0';
740 insert[start+1] = '0';
741 insert[start+2] = '0';
742 insert[start+3] = '0';
743 number = number%1000;
744 END
745 if (number > 99)
746 BEGIN
747 insert[start+1] = ((char)(number/100))+'0';
748 insert[start+2] = '0';
749 insert[start+3] = '0';
750 number = number%100;
751 END
752 if (number > 9)
753 BEGIN
754 insert[start+2] = ((char)(number/10))+'0';
755 insert[start+3] = '0';
756 number = number%10;
757 END
758 insert[start+3] = ((char)(number +'0'));
759 return;
760END
761
762
763
764void clear_screen(TopRow,LeftCol,BotRow,RightCol)
765
766unsigned TopRow;
767unsigned LeftCol;
768unsigned BotRow;
769unsigned RightCol;
770
771BEGIN
772
773char attribute;
774char *attribute_ptr = &attribute;
775
776 attribute = 0x07;
777 VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,0,attribute_ptr,0);
778 return;
779END
780
781
782
783char wait_for_ESC()
784
785BEGIN
786 char input;
787
788 while (input != ESC)
789 BEGIN
790 /* position the cursor at the end of the ESC prompt */
791 VIOSETCURPOS(24,39,0);
792
793 /* Get input */
794 KBDFLUSHBUFFER(0);
795 /*KBDCHARIN(input_data,0,0);*/
796 /*input = input_data->char_code;*/
797 input = ((char)(getch()));
798 END
799 return(ESC);
800END
801
802 \ No newline at end of file