Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
6b10a54f
Commit
6b10a54f
authored
Jan 03, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement kdebugf.
parent
6f66e559
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
util.c
util.c
+2
-2
util.h
util.h
+12
-3
No files found.
util.c
View file @
6b10a54f
...
...
@@ -133,11 +133,11 @@ timeval_min_sec(struct timeval *d, int secs)
}
void
do_debugf
(
const
char
*
format
,
...)
do_debugf
(
int
level
,
const
char
*
format
,
...)
{
va_list
args
;
va_start
(
args
,
format
);
if
(
debug
>=
2
)
if
(
debug
>=
level
)
vfprintf
(
stderr
,
format
,
args
);
va_end
(
args
);
fflush
(
stderr
);
...
...
util.h
View file @
6b10a54f
...
...
@@ -36,7 +36,8 @@ int timeval_compare(const struct timeval *s1, const struct timeval *s2)
ATTRIBUTE
((
pure
));
void
timeval_min
(
struct
timeval
*
d
,
const
struct
timeval
*
s
);
void
timeval_min_sec
(
struct
timeval
*
d
,
int
secs
);
void
do_debugf
(
const
char
*
format
,
...)
ATTRIBUTE
((
format
(
printf
,
1
,
2
)));
void
do_debugf
(
int
leve
,
const
char
*
format
,
...)
ATTRIBUTE
((
format
(
printf
,
2
,
3
)));
int
in_prefix
(
const
unsigned
char
*
address
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
ATTRIBUTE
((
pure
));
...
...
@@ -58,12 +59,20 @@ void v4tov6(unsigned char *dst, const unsigned char *src);
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#define debugf(...) \
do { \
if(debug >= 2) do_debugf(__VA_ARGS__); \
if(debug >= 2) do_debugf(2, __VA_ARGS__); \
} while(0)
#define kdebugf(...) \
do { \
if(debug >= 3) do_debugf(3, __VA_ARGS__); \
} while(0)
#elif defined(__GNUC__)
#define debugf(_args...) \
do { \
if(debug >= 2) do_debugf(_args); \
if(debug >= 2) do_debugf(2, _args); \
} while(0)
#define kdebugf(_args...) \
do { \
if(debug >= 3) do_debugf(3, _args); \
} while(0)
#else
#define debugf do_debugf
...
...
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