From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MySMR-0007hq-W3 for qemu-devel@nongnu.org; Thu, 15 Oct 2009 11:35:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MySMN-0007ff-Gw for qemu-devel@nongnu.org; Thu, 15 Oct 2009 11:35:27 -0400 Received: from [199.232.76.173] (port=51895 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MySMN-0007fY-BG for qemu-devel@nongnu.org; Thu, 15 Oct 2009 11:35:23 -0400 Received: from qw-out-1920.google.com ([74.125.92.145]:22415) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MySMM-0000uj-Rr for qemu-devel@nongnu.org; Thu, 15 Oct 2009 11:35:22 -0400 Received: by qw-out-1920.google.com with SMTP id 5so281660qwc.4 for ; Thu, 15 Oct 2009 08:35:22 -0700 (PDT) Message-ID: <4AD74134.3080506@codemonkey.ws> Date: Thu, 15 Oct 2009 10:35:16 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 01/10] Introduce qmisc module References: <1255037747-3340-1-git-send-email-lcapitulino@redhat.com> <1255037747-3340-2-git-send-email-lcapitulino@redhat.com> <4AD72B88.2040107@codemonkey.ws> <20091015122622.1f93ea2d@doriath> In-Reply-To: <20091015122622.1f93ea2d@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org Luiz Capitulino wrote: >>> +/** >>> + * qobject_from_fmt(): build QObjects from a specified format. >>> + * >>> + * Valid characters of the format: >>> + * >>> + * i integer, map to QInt >>> + * s string, map to QString >>> + * [] list, map to QList >>> + * {} dictionary, map to QDict >>> + * >>> + * Examples: >>> + * >>> + * - Create a QInt >>> + * >>> + * qobject_from_fmt("i", 42); >>> + * >>> + * - Create a QList of QStrings >>> + * >>> + * qobject_from_fmt("[ i, i, i ]", 0, 1 , 2); >>> + * >>> + * - Create a QDict with mixed data-types >>> + * >>> + * qobject_from_fmt("{ s: [ i, s ], s: i }", ... ); >>> + * >>> + * Return a strong reference to a QObject on success, NULL otherwise. >>> + */ >>> >>> >> But my real objection is that we should make this "{%s: [%d, %s], %s: >> %d}" so that we can mark it as a printf formatted function and get type >> checking. You'll probably have to support both "%d" and "%" PRId64 for >> sanity sake. >> > > Trivial to do if we ignore the '%' characters. :)) > Okay, I'd like to see that and I'd like to see string parsing. We can rewrite the parser later. Regards, Anthony Liguori