diff options
Diffstat (limited to 'v4.0/src/CMD/FDISK/MESSAGES.C')
| -rw-r--r-- | v4.0/src/CMD/FDISK/MESSAGES.C | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/MESSAGES.C b/v4.0/src/CMD/FDISK/MESSAGES.C new file mode 100644 index 0000000..a375145 --- /dev/null +++ b/v4.0/src/CMD/FDISK/MESSAGES.C | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | |||
| 2 | #include "dos.h" /* AN000 */ | ||
| 3 | #include "msgret.h" /* AN000 */ | ||
| 4 | #include "fdisk.h" /* AN000 */ | ||
| 5 | #include "extern.h" /* AN000 */ | ||
| 6 | #include "subtype.h" /* AN000 */ | ||
| 7 | #include "stdio.h" /* AN000 */ | ||
| 8 | |||
| 9 | /* */ | ||
| 10 | /******************************************************************************/ | ||
| 11 | /*Routine name: PRELOAD_MESSAGES */ | ||
| 12 | /******************************************************************************/ | ||
| 13 | /* */ | ||
| 14 | /*Description: Preloads messages for Display_Msg and returns error code */ | ||
| 15 | /* if incorrect DOS version, insuffient memory, or unable to */ | ||
| 16 | /* to find messages. */ | ||
| 17 | /* */ | ||
| 18 | /*Called Procedures: sysloadmsg */ | ||
| 19 | /* display_msg */ | ||
| 20 | /* */ | ||
| 21 | /*Change History: Created 5/30/87 DRM */ | ||
| 22 | /* */ | ||
| 23 | /*Input: None */ | ||
| 24 | /* */ | ||
| 25 | /*Output: None */ | ||
| 26 | /* */ | ||
| 27 | /******************************************************************************/ | ||
| 28 | |||
| 29 | |||
| 30 | char preload_messages() /* AN000 */ | ||
| 31 | |||
| 32 | BEGIN /* AN000 */ | ||
| 33 | |||
| 34 | char message_flag; /* AN000 */ | ||
| 35 | |||
| 36 | /* load all messages for FDISK */ | ||
| 37 | message_flag = c(TRUE); /* AN000 */ | ||
| 38 | sysloadmsg(®s,®s); /* AN000 load the messages */ | ||
| 39 | |||
| 40 | if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 If msg load problem */ | ||
| 41 | BEGIN | ||
| 42 | sysdispmsg(®s,®s); /* AN000 write the error message */ | ||
| 43 | message_flag = FALSE; /* AN000 */ | ||
| 44 | END | ||
| 45 | return(message_flag); /* AN000 */ | ||
| 46 | |||
| 47 | END /* AN000 */ | ||
| 48 | |||
| 49 | /* */ | ||
| 50 | /*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ | ||
| 51 | /* */ | ||
| 52 | /* Subroutine Name: display_msg */ | ||
| 53 | /* */ | ||
| 54 | /* Subroutine Function: */ | ||
| 55 | /* Display the requested message to the standard output device */ | ||
| 56 | /* */ | ||
| 57 | /* Input: */ | ||
| 58 | /* (1) Number of the message to be displayed (see FDISK.SKL) */ | ||
| 59 | /* (2) Number of substitution parameters (%1,%2) */ | ||
| 60 | /* (3) Offset of sublist control block */ | ||
| 61 | /* (4) Message Class, 0=no input, 1=input via INT 21 AH=1 */ | ||
| 62 | /* */ | ||
| 63 | /* Output: */ | ||
| 64 | /* The message is written to the standard output device. If input */ | ||
| 65 | /* was requested, the character code of the key pressed is returned */ | ||
| 66 | /* in regs.x.ax. */ | ||
| 67 | /* */ | ||
| 68 | /* Normal exit: Message written to handle */ | ||
| 69 | /* */ | ||
| 70 | /* Error exit: None */ | ||
| 71 | /* */ | ||
| 72 | /* Internal References: */ | ||
| 73 | /* None */ | ||
| 74 | /* */ | ||
| 75 | /* External References: */ | ||
| 76 | /* Sysdispmsg (module _msgret.sal) */ | ||
| 77 | /* */ | ||
| 78 | /*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/ | ||
| 79 | |||
| 80 | void display_msg(msgnum,msghan,msgparms,msgsub,msginput,msgclass) /*;AN000 AC014; */ | ||
| 81 | int msgnum; /*;AN000; message number */ | ||
| 82 | int msghan; /*;AN000; output device */ | ||
| 83 | int msgparms; /*;AN000; number of substitution parms*/ | ||
| 84 | int *msgsub; /*;AN000; offset of sublist */ | ||
| 85 | char msginput; /*;AN000; 0=no input, else input func */ | ||
| 86 | char msgclass; /*;AN014; 0=no input, else input func */ | ||
| 87 | |||
| 88 | BEGIN | ||
| 89 | regs.x.ax = u(msgnum); /*;AN000; set registers */ | ||
| 90 | regs.x.bx = u(msghan); /*;AN000; */ | ||
| 91 | regs.x.cx = u(msgparms); /*;AN000; */ | ||
| 92 | regs.h.dh = uc(msgclass); /*;AN014; */ | ||
| 93 | regs.h.dl = uc(msginput); /*;AN000; */ | ||
| 94 | regs.x.si = u(msgsub); /*;AN000; */ | ||
| 95 | sysdispmsg(®s,®s); /*;AN000; write the messages */ | ||
| 96 | |||
| 97 | return; /*;AN000; */ | ||
| 98 | END | ||
| 99 | |||
| 100 | /* */ | ||
| 101 | /******************************************************************************/ | ||
| 102 | /*Routine name: GET_YES_NO_VALUES */ | ||
| 103 | /******************************************************************************/ | ||
| 104 | /* */ | ||
| 105 | /*Description: Uses SYSGETMSG to get the translated values for Y and N */ | ||
| 106 | /* for display purposes. */ | ||
| 107 | /* */ | ||
| 108 | /*Called Procedures: sysgetmsg */ | ||
| 109 | /* sysdispmsg */ | ||
| 110 | /* */ | ||
| 111 | /*Change History: Created 5/11/88 DRM */ | ||
| 112 | /* */ | ||
| 113 | /*Input: None */ | ||
| 114 | /* */ | ||
| 115 | /*Output: None */ | ||
| 116 | /* */ | ||
| 117 | /******************************************************************************/ | ||
| 118 | |||
| 119 | |||
| 120 | char get_yes_no_values() /* AN012 */ | ||
| 121 | |||
| 122 | BEGIN /* AN012 */ | ||
| 123 | |||
| 124 | char message_flag; /* AN012 */ | ||
| 125 | char far *msg_buff; /* AN012 */ | ||
| 126 | |||
| 127 | message_flag = c(TRUE); /* AN012 */ | ||
| 128 | |||
| 129 | /* do sysgetmsg for 'Y' */ | ||
| 130 | regs.x.ax = YesMsg; /* AN012 */ | ||
| 131 | regs.h.dh = uc(utility_msg_class); /* AN012 */ | ||
| 132 | sysgetmsg(®s,&segregs,®s); /* AN012 */ | ||
| 133 | |||
| 134 | FP_OFF(msg_buff) = regs.x.si; /* AN012 */ | ||
| 135 | FP_SEG(msg_buff) = segregs.ds; /* AN012 */ | ||
| 136 | |||
| 137 | Yes = *msg_buff; /* AN012 */ | ||
| 138 | |||
| 139 | if ((regs.x.cflag & CARRY_FLAG) != CARRY_FLAG) /* AN012 If msg load problem */ | ||
| 140 | BEGIN /* AN012 */ | ||
| 141 | /* do sysgetmsg for 'N' */ | ||
| 142 | regs.x.ax = NoMsg; /* AN012 */ | ||
| 143 | regs.h.dh = uc(utility_msg_class); /* AN012 */ | ||
| 144 | sysgetmsg(®s,&segregs,®s); /* AN012 */ | ||
| 145 | |||
| 146 | FP_OFF(msg_buff) = regs.x.si; /* AN012 */ | ||
| 147 | FP_SEG(msg_buff) = segregs.ds; /* AN012 */ | ||
| 148 | |||
| 149 | No = *msg_buff; /* AN012 */ | ||
| 150 | |||
| 151 | END /* AN012 */ | ||
| 152 | |||
| 153 | if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN012 If msg load problem */ | ||
| 154 | BEGIN /* AN012 */ | ||
| 155 | sysdispmsg(®s,®s); /* AN012 write the error message */ | ||
| 156 | message_flag = FALSE; /* AN012 */ | ||
| 157 | END /* AN012 */ | ||
| 158 | |||
| 159 | return(message_flag); /* AN012 */ | ||
| 160 | |||
| 161 | END /* AN012 */ | ||
| 162 | |||