Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4e0484df
...
4e0484dff6d9d62f18e808cd76466a6323695828
authored
2001-06-20 02:24:28 +0000
by
Sam Roberts
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New function: debug_printv() to complement debug_print().
1 parent
2ca7e23d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
include/mailutils/debug.h
mailbox/debug.c
include/mailutils/debug.h
View file @
4e0484d
...
...
@@ -45,6 +45,8 @@ extern int debug_set_level __P ((debug_t, size_t level));
extern
int
debug_get_level
__P
((
debug_t
,
size_t
*
plevel
));
extern
int
debug_print
__P
((
debug_t
debug
,
size_t
level
,
const
char
*
format
,
...));
extern
int
debug_printv
__P
((
debug_t
debug
,
size_t
level
,
const
char
*
format
,
va_list
argp
));
extern
int
debug_set_print
__P
((
debug_t
,
int
(
*
_print
)
__P
((
debug_t
,
const
char
*
,
va_list
)),
void
*
owner
));
#ifdef __cplusplus
...
...
mailbox/debug.c
View file @
4e0484d
...
...
@@ -98,17 +98,29 @@ debug_print (debug_t debug, size_t level, const char *format, ...)
{
va_list
ap
;
va_start
(
ap
,
format
);
debug_printv
(
debug
,
level
,
format
,
ap
);
va_end
(
ap
);
return
0
;
}
int
debug_printv
(
debug_t
debug
,
size_t
level
,
const
char
*
format
,
va_list
ap
)
{
if
(
debug
==
NULL
||
format
==
NULL
)
return
EINVAL
;
if
(
!
(
debug
->
level
&
level
))
return
0
;
va_start
(
ap
,
format
);
if
(
debug
->
_print
)
debug
->
_print
(
debug
,
format
,
ap
);
else
vfprintf
(
stderr
,
format
,
ap
);
va_end
(
ap
);
return
0
;
}
...
...
Please
register
or
sign in
to post a comment