From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PULL 1/4] qstring: add qstring_get_length()
Date: Fri, 5 Apr 2013 09:12:08 -0400 [thread overview]
Message-ID: <1365167531-17553-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1365167531-17553-1-git-send-email-lcapitulino@redhat.com>
Long overdue.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@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-05 13:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 13:12 [Qemu-devel] [PULL 0/4] QMP queue Luiz Capitulino
2013-04-05 13:12 ` Luiz Capitulino [this message]
2013-04-05 13:12 ` [Qemu-devel] [PULL 2/4] Monitor: Make output buffer dynamic Luiz Capitulino
2013-04-05 13:12 ` [Qemu-devel] [PULL 3/4] hmp: human-monitor-command: stop using the Memory chardev driver Luiz Capitulino
2013-04-05 13:12 ` [Qemu-devel] [PULL 4/4] chardev: drop " Luiz Capitulino
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=1365167531-17553-2-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.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).