From: Austin Clements Date: Fri, 3 Aug 2012 01:14:51 +0000 (+2000) Subject: [PATCH v3 05/13] reply: Create a JSON sprinter X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ce3d92a2070a9502f78261fd8519ddd8a704cb60;p=notmuch-archives.git [PATCH v3 05/13] reply: Create a JSON sprinter --- diff --git a/d5/621b7205c479cae87ef0a48a64fe39e9803470 b/d5/621b7205c479cae87ef0a48a64fe39e9803470 new file mode 100644 index 000000000..966332f9c --- /dev/null +++ b/d5/621b7205c479cae87ef0a48a64fe39e9803470 @@ -0,0 +1,109 @@ +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 ADB12431FAE + for ; Thu, 2 Aug 2012 18:15:09 -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 oBDuI8K3eyNH for ; + Thu, 2 Aug 2012 18:15:09 -0700 (PDT) +Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU + [18.9.25.12]) + by olra.theworths.org (Postfix) with ESMTP id E47E8431E62 + for ; Thu, 2 Aug 2012 18:15:07 -0700 (PDT) +X-AuditID: 1209190c-b7f806d000006b87-15-501b261b568a +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP + id 1C.2B.27527.B162B105; Thu, 2 Aug 2012 21:15:07 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q731F6oQ012764; + Thu, 2 Aug 2012 21:15:06 -0400 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q731F4oO002787 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 2 Aug 2012 21:15:05 -0400 (EDT) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1Sx6To-0003wJ-6n; Thu, 02 Aug 2012 21:15:04 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v3 05/13] reply: Create a JSON sprinter +Date: Thu, 2 Aug 2012 21:14:51 -0400 +Message-Id: <1343956499-14543-6-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1343956499-14543-1-git-send-email-amdragon@mit.edu> +References: <1343956499-14543-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixCmqrCutJh1gsOKzrMXquTwW12/OZLZ4 + s3IeqwOzx85Zd9k9Dn9dyOLxbNUt5gDmKC6blNSczLLUIn27BK6MEzemMRbcYq/49PYIcwNj + B1sXIyeHhICJxOFFr1kgbDGJC/fWA8W5OIQE9jFKTFuzCspZzyjRtPwaO4TzkEni9rbpzCAt + QgJzGSWmHy0FsdkENCS27V/OCGKLCEhL7Lw7mxXEZhaIk9gy5T9YXFjAXOLJvW9gNouAqsSS + 6ZvA5vAKOEgcb5oIdZK8xNP7fWA2p4CjxOu3rxghdjlILG/rZp3AyL+AkWEVo2xKbpVubmJm + TnFqsm5xcmJeXmqRrqFebmaJXmpK6SZGcHBJ8uxgfHNQ6RCjAAejEg/vLTHpACHWxLLiytxD + jJIcTEqivMxKQCG+pPyUyozE4oz4otKc1OJDjBIczEoivFVLpAKEeFMSK6tSi/JhUtIcLEri + vJdTbvoLCaQnlqRmp6YWpBbBZGU4OJQkeOerAA0VLEpNT61Iy8wpQUgzcXCCDOcBGn4MpIa3 + uCAxtzgzHSJ/ilFRSpx3EchFAiCJjNI8uF5Y9L9iFAd6RZh3Kkg7DzBxwHW/AhrMBDTYzgzk + 6uKSRISUVAPj1DzH71/evwp51yA7Yz7nMUaHOvH5HgV7DDg74uNjuYLTJZnY0rZxT3g7aaa9 + t2DRxq7P9tuWtl1v0+bzNmpyXfiW3zlkln3px+X9Lq9FJl5QcvBvaM4Pv3lzzrOr63RfH9Tl + W7tn7mSPh8G2QT8ufTkrULhg1bGP+3T1hD95vJ908azD0dfHlFiKMxINtZiLihMBR+L1DtkC AAA= +Cc: tomi.ollila@iki.fi +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: Fri, 03 Aug 2012 01:15:10 -0000 + +--- + notmuch-reply.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/notmuch-reply.c b/notmuch-reply.c +index de21f3b..e42ba79 100644 +--- a/notmuch-reply.c ++++ b/notmuch-reply.c +@@ -22,6 +22,7 @@ + + #include "notmuch-client.h" + #include "gmime-filter-headers.h" ++#include "sprinter.h" + + static void + show_reply_headers (GMimeMessage *message) +@@ -596,6 +597,7 @@ notmuch_reply_format_json(void *ctx, + notmuch_messages_t *messages; + notmuch_message_t *message; + mime_node_t *node; ++ sprinter_t *sp; + + if (notmuch_query_count_messages (query) != 1) { + fprintf (stderr, "Error: search term did not match precisely one message.\n"); +@@ -611,6 +613,8 @@ notmuch_reply_format_json(void *ctx, + if (!reply) + return 1; + ++ sp = sprinter_json_create (ctx, stdout); ++ + /* The headers of the reply message we've created */ + printf ("{\"reply-headers\": "); + format_headers_json (ctx, reply, TRUE); +-- +1.7.10 +