3 #include "dos.h" /* AN000 */
4 #include "fdisk.h" /* AN000 */
5 #include "subtype.h" /* AN000 */
6 #include "stdio.h" /* AN000 */
7 #include "extern.h" /* AN000 */
8 #include "doscall.h" /* AN000 */
9 #include "fdiskmsg.h" /* AN000 */
10 #include "ctype.h" /* AN000 */
13 /******************* START OF SPECIFICATIONS *******************/
15 /* SUBROUTINE NAME: DISPLAY */
17 /* DESCRIPTIVE NAME: Display full screen interface messages */
19 /* FUNCTION: Displays messages and handles control characters */
23 /* Portions of the screen that are handled in the msg are */
24 /* indicated on the listing of the screen with the message */
25 /* name given. If the text message is defined in another */
26 /* screen, then the name is followed by a "#" character */
28 /* NOTE TO TRANSLATORS The characters inside the <> and the [] */
29 /* are control characters and should not be translated. The */
30 /* Control characters are defined as follows: */
32 /* <H> - Highlight the following text */
33 /* <R> - Regular text */
34 /* <B> - Blink the following text */
35 /* <O> - Turn blinking off */
36 /* <Y> - Print YES character, as set by define */
37 /* <N> - Print NO character, as set by define */
38 /* <W> - Sound the beep */
39 /* <S> - Save cursor position for later use */
40 /* <I> - Insert character from insert[] string. This string */
41 /* must be set up prior to displaying the message. The */
42 /* first <I> will insert Insert[0], the second */
43 /* insert[1], etc....This will move the cursor one */
44 /* postition. The insert[] string will be initialized */
46 /* Multiple control characters can be between the <>. */
48 /* The ^####^indicates Row and column for the text and has the */
49 /* format of [rrcc] where the numbers are decimal and zero */
50 /* based (first row/col is 00. The numbers are in decimal, */
51 /* and must be 2 characters, which means rows/cols 0-9 should */
52 /* be listed as 00-09. For example, the 5th row, 3rd column */
53 /* on the screen would be listed as ^0402^. */
55 /* The column number is always the column desired. The row */
56 /* number is an offset from the previous row. For example, if */
57 /* the text just printed is on row 6, and the next text should */
58 /* be printed 2 rows down in column 0, then the control strin */
59 /* would be ^0201^. The first row specified in the message is */
60 /* assumed to be based off of row 0, it would actually specify */
61 /* the actual row for the start of the msg to be printed. */
63 /* ENTRY POINTS: display(*message_name); */
64 /* LINKAGE: Near call */
66 /* INPUT: char *message_name */
73 /* input_row changed if <S> control character in message */
74 /* input_col changed if <S> control character in message */
76 /* INTERNAL REFERENCES: */
79 /* EXTERNAL REFERENCES: */
82 /* viowrtcharstratt(); */
83 /******************** END OF SPECIFICATIONS ********************/
93 char far *attribute_ptr = &attribute;
94 unsigned insert_count;
97 /* Initialize row and col, and index into array */
98 row = u(0); /* AC000 */
99 col = u(0); /* AC000 */
100 insert_count = u(0); /* AC000 */
101 /* check for a request to display a null string */
102 if (*s == c('\0')) /* AC000 */
104 /* Message string error */
105 insert[0] = c('1'); /* AC000 */
110 /* There is data there, lets go handle it */
112 attribute = c(0x00); /* AC000 */
113 /* Go until end of string */
114 while (*s != c('\0')) /* AC000 */
117 /* Check for any imbedded control strings */
120 /* Check for control characters */
124 while ( (*s != c('>')) && (*s != c('\0')) ) /* AC000 */
128 case 'H': if (mono_flag == TRUE) /* AN006 */
129 attribute = (attribute & 0x80) | HIWHITE_ON_BLACK; /* AN006 */
131 attribute = (attribute & 0x80) | HIWHITE_ON_BLUE; /* AC006 */
135 case 'R': if (mono_flag == TRUE) /* AN006 */
136 attribute = (attribute & 0x80) | GRAY_ON_BLACK; /* AN006 */
138 attribute = (attribute & 0x80) | WHITE_ON_BLUE; /* AC006 */
141 case 'B': attribute |= 0x80;
144 case 'O': attribute &= 0x7F;
147 case 'W': DOSBEEP(u(900),u(400)); /* AC000 */
152 /* display next element in the array */
153 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
154 attribute = c(GRAY_ON_BLACK); /* AN006 */
155 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
156 attribute = c(WHITE_ON_BLUE); /* AC006 */
157 VIOWRTCHARSTRATT(pinsert+insert_count++,u(1),row,col++,attribute_ptr,u(0));
162 case 'Y': /* AC011 */
164 /* display YES character in next location */
165 *--s = c(Yes); /* AC000 */
166 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
167 attribute = c(GRAY_ON_BLACK); /* AN006 */
168 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
169 attribute = c(WHITE_ON_BLUE); /* AC006 */
170 VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
171 *s++ = c(Yes); /* AC000 AC011 */
175 case 'N': /* AC011 */
177 /* display NO character in next location */
178 *--s = c(No); /* AC000 */
179 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
180 attribute = c(GRAY_ON_BLACK); /* AN006 */
181 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
182 attribute = c(WHITE_ON_BLUE); /* AC006 */
183 VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
184 *s++ = c(No); /* AC000 AC011 */
199 /* Clear from current position to end of line */
200 clear_screen(row,col,row,u(79)); /* AC000 */
206 /* Message string error - string ended in the middle of control string*/
207 insert[0] = c('7'); /* AC000 */
214 /* Message string error - no valid control char found */
215 insert[0] = c('6'); /* AC000 */
221 /* Get the pointer past the '>' */
224 END /* control characters */
226 /* Check for row,col */
227 case '^': /* AC000 */
230 /* determine the row to put the message on */
233 /* Message string error */
234 insert[0] = c('2'); /* AC000 */
239 row = row+((unsigned)(((*s++ - '0')*10)));
242 /* Message string error */
243 insert[0] = c('2'); /* AC000 */
248 row = row+((unsigned)(*s++ - '0'));
249 /* determine the col to put the message on */
252 /* Message string error */
253 insert[0] = c('3'); /* AC000 */
258 col = ((unsigned)(*s++ - '0'));
261 /* Message string error */
262 insert[0] = c('3'); /* AC000 */
267 col = ((unsigned)((col* 10) + (*s++ - '0')));
268 if (*s++ != c('^')) /* AC000 */
270 /* Message string error */
271 insert[0] = c('4'); /* AC000 */
273 END /* 2nd sq bracket */
274 END /* 2nd digit col */
275 END /* 1st digit col */
276 END /* 2nd digit row */
277 END /* 1st digit row */
280 /* Handle anything else */
285 /* See if attribute set to anything */
286 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
287 attribute = c(WHITE_ON_BLUE); /* AC006 */
288 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
289 attribute = c(GRAY_ON_BLACK); /* AN006 */
290 VIOWRTCHARSTRATT(s++,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
294 END /* End of string check */
295 END /* No characters in string check */
302 void number_in_msg(number,start)
311 /* Divide the space down and get it into decimal */
312 sprintf(mbytes,"%4.0d",number);
313 insert[start+0] = mbytes[0];
314 insert[start+1] = mbytes[1];
315 insert[start+2] = mbytes[2];
316 insert[start+3] = mbytes[3];
324 void percent_in_msg(number,start) /* AN000 */
326 unsigned number; /* AN000 */
327 unsigned start; /* AN000 */
334 /* Divide the space down and get it into decimal */
335 sprintf(percent,"%3.0d%%",number); /* AC000 */
336 insert[start+0] = percent[0]; /* AC000 */
337 insert[start+1] = percent[1]; /* AC000 */
338 insert[start+2] = percent[2]; /* AC000 */
339 insert[start+3] = percent[3]; /* AC000 */
346 void string_in_msg(string_ptr,start) /* AN000 */
348 char far *string_ptr; /* AN000 */
349 unsigned start; /* AN000 */
353 unsigned i; /* AN000 */
355 /* init the 8 spots to blanks */
356 for (i = u(0); i < u(8);i++) /* AN000 */
358 insert[start+i] = c(' '); /* AN000 */
360 /* Put characters into the array */
362 insert[start+0] = *(string_ptr+0); /* AN000 */
363 insert[start+1] = *(string_ptr+1); /* AN000 */
364 insert[start+2] = *(string_ptr+2); /* AN000 */
365 insert[start+3] = *(string_ptr+3); /* AN000 */
366 insert[start+4] = *(string_ptr+4); /* AN000 */
367 insert[start+5] = *(string_ptr+5); /* AN000 */
368 insert[start+6] = *(string_ptr+6); /* AN000 */
369 insert[start+7] = *(string_ptr+7); /* AN000 */
376 void volume_in_msg(string_ptr,start) /* AN000 */
378 char far *string_ptr; /* AN000 */
379 unsigned start; /* AN000 */
383 unsigned i; /* AN000 */
385 /* init the 11 spots to blanks */
386 for (i = u(0); i < u(11);i++) /* AN000 */
388 insert[start+i] = c(' '); /* AN000 */
390 /* Put characters into the array */
392 insert[start+0] = *(string_ptr+0); /* AN000 */
393 insert[start+1] = *(string_ptr+1); /* AN000 */
394 insert[start+2] = *(string_ptr+2); /* AN000 */
395 insert[start+3] = *(string_ptr+3); /* AN000 */
396 insert[start+4] = *(string_ptr+4); /* AN000 */
397 insert[start+5] = *(string_ptr+5); /* AN000 */
398 insert[start+6] = *(string_ptr+6); /* AN000 */
399 insert[start+7] = *(string_ptr+7); /* AN000 */
400 insert[start+8] = *(string_ptr+8); /* AN000 */
401 insert[start+9] = *(string_ptr+9); /* AN000 */
402 insert[start+10] = *(string_ptr+10); /* AN000 */