]> Git Repo - qemu.git/blame - fsdev/9p-marshal.c
piix: Set I440FXState member pci_info.w32 in one place
[qemu.git] / fsdev / 9p-marshal.c
CommitLineData
829dd286
WL
1/*
2 * 9p backend
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Anthony Liguori <[email protected]>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
fbc04127 14#include "qemu/osdep.h"
829dd286 15#include <glib/gprintf.h>
829dd286 16#include <dirent.h>
829dd286 17#include <utime.h>
829dd286 18
829dd286
WL
19#include "9p-marshal.h"
20
21void v9fs_string_free(V9fsString *str)
22{
23 g_free(str->data);
24 str->data = NULL;
25 str->size = 0;
26}
27
28void v9fs_string_null(V9fsString *str)
29{
30 v9fs_string_free(str);
31}
32
33void GCC_FMT_ATTR(2, 3)
34v9fs_string_sprintf(V9fsString *str, const char *fmt, ...)
35{
36 va_list ap;
37
38 v9fs_string_free(str);
39
40 va_start(ap, fmt);
41 str->size = g_vasprintf(&str->data, fmt, ap);
42 va_end(ap);
43}
44
45void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs)
46{
47 v9fs_string_free(lhs);
48 v9fs_string_sprintf(lhs, "%s", rhs->data);
49}
This page took 0.046239 seconds and 4 git commands to generate.