blob: f41f9e4d6cdf15ad413a55cbec8ab82d434e764b (
plain)
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
|
/* ia32-debug.c - ia32 debug output functionality
*
* by scut
*/
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <ia32-debug.h>
int ia32_verbosity = 1;
int ia32_confirm_all = 0;
int
ia32_verbose (int vlevel)
{
if (vlevel > ia32_verbosity)
return (0);
return (1);
}
int
ia32_debug (int vlevel, const char *fmt, ...)
{
int len;
va_list ap;
if (ia32_verbose (vlevel) == 0)
return (0);
va_start (ap, fmt);
len = vfprintf (stderr, fmt, ap);
va_end (ap);
return (len);
}
void
ia32_confirm (void)
{
char rdummy[2];
fprintf (stderr, "CONFIRM: press return");
if (ia32_confirm_all) {
fprintf (stderr, "\n");
return;
}
read (0, rdummy, 1);
}
|