From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, aliguori@us.ibm.com, kraxel@redhat.com,
fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH 1/4] qstring: add qstring_get_length()
Date: Tue, 2 Apr 2013 16:18:14 -0400 [thread overview]
Message-ID: <1364933897-25803-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1364933897-25803-1-git-send-email-lcapitulino@redhat.com>
Long overdue.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
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
next prev parent reply other threads:[~2013-04-02 20:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-02 20:18 [Qemu-devel] [PATCH v2 0/4] Monitor: make output buffer dynamic Luiz Capitulino
2013-04-02 20:18 ` Luiz Capitulino [this message]
2013-04-02 20:18 ` [Qemu-devel] [PATCH 2/4] Monitor: Make " Luiz Capitulino
2013-04-02 20:48 ` Eric Blake
2013-04-02 20:18 ` [Qemu-devel] [PATCH 3/4] hmp: human-monitor-command: stop using the Memory chardev driver Luiz Capitulino
2013-04-02 20:44 ` Eric Blake
2013-04-03 13:33 ` Luiz Capitulino
2013-04-02 20:18 ` [Qemu-devel] [PATCH 4/4] chardev: drop " Luiz Capitulino
2013-04-02 20:50 ` Eric Blake
2013-04-03 8:23 ` [Qemu-devel] [PATCH v2 0/4] Monitor: make output buffer dynamic Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364933897-25803-2-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=fred.konrad@greensocs.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).