1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
|
#include "dos.h" /* AN000 */
#include "fdisk.h" /* AN000 */
#include "subtype.h" /* AN000 */
#include "stdio.h" /* AN000 */
#include "extern.h" /* AN000 */
#include "doscall.h" /* AN000 */
#include "fdiskmsg.h" /* AN000 */
#include "ctype.h" /* AN000 */
/* */
/******************* START OF SPECIFICATIONS *******************/
/* */
/* SUBROUTINE NAME: DISPLAY */
/* */
/* DESCRIPTIVE NAME: Display full screen interface messages */
/* */
/* FUNCTION: Displays messages and handles control characters */
/* */
/* NOTES: */
/* FDISK MESSAGES */
/* Portions of the screen that are handled in the msg are */
/* indicated on the listing of the screen with the message */
/* name given. If the text message is defined in another */
/* screen, then the name is followed by a "#" character */
/* */
/* NOTE TO TRANSLATORS The characters inside the <> and the [] */
/* are control characters and should not be translated. The */
/* Control characters are defined as follows: */
/* */
/* <H> - Highlight the following text */
/* <R> - Regular text */
/* <B> - Blink the following text */
/* <O> - Turn blinking off */
/* <Y> - Print YES character, as set by define */
/* <N> - Print NO character, as set by define */
/* <W> - Sound the beep */
/* <S> - Save cursor position for later use */
/* <I> - Insert character from insert[] string. This string */
/* must be set up prior to displaying the message. The */
/* first <I> will insert Insert[0], the second */
/* insert[1], etc....This will move the cursor one */
/* postition. The insert[] string will be initialized */
/* */
/* Multiple control characters can be between the <>. */
/* */
/* The ^####^indicates Row and column for the text and has the */
/* format of [rrcc] where the numbers are decimal and zero */
/* based (first row/col is 00. The numbers are in decimal, */
/* and must be 2 characters, which means rows/cols 0-9 should */
/* be listed as 00-09. For example, the 5th row, 3rd column */
/* on the screen would be listed as ^0402^. */
/* */
/* The column number is always the column desired. The row */
/* number is an offset from the previous row. For example, if */
/* the text just printed is on row 6, and the next text should */
/* be printed 2 rows down in column 0, then the control strin */
/* would be ^0201^. The first row specified in the message is */
/* assumed to be based off of row 0, it would actually specify */
/* the actual row for the start of the msg to be printed. */
/* */
/* ENTRY POINTS: display(*message_name); */
/* LINKAGE: Near call */
/* */
/* INPUT: char *message_name */
/* */
/* EXIT-NORMAL: */
/* */
/* EXIT-ERROR: */
/* */
/* EFFECTS: */
/* input_row changed if <S> control character in message */
/* input_col changed if <S> control character in message */
/* */
/* INTERNAL REFERENCES: */
/* ROUTINES: */
/* */
/* EXTERNAL REFERENCES: */
/* ROUTINES: */
/* */
/* viowrtcharstratt(); */
/******************** END OF SPECIFICATIONS ********************/
/* */
void display(s)
char far *s;
BEGIN
unsigned row;
unsigned col;
char attribute;
char far *attribute_ptr = &attribute;
unsigned insert_count;
/* Initialize row and col, and index into array */
row = u(0); /* AC000 */
col = u(0); /* AC000 */
insert_count = u(0); /* AC000 */
/* check for a request to display a null string */
if (*s == c('\0')) /* AC000 */
BEGIN
/* Message string error */
insert[0] = c('1'); /* AC000 */
display(debug_msg);
END
else
BEGIN
/* There is data there, lets go handle it */
attribute = c(0x00); /* AC000 */
/* Go until end of string */
while (*s != c('\0')) /* AC000 */
BEGIN
/* Check for any imbedded control strings */
switch (*s)
BEGIN
/* Check for control characters */
case '<':
BEGIN
s++;
while ( (*s != c('>')) && (*s != c('\0')) ) /* AC000 */
BEGIN
switch (*s++)
BEGIN
case 'H': if (mono_flag == TRUE) /* AN006 */
attribute = (attribute & 0x80) | HIWHITE_ON_BLACK; /* AN006 */
else /* AN006 */
attribute = (attribute & 0x80) | HIWHITE_ON_BLUE; /* AC006 */
break;
case 'R': if (mono_flag == TRUE) /* AN006 */
attribute = (attribute & 0x80) | GRAY_ON_BLACK; /* AN006 */
else /* AN006 */
attribute = (attribute & 0x80) | WHITE_ON_BLUE; /* AC006 */
break;
case 'B': attribute |= 0x80;
break;
case 'O': attribute &= 0x7F;
break;
case 'W': DOSBEEP(u(900),u(400)); /* AC000 */
break;
case 'I':
BEGIN
/* display next element in the array */
if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
attribute = c(GRAY_ON_BLACK); /* AN006 */
if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
attribute = c(WHITE_ON_BLUE); /* AC006 */
VIOWRTCHARSTRATT(pinsert+insert_count++,u(1),row,col++,attribute_ptr,u(0));
break;
END
case 'Y': /* AC011 */
BEGIN
/* display YES character in next location */
*--s = c(Yes); /* AC000 */
if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
attribute = c(GRAY_ON_BLACK); /* AN006 */
if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
attribute = c(WHITE_ON_BLUE); /* AC006 */
VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
*s++ = c(Yes); /* AC000 AC011 */
break;
END
case 'N': /* AC011 */
BEGIN
/* display NO character in next location */
*--s = c(No); /* AC000 */
if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
attribute = c(GRAY_ON_BLACK); /* AN006 */
if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
attribute = c(WHITE_ON_BLUE); /* AC006 */
VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
*s++ = c(No); /* AC000 AC011 */
break;
END
case 'S':
BEGIN
input_row = row;
input_col = col;
break;
END
case 'C':
BEGIN
/* Clear from current position to end of line */
clear_screen(row,col,row,u(79)); /* AC000 */
break;
END
case '\0':
BEGIN
/* Message string error - string ended in the middle of control string*/
insert[0] = c('7'); /* AC000 */
display(debug_msg);
break;
END
default:
BEGIN
/* Message string error - no valid control char found */
insert[0] = c('6'); /* AC000 */
display(debug_msg);
break;
END
END /* Switch */
END /* While */
/* Get the pointer past the '>' */
s++;
break;
END /* control characters */
/* Check for row,col */
case '^': /* AC000 */
BEGIN
s++;
/* determine the row to put the message on */
if ( !isdigit(*s) )
BEGIN
/* Message string error */
insert[0] = c('2'); /* AC000 */
display(debug_msg);
END
else
BEGIN
row = row+((unsigned)(((*s++ - '0')*10)));
if ( !isdigit(*s) )
BEGIN
/* Message string error */
insert[0] = c('2'); /* AC000 */
display(debug_msg);
END
else
BEGIN
row = row+((unsigned)(*s++ - '0'));
/* determine the col to put the message on */
if ( !isdigit(*s) )
BEGIN
/* Message string error */
insert[0] = c('3'); /* AC000 */
display(debug_msg);
END
else
BEGIN
col = ((unsigned)(*s++ - '0'));
if ( !isdigit(*s) )
BEGIN
/* Message string error */
insert[0] = c('3'); /* AC000 */
display(debug_msg);
END
else
BEGIN
col = ((unsigned)((col* 10) + (*s++ - '0')));
if (*s++ != c('^')) /* AC000 */
BEGIN
/* Message string error */
insert[0] = c('4'); /* AC000 */
display(debug_msg);
END /* 2nd sq bracket */
END /* 2nd digit col */
END /* 1st digit col */
END /* 2nd digit row */
END /* 1st digit row */
break;
END
/* Handle anything else */
default:
BEGIN
/* See if attribute set to anything */
if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
attribute = c(WHITE_ON_BLUE); /* AC006 */
if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
attribute = c(GRAY_ON_BLACK); /* AN006 */
VIOWRTCHARSTRATT(s++,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
break;
END
END
END /* End of string check */
END /* No characters in string check */
return;
END
/* */
void number_in_msg(number,start)
XFLOAT number;
unsigned start;
BEGIN
char mbytes[32];
/* Divide the space down and get it into decimal */
sprintf(mbytes,"%4.0d",number);
insert[start+0] = mbytes[0];
insert[start+1] = mbytes[1];
insert[start+2] = mbytes[2];
insert[start+3] = mbytes[3];
return;
END
/* */
void percent_in_msg(number,start) /* AN000 */
unsigned number; /* AN000 */
unsigned start; /* AN000 */
BEGIN /* AN000 */
char percent[32];
/* Divide the space down and get it into decimal */
sprintf(percent,"%3.0d%%",number); /* AC000 */
insert[start+0] = percent[0]; /* AC000 */
insert[start+1] = percent[1]; /* AC000 */
insert[start+2] = percent[2]; /* AC000 */
insert[start+3] = percent[3]; /* AC000 */
return;
END /* AN000 */
/* */
void string_in_msg(string_ptr,start) /* AN000 */
char far *string_ptr; /* AN000 */
unsigned start; /* AN000 */
BEGIN /* AN000 */
unsigned i; /* AN000 */
/* init the 8 spots to blanks */
for (i = u(0); i < u(8);i++) /* AN000 */
BEGIN /* AN000 */
insert[start+i] = c(' '); /* AN000 */
END /* AN000 */
/* Put characters into the array */
BEGIN /* AN000 */
insert[start+0] = *(string_ptr+0); /* AN000 */
insert[start+1] = *(string_ptr+1); /* AN000 */
insert[start+2] = *(string_ptr+2); /* AN000 */
insert[start+3] = *(string_ptr+3); /* AN000 */
insert[start+4] = *(string_ptr+4); /* AN000 */
insert[start+5] = *(string_ptr+5); /* AN000 */
insert[start+6] = *(string_ptr+6); /* AN000 */
insert[start+7] = *(string_ptr+7); /* AN000 */
END /* AN000 */
return; /* AN000 */
END /* AN000 */
/* */
void volume_in_msg(string_ptr,start) /* AN000 */
char far *string_ptr; /* AN000 */
unsigned start; /* AN000 */
BEGIN /* AN000 */
unsigned i; /* AN000 */
/* init the 11 spots to blanks */
for (i = u(0); i < u(11);i++) /* AN000 */
BEGIN /* AN000 */
insert[start+i] = c(' '); /* AN000 */
END /* AN000 */
/* Put characters into the array */
BEGIN /* AN000 */
insert[start+0] = *(string_ptr+0); /* AN000 */
insert[start+1] = *(string_ptr+1); /* AN000 */
insert[start+2] = *(string_ptr+2); /* AN000 */
insert[start+3] = *(string_ptr+3); /* AN000 */
insert[start+4] = *(string_ptr+4); /* AN000 */
insert[start+5] = *(string_ptr+5); /* AN000 */
insert[start+6] = *(string_ptr+6); /* AN000 */
insert[start+7] = *(string_ptr+7); /* AN000 */
insert[start+8] = *(string_ptr+8); /* AN000 */
insert[start+9] = *(string_ptr+9); /* AN000 */
insert[start+10] = *(string_ptr+10); /* AN000 */
END /* AN000 */
return; /* AN000 */
END /* AN000 */
|