disas/nanomips: Remove CPR function
[qemu/armbru.git] / fsdev / 9p-marshal.c
blobf9b0336cd59d7e4247c511d0bcf68e95802c2966
1 /*
2 * 9p backend
4 * Copyright IBM, Corp. 2010
6 * Authors:
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.
14 #include "qemu/osdep.h"
15 #include <glib/gprintf.h>
16 #include <dirent.h>
17 #include <utime.h>
19 #include "9p-marshal.h"
21 P9ARRAY_DEFINE_TYPE(V9fsString, v9fs_string_free);
23 void v9fs_string_free(V9fsString *str)
25 g_free(str->data);
26 str->data = NULL;
27 str->size = 0;
30 void G_GNUC_PRINTF(2, 3)
31 v9fs_string_sprintf(V9fsString *str, const char *fmt, ...)
33 va_list ap;
35 v9fs_string_free(str);
37 va_start(ap, fmt);
38 str->size = g_vasprintf(&str->data, fmt, ap);
39 va_end(ap);
42 void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs)
44 v9fs_string_free(lhs);
45 v9fs_string_sprintf(lhs, "%s", rhs->data);