Dolda2000 GitWeb
/
doldaconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7395a37
)
Add bprintf.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 19 Jul 2007 13:56:52 +0000
(15:56 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 19 Jul 2007 13:56:52 +0000
(15:56 +0200)
include/utils.h
patch
|
blob
|
blame
|
history
diff --git
a/include/utils.h
b/include/utils.h
index
8cb40dd
..
d09f172
100644
(file)
--- a/
include/utils.h
+++ b/
include/utils.h
@@
-120,6
+120,13
@@
do { \
memcpy((d) + (d ## data), (s), sizeof(*(d)) * __bufcat_size__); \
(d ## data) += __bufcat_size__; \
} while (0)
+#define bprintf(b, fmt...) \
+ do { \
+ char *__bprintf_dest__; \
+ __bprintf_dest__ = sprintf2(fmt); \
+ bufcat(b, __bprintf_dest__, strlen(__bprintf_dest__)); \
+ free(__bprintf_dest__); \
+ } while(0)
#define freeparr(parr) _freeparr((void **)(parr))
#define parrlen(parr) _parrlen((void **)(parr))