git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6eaa49f
)
Implement extensible strings with catprintf.
author
Richard W.M. Jones
<rjones@redhat.com>
Thu, 23 Apr 2009 17:52:06 +0000
(18:52 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Thu, 23 Apr 2009 17:52:06 +0000
(18:52 +0100)
daemon/daemon.h
patch
|
blob
|
history
diff --git
a/daemon/daemon.h
b/daemon/daemon.h
index
3f51056
..
331fc0d
100644
(file)
--- a/
daemon/daemon.h
+++ b/
daemon/daemon.h
@@
-92,6
+92,14
@@
extern void send_file_end (int cancel);
/* only call this if there is a FileOut parameter */
extern void reply (xdrproc_t xdrp, char *ret);
/* only call this if there is a FileOut parameter */
extern void reply (xdrproc_t xdrp, char *ret);
+/* Append to existing string. If existing string is NULL then
+ * this creates a new string. This uses an "interesting" variation
+ * of asprintf.
+ */
+
+#define catprintf(strp,fs,...) \
+ asprintf ((strp), "%s" fs, *(strp) ? *(strp) : "", __VA_ARGS__)
+
/* Helper for functions that need a root filesystem mounted.
* NB. Cannot be used for FileIn functions.
*/
/* Helper for functions that need a root filesystem mounted.
* NB. Cannot be used for FileIn functions.
*/