Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
404a5250
Commit
404a5250
authored
Sep 03, 1998
by
Niels Möller
Browse files
Addedverbose() and verbose_safe() methods.
Rev: src/werror.c:1.5 Rev: src/werror.h:1.4
parent
3a9b7529
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/werror.c
View file @
404a5250
...
...
@@ -10,6 +10,7 @@
int
debug_flag
=
0
;
int
quiet_flag
=
0
;
int
verbose_flag
=
0
;
void
werror
(
char
*
format
,
...)
{
...
...
@@ -35,6 +36,18 @@ void debug(char *format, ...)
}
}
void
verbose
(
char
*
format
,
...)
{
va_list
args
;
if
(
verbose_flag
)
{
va_start
(
args
,
format
);
vfprintf
(
stderr
,
format
,
args
);
va_end
(
args
);
}
}
/* Escape non-printable characters. */
void
werror_washed
(
UINT32
length
,
UINT8
*
msg
)
{
...
...
@@ -53,7 +66,7 @@ void werror_washed(UINT32 length, UINT8 *msg)
default:
if
(
!
isprint
(
msg
[
i
]))
{
fprintf
(
stderr
,
"
\\
x%2x"
,
msg
[
i
]);
fprintf
(
stderr
,
"
\\
x%
0
2x"
,
msg
[
i
]);
break
;
}
/* Fall through */
...
...
@@ -77,6 +90,12 @@ void debug_safe(UINT32 length, UINT8 *msg)
werror_washed
(
length
,
msg
);
}
void
verbose_safe
(
UINT32
length
,
UINT8
*
msg
)
{
if
(
verbose_flag
)
werror_washed
(
length
,
msg
);
}
void
fatal
(
char
*
format
,
...)
{
va_list
args
;
...
...
src/werror.h
View file @
404a5250
...
...
@@ -10,13 +10,16 @@
/* Global variables */
extern
int
debug_flag
;
extern
int
quiet_flag
;
extern
int
verbose_flag
;
void
werror
(
char
*
format
,
...)
PRINTF_STYLE
(
1
,
2
);
void
debug
(
char
*
format
,
...)
PRINTF_STYLE
(
1
,
2
);
void
verbose
(
char
*
format
,
...)
PRINTF_STYLE
(
1
,
2
);
/* For outputting data recieved from the other end */
void
werror_safe
(
UINT32
length
,
UINT8
*
msg
);
void
debug_safe
(
UINT32
length
,
UINT8
*
msg
);
void
verbose_safe
(
UINT32
length
,
UINT8
*
msg
);
void
fatal
(
char
*
format
,
...)
PRINTF_STYLE
(
1
,
2
)
NORETURN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment