From: craven Date: Thu, 12 Jul 2012 07:43:21 +0000 (+0200) Subject: Structured Formatters for JSON Output X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=59a534b941810749854c8610fd87a90df9a7772f;p=notmuch-archives.git Structured Formatters for JSON Output --- diff --git a/f0/a31d3766214b7497f95da6c619c9a3ca6ab021 b/f0/a31d3766214b7497f95da6c619c9a3ca6ab021 new file mode 100644 index 000000000..d5837c434 --- /dev/null +++ b/f0/a31d3766214b7497f95da6c619c9a3ca6ab021 @@ -0,0 +1,68 @@ +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 644FE431FC7 + for ; Thu, 12 Jul 2012 00:42:10 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.001 +X-Spam-Level: +X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 + tests=[FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] + 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 R2pb9xRe7Xq5 for ; + Thu, 12 Jul 2012 00:42:10 -0700 (PDT) +Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) + by olra.theworths.org (Postfix) with SMTP id 9E3F8431FAE + for ; Thu, 12 Jul 2012 00:42:09 -0700 (PDT) +Received: (qmail invoked by alias); 12 Jul 2012 07:42:02 -0000 +Received: from gw.arelion.cust.net.lagis.at (EHLO dodekanex.arelion.at) + [83.164.197.182] + by mail.gmx.net (mp033) with SMTP; 12 Jul 2012 09:42:02 +0200 +X-Authenticated: #201305 +X-Provags-ID: V01U2FsdGVkX19uyYcosdlugZbxWUIO4vqOl3GmgQ8WephdZfN7M7 + 4ENuSjvnTyIjUi +Received: by dodekanex.arelion.at (Postfix, from userid 1000) + id F039C3011C0; Thu, 12 Jul 2012 09:43:30 +0200 (CEST) +From: +To: notmuch@notmuchmail.org +Subject: Structured Formatters for JSON Output +Date: Thu, 12 Jul 2012 09:43:21 +0200 +Message-Id: <1342079004-5300-1-git-send-email-craven@gmx.net> +X-Mailer: git-send-email 1.7.11.1 +In-Reply-To: <87d34hsdx8.fsf@awakening.csail.mit.edu> +References: <87d34hsdx8.fsf@awakening.csail.mit.edu> +X-Y-GMX-Trusted: 0 +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 07:42:10 -0000 + +Currently there is no easy way to add support for different structured +formatters (like JSON). For example, adding support for S-Expressions +would result in code duplication. + +This patch series amends the situation by introducing structured +formatters, which allow different implementations of structured output +for elements like lists, maps, strings and numbers. + +The new code in sprinter.h and sprinter.c can be used +instead of the current ad-hoc output in all parts of notmuch, a patch +for notmuch-search.c is included. + +In a later patch, all other parts of notmuch should be adapted to the +structured formatters, and the creation of formatters should be +centralised (to make adding new formatters easier). +