1 #ifdef _cplusplus
2 extern "C" {
3 #endif
4 #include "wiseoverlay.h"
5 
6 static boolean isinuse=FALSE;
7 static FILE * overlay = NULL;
8 static int delete_len=0;
9 
10 
11 /* Function:  start_overlay(over)
12  *
13  * Descrip:    actually starts on overlay system
14  *             on the FILE*. Should really by stderr...
15  *             nothing else makes sense.
16  *
17  *
18  * Arg:        over [UNKN ] Undocumented argument [FILE *]
19  *
20  */
21 # line 22 "wiseoverlay.dy"
start_overlay(FILE * over)22 void start_overlay(FILE * over)
23 {
24   overlay=over;
25   isinuse=TRUE;
26 }
27 
28 /* Function:  stop_overlay(void)
29  *
30  * Descrip:    finishes an overlay system by putting in a
31  *             newline and clearing the static variables
32  *
33  *
34  *
35  */
36 # line 32 "wiseoverlay.dy"
stop_overlay(void)37 void stop_overlay(void)
38 {
39   fprintf(overlay,"\n");
40   delete_len=0;
41   overlay=NULL;
42   isinuse=FALSE;
43 }
44 
45 /* Function:  print_overlay(msg,)
46  *
47  * Descrip:    Does the business. Deletes the previous
48  *             message with \b and then prints the current
49  *             one ontop.
50  *
51  *             don't put in \n's otherwise this is going to
52  *             look yukky ;)
53  *
54  *
55  * Arg:        msg [UNKN ] Undocumented argument [char *]
56  * Arg:            [UNKN ] Undocumented argument [.]
57  *
58  */
59 # line 48 "wiseoverlay.dy"
print_overlay(char * msg,...)60 void print_overlay(char * msg, ... )
61 {
62   char buffer[512];
63   va_list ap;
64   register int i;
65 
66   if( isinuse == FALSE)
67     /* error message */
68     return;
69 
70 
71   va_start(ap,msg);
72 
73   for(i=0;i<delete_len;i++)
74     fputc('\b',overlay);
75 
76   vsprintf(buffer,msg,ap);
77 
78   delete_len=strlen(buffer);
79 
80   fprintf(overlay,"%s",buffer);
81   fflush(overlay);
82 
83   va_end(ap);
84 
85   return;
86 }
87 
88 # line 81 "wiseoverlay.c"
89 
90 #ifdef _cplusplus
91 }
92 #endif
93