File: wiseoverlay.c

package info (click to toggle)
wise 2.4.1-21
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 27,140 kB
  • sloc: ansic: 276,365; makefile: 1,003; perl: 886; lex: 93; yacc: 81; sh: 24
file content (92 lines) | stat: -rw-r--r-- 1,657 bytes parent folder | download | duplicates (10)
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
#ifdef _cplusplus
extern "C" {
#endif
#include "wiseoverlay.h"

static boolean isinuse=FALSE;
static FILE * overlay = NULL;
static int delete_len=0;


/* Function:  start_overlay(over)
 *
 * Descrip:    actually starts on overlay system
 *             on the FILE*. Should really by stderr...
 *             nothing else makes sense.
 *
 *
 * Arg:        over [UNKN ] Undocumented argument [FILE *]
 *
 */
# line 22 "wiseoverlay.dy"
void start_overlay(FILE * over)
{
  overlay=over;
  isinuse=TRUE;
}

/* Function:  stop_overlay(void)
 *
 * Descrip:    finishes an overlay system by putting in a
 *             newline and clearing the static variables
 *
 *
 *
 */
# line 32 "wiseoverlay.dy"
void stop_overlay(void)
{
  fprintf(overlay,"\n");
  delete_len=0;
  overlay=NULL;
  isinuse=FALSE;
}

/* Function:  print_overlay(msg,)
 *
 * Descrip:    Does the business. Deletes the previous
 *             message with \b and then prints the current
 *             one ontop. 
 *
 *             don't put in \n's otherwise this is going to 
 *             look yukky ;)
 *
 *
 * Arg:        msg [UNKN ] Undocumented argument [char *]
 * Arg:            [UNKN ] Undocumented argument [.]
 *
 */
# line 48 "wiseoverlay.dy"
void print_overlay(char * msg, ... )
{
  char buffer[512];
  va_list ap;
  register int i;	
  
  if( isinuse == FALSE)
    /* error message */
    return;
  
  
  va_start(ap,msg);
	
  for(i=0;i<delete_len;i++)
    fputc('\b',overlay);
  
  vsprintf(buffer,msg,ap);
  
  delete_len=strlen(buffer);
  
  fprintf(overlay,"%s",buffer);
  fflush(overlay);
  
  va_end(ap);
  
  return;
}

# line 81 "wiseoverlay.c"

#ifdef _cplusplus
}
#endif