Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B4E93431FCB for ; Thu, 12 Jul 2012 13:35:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eRvd6v59h+Ez for ; Thu, 12 Jul 2012 13:35:03 -0700 (PDT) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by olra.theworths.org (Postfix) with ESMTP id CF6EE431FAF for ; Thu, 12 Jul 2012 13:35:02 -0700 (PDT) X-AuditID: 12074423-b7f396d0000008f4-7a-4fff34f6eea3 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id EF.F6.02292.6F43FFF4; Thu, 12 Jul 2012 16:35:02 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q6CKZ1eY012353; Thu, 12 Jul 2012 16:35:01 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6CKYxvm003237 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 12 Jul 2012 16:35:00 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1SpQ6F-0004gZ-2F; Thu, 12 Jul 2012 16:34:59 -0400 Date: Thu, 12 Jul 2012 16:34:59 -0400 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH v4 2/3] Add structured output formatter for JSON. Message-ID: <20120712203459.GH7332@mit.edu> References: <87d34hsdx8.fsf@awakening.csail.mit.edu> <1342079004-5300-1-git-send-email-craven@gmx.net> <1342079004-5300-3-git-send-email-craven@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IR4hTV1v1m8t/fYMYEIYu9De2MFtdvzmS2 eLNyHqsDs8fiTfvZPA5/Xcji8WzVLeYA5igum5TUnMyy1CJ9uwSujL8zXrEVtPFV3Ft6h6WB sZO7i5GTQ0LAROLFwbOsELaYxIV769m6GLk4hAT2MUrMmf+YCcLZwCjx/nU/M0iVkMBJJolz L0sgEksYJT60d4ElWARUJSY9X8IGYrMJaEhs27+cEcQWEVCReNC2HmwFs4C2xJSVd5lAbGEB V4nWp2/AbF6g+N7TW1ghFhxilJi/3B4iLihxcuYTFoheLYkb/14C1XMA2dISy/9xgJicAgYS W67qgVSIAm2acnIb2wRGoVlImmchaZ6F0LyAkXkVo2xKbpVubmJmTnFqsm5xcmJeXmqRrple bmaJXmpK6SZGUKCzuyjvYPxzUOkQowAHoxIPr/DGv/5CrIllxZW5hxglOZiURHk1jP/7C/El 5adUZiQWZ8QXleakFgN9wcGsJMKbJQGU401JrKxKLcqHSUlzsCiJ815LuekvJJCeWJKanZpa kFoEk5Xh4FCS4JUBRrSQYFFqempFWmZOCUKaiYMTZDgP0HAOkBre4oLE3OLMdIj8KUZFKXHe 8yAXCYAkMkrz4HphiegVozjQK8K8PCDtPMAkBtf9CmgwE9DgWT//gQwuSURISTUwqvsVRWxu ++DuKn6Zp0ucccW092ari2aGvDnE9DD5B++dreX1a383XAq4e/IQb+aZrM5p9pP5T9+XCY43 PaUQmdE2W237pcv/PgqwlDMElkcyXzsfonk176Ihl9buaW9vc6+tYxZjNkvr+beQ4cCx1lbb WdNNa74saPNLivcXqdgYvXf6mbtHlViKMxINtZiLihMBAAWa/B8DAAA= Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 20:35:04 -0000 Quoth Tomi Ollila on Jul 12 at 1:10 pm: > On Thu, Jul 12 2012, craven@gmx.net wrote: > > > Using the new structured printer support in sprinter.h, implement > > sprinter_json_new, which returns a new JSON structured output > > formatter. > > > > The formatter prints output similar to the existing JSON, but with > > differences in whitespace (mostly newlines). > > --- > > Makefile.local | 1 + > > sprinter.c | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 173 insertions(+) > > create mode 100644 sprinter.c > > > > diff --git a/Makefile.local b/Makefile.local > > index a890df2..8baf0c2 100644 > > --- a/Makefile.local > > +++ b/Makefile.local > > @@ -290,6 +290,7 @@ notmuch_client_srcs = \ > > notmuch-show.c \ > > notmuch-tag.c \ > > notmuch-time.c \ > > + sprinter.c \ > > query-string.c \ > > mime-node.c \ > > crypto.c \ > > diff --git a/sprinter.c b/sprinter.c > > new file mode 100644 > > index 0000000..649f79a > > --- /dev/null > > +++ b/sprinter.c > > @@ -0,0 +1,172 @@ > > +#include > > +#include > > +#include > > +#include "sprinter.h" > > + > > +#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) > > You're including sprinter.h which includes notmuch-client.h which > defines ARRAY_SIZE (Interesting that you did not get error(/warning?) > about this) > > Rest looks good -- except the whitespace -- as I looked through Austin's > code yesterday you're just replicated the same lines :D. Easiest > to fix is probably just running > uncrustify -c devel/uncrustify.cfg --replace sprinter.c Oops. Shame on me. Is anything wrong besides the missing space before the argument list of all of the function declarations?