4 * Copyright IBM, Corp. 2010
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
15 #include <glib/gprintf.h>
16 #include <sys/types.h>
25 #include "qemu/compiler.h"
26 #include "9p-marshal.h"
28 void v9fs_string_free(V9fsString
*str
)
35 void v9fs_string_null(V9fsString
*str
)
37 v9fs_string_free(str
);
40 void GCC_FMT_ATTR(2, 3)
41 v9fs_string_sprintf(V9fsString
*str
, const char *fmt
, ...)
45 v9fs_string_free(str
);
48 str
->size
= g_vasprintf(&str
->data
, fmt
, ap
);
52 void v9fs_string_copy(V9fsString
*lhs
, V9fsString
*rhs
)
54 v9fs_string_free(lhs
);
55 v9fs_string_sprintf(lhs
, "%s", rhs
->data
);