qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com, fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH 1/2] qstring: add qobject_get_length()
Date: Mon, 25 Mar 2013 15:40:38 -0400	[thread overview]
Message-ID: <1364240439-23450-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1364240439-23450-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

  reply	other threads:[~2013-03-25 19:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 19:40 [Qemu-devel] [PATCH 0/2] Monitor: make output buffer dynamic Luiz Capitulino
2013-03-25 19:40 ` Luiz Capitulino [this message]
2013-04-09  3:02   ` [Qemu-devel] [PATCH 1/2] qstring: add qobject_get_length() Hu Tao
2013-04-09 12:38     ` Luiz Capitulino
2013-03-25 19:40 ` [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic Luiz Capitulino
2013-03-25 21:07   ` Paolo Bonzini
2013-03-25 21:44     ` Luiz Capitulino
2013-03-27  6:45   ` Wenchao Xia
2013-03-27 12:27     ` Luiz Capitulino
2013-03-28  3:21       ` Wenchao Xia
2013-04-02  9:18     ` Gerd Hoffmann
2013-04-02  9:19 ` [Qemu-devel] [PATCH 0/2] Monitor: make " 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=1364240439-23450-2-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@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).