[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/6] qstring: add qobject_get_length()
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 5/6] qstring: add qobject_get_length() |
Date: |
Wed, 27 Mar 2013 14:46:26 -0400 |
Long overdue.
Signed-off-by: Luiz Capitulino <address@hidden>
---
include/qapi/qmp/qstring.h | 1 +
qobject/qstring.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h
index 0e690f4..1bc3666 100644
--- a/include/qapi/qmp/qstring.h
+++ b/include/qapi/qmp/qstring.h
@@ -26,6 +26,7 @@ typedef struct QString {
QString *qstring_new(void);
QString *qstring_from_str(const char *str);
QString *qstring_from_substr(const char *str, int start, int end);
+size_t qstring_get_length(const QString *qstring);
const char *qstring_get_str(const QString *qstring);
void qstring_append_int(QString *qstring, int64_t value);
void qstring_append(QString *qstring, const char *str);
diff --git a/qobject/qstring.c b/qobject/qstring.c
index 5f7376c..607b7a1 100644
--- a/qobject/qstring.c
+++ b/qobject/qstring.c
@@ -32,6 +32,14 @@ QString *qstring_new(void)
}
/**
+ * qstring_get_length(): Get the length of a QString
+ */
+size_t qstring_get_length(const QString *qstring)
+{
+ return qstring->length;
+}
+
+/**
* qstring_from_substr(): Create a new QString from a C string substring
*
* Return string reference
--
1.8.1.4
- [Qemu-devel] [PULL 0/6] QMP queue, Luiz Capitulino, 2013/03/27
- [Qemu-devel] [PULL 3/6] qemu-socket: set passed fd non-blocking in socket_connect(), Luiz Capitulino, 2013/03/27
- [Qemu-devel] [PULL 1/6] oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock(), Luiz Capitulino, 2013/03/27
- [Qemu-devel] [PULL 5/6] qstring: add qobject_get_length(),
Luiz Capitulino <=
- [Qemu-devel] [PULL 2/6] net: ensure "socket" backend uses non-blocking fds, Luiz Capitulino, 2013/03/27
- [Qemu-devel] [PULL 4/6] chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors, Luiz Capitulino, 2013/03/27
- [Qemu-devel] [PULL 6/6] Monitor: Make output buffer dynamic, Luiz Capitulino, 2013/03/27